symbol-sdk-typescript-javascript
symbol-sdk-typescript-javascript copied to clipboard
I want a function to BlockService calculating merkleComponentHash from TransactionHashe and cosigner PublicKey.
- Expected behavior and actual behavior.
If I want to use BlockService.validateInBlock , merkleComponentHash must be calculated from TransactionHash in advance. I think it would be useful if validateInBlock works just by specifying transactionInfo.
- Steps to reproduce the problem.
I have confirmed that I can calculate merkleComponentHash by inserting the following logic. However, I have no idea what kind of interface I should use.
var leaf = transactionHash;
if( cosignatures !== undefined && cosignatures.length > 0){
const hasher = jssha3.sha3_256.create();
hasher.update(Buffer.from(transactionHash, 'hex'));
for (cosignature of cosignatures ){
hasher.update(Buffer.from(cosignature.signer.publicKey, 'hex'));
}
leaf = hasher.hex().toUpperCase();
}
I'm in no particular hurry. Please consider this.thanks.
Related to #481