8000 Add unit test for bitcoin_merkle_root functions by tcharding · Pull Request #711 · rust-bitcoin/rust-bitcoin · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add unit test for bitcoin_merkle_root functions #711

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

Merged
merged 1 commit into from
Nov 22, 2021

Conversation

tcharding
Copy link
Member

We test bitcoin_merkle_root over in the blockdata::block module.
Although the bitcoin_merkle_root and bitcoin_merkle_root_inline
functions are almost identical there is enough index manipulation done
that it is not immediately obvious that the code is error free.

Add a unit test that verifies that the two functions return the same
resulting merkle root.

This was done in response to #394.

Copy link
Collaborator
@Kixunil Kixunil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the CI failure.

Also while useful, I think it'd be even better to somehow unify the two functions so same logic would always be guaranteed.

@Kixunil Kixunil added code quality Makes code easier to understand and less likely to lead to problems Tests labels Nov 19, 2021
We test `bitcoin_merkle_root` over in the `blockdata::block` module.
Although the `bitcoin_merkle_root` and `bitcoin_merkle_root_inline`
functions are almost identical there is enough index manipulation done
that it is not immediately obvious that the code is error free.

Add a unit test that verifies that the two functions return the same
resulting merkle root.
Copy link
Collaborator
@Kixunil Kixunil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK e047950

@RCasatta
Copy link
Collaborator

ACK e047950

@RCasatta RCasatta merged commit 615a900 into rust-bitcoin:master Nov 22, 2021
@tcharding tcharding deleted the test-merkle-root branch November 25, 2021 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality Makes code easier to understand and less likely to lead to problems Tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0