Add validateMerkleProof
This commit is contained in:
parent
44f0d8c6c9
commit
4e109e8fba
@ -1412,6 +1412,14 @@ export default class Services {
|
|||||||
return this.sdkClient.get_merkle_proof(processState, attributeName);
|
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 {
|
public getLastCommitedState(process: Process): ProcessState | null {
|
||||||
if (process.states.length === 0) return null;
|
if (process.states.length === 0) return null;
|
||||||
const processTip = process.states[process.states.length - 1].commited_in;
|
const processTip = process.states[process.states.length - 1].commited_in;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user