Add validateMerkleProof

This commit is contained in:
Sosthene 2025-07-03 17:54:07 +02:00
parent 44f0d8c6c9
commit 4e109e8fba

View File

@ -1412,6 +1412,14 @@ export default class Services {
return this.sdkClient.get_merkle_proof(processState, attributeName);
}
public validateMerkleProof(proof: MerkleProofResult, hash: string): boolean {
try {
return this.sdkClient.validate_merkle_proof(proof, hash);
} catch (e) {
throw new Error(`Failed to validate merkle proof: ${e}`);
}
}
public getLastCommitedState(process: Process): ProcessState | null {
if (process.states.length === 0) return null;
const processTip = process.states[process.states.length - 1].commited_in;