Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add merkletreeparent util functions #53

Merged

Conversation

wregulski
Copy link
Contributor

@wregulski wregulski commented Oct 17, 2024

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, and MerkleTreeParentBytes. ([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 for MerkleTreeParentStr and MerkleTreeParent 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).

  • I have added new unit tests
  • All tests pass locally
  • I have tested manually in my local environment

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have updated CHANGELOG.md with my changes
  • I have run npm run doc and npm run lint one final time before requesting a review

@wregulski wregulski added the enhancement New feature or request label Oct 17, 2024
transaction/merkletreeparent.go Outdated Show resolved Hide resolved
transaction/merkletreeparent.go Outdated Show resolved Hide resolved
@shruggr shruggr changed the base branch from master to feat/api-extension October 18, 2024 14:14
@shruggr shruggr merged commit ce13b00 into bitcoin-sv:feat/api-extension Oct 18, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants