-
Notifications
You must be signed in to change notification settings - Fork 829
Add a MerkleBlock construction #268
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
Conversation
d723741
to
6b59e56
Compare
Please rebase, and please also write doctests that are compatible with 1.22 instead of ignoring them if possible. |
@apoelstra rebased & pushed with a hack/fix for the failing doctests on Rust 1.22. |
I'm curious why you use the extra |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK. This looks great, thanks!
Just copy pasted it from the tests but using the FromHex trait looks better as an example. Also I will change the examples a bit because the |
This is a port of the bitcoin-core CPartialMerkleTree and CMerkleBlock classes. Here they are called PartialMerkleTree and MerkleBlock. These are useful for SPV clients that wish to verify that a transaction is present in a specific block in an authenticated way.
Fixed the last issues withe the doctests. |
cf05787 Remove fixed TODO (sanket1729) Pull request description: This TODO was actually from 255 where the bug was in cast_unlikely, even though the issue is labeled with or_i (my bad for not checking). There is no code for `cast_unlikely` as it is treated as or_i. Addressed in 239efd5 Fixes rust-bitcoin#268 ACKs for top commit: apoelstra: ACK cf05787 Tree-SHA512: c55236979dfaac3e104edd35eb191be20fe45b6e994a886603d9b9c5559f49723fdaa10f73eaee7e7d6f30170f948f609e0369cd65c3569585675d432661f74a
This is a port of the bitcoin-core
CPartialMerkleTree
andCMerkleBlock
classes.Here they are called PartialMerkleTree and MerkleBlock.
These are useful for SPV clients that wish to verify that a transaction is
present in a specific block in an authenticated way.
This is a better attempt than my previous PR #19.
Note regarding the doc examples, I used
ignore
attribute to avoid failures with the older 1.22.0 Rust on TravisCI. It could be related to the usage ofextern crate ...
in the examples. The doc tests pass as of Rust 1.32.0.