feat: add merkletreeparent util functions #53
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Changes
Context:
This package was adopted from:
go-bc and it's used in SPV-Wallet repositories for example for calculating merged BUMP.
This pull request introduces new functionality for calculating Merkle Tree parents, along with corresponding tests. The changes include adding three new functions to the
transaction
package and creating unit tests to ensure their correctness.New functionality for Merkle Tree calculations:
transaction/merkletreeparent.go
: Added three functions for calculating Merkle Tree parents:MerkleTreeParentStr
,MerkleTreeParent
, andMerkleTreeParentBytes
. ([transaction/merkletreeparent.goR1-R54](https://github.com/bitcoin-sv/go-sdk/pull/53/files#diff-8fa5befb90358e9aa105c88a75bbd58837f0e73bc02c9cf501a1c24b141ff3f1R1-R54)
)Unit tests for new functions:
transaction/merkletreeparent_test.go
: Added unit tests forMerkleTreeParentStr
andMerkleTreeParent
to verify their correctness. ([transaction/merkletreeparent_test.goR1-R32](https://github.com/bitcoin-sv/go-sdk/pull/53/files#diff-d0ddc5fccb41065ddee86d95499c66536b1a262fee9c3e0dcf9168a4460b2a39R1-R32)
)Linked Issues / Tickets
No references to specific tasks (maintenance/feedback).
Checklist:
CHANGELOG.md
with my changesnpm run doc
andnpm run lint
one final time before requesting a review