Skip to content

I want a function to BlockService calculating merkleComponentHash from TransactionHashe and cosigner PublicKey. #623

Open
@xembook

Description

@xembook
  1. 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.

  1. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions