Conversation
130b8c3 to
22dde0b
Compare
|
I am not sure but it seems we have another bug to fix: if we have just a single script spending leaf, it |
I think this is the expected behavior. This is the reason why TaprootMerkleProof(Vecsha256::Hash), because it contains both leafhash and branchhash |
|
Yep, I just checked the spec and it is the way python script in BIP-341 will also compute |
22dde0b to
6ed2948
Compare
|
Sorry, accedently pressed wrong button Related: #696 |
6ed2948 to
a47df1b
Compare
dr-orlovsky
left a comment
There was a problem hiding this comment.
utACK a47df1b30b7bae1dbf253fa6b7c5ef5c8559cbe3
a47df1b to
088cd94
Compare
|
Reabsed after #703 |
src/util/taproot.rs
Outdated
There was a problem hiding this comment.
did you consider to use the json file directly and use include_str! here?
There was a problem hiding this comment.
Yes, I did consider. However, I was not sure about conventions about where to put test artifacts like the JSON file in the current directory. Any suggestions are appreciated.
There was a problem hiding this comment.
I like your suggestion, just was not sure about the rust idiomatic way to do things here.
|
needs rebase again :( |
fc1507f to
1fb712a
Compare
|
Rebased |
dr-orlovsky
left a comment
There was a problem hiding this comment.
utACK 1fb712a51bd22b58fb4a8244676d692d9be31645
src/util/taproot.rs
Outdated
There was a problem hiding this comment.
This as_ref()s are the reason I think that the switch from Option<TapBranchHash> to Option<&TapBranchHash> was a bad idea.
I've fixed this in #696 anyway
There was a problem hiding this comment.
Agreed, I am just confused about the order in which things are changed in master. But agree that the final result should be Option<TapBranchHash>
|
Hey @sanket1729, these tests can be put in the integration tests directory ( https://github.com/tcharding/rust-bitcoin/tree/taptree_tests |
|
I was thinking about this, but these conceptually are not integration tests. I could not find any clear guidelines on where to put large tests on rust IRC or discord or reddit. In any case, I think what you have done is a better way than pasting the large json file here. |
|
How about creating a |
1fb712a to
7aacc37
Compare
|
Added a test_data directory at the project root |
|
ACK 7aacc37 I checked the inlcuded json file matches https://raw.githubusercontent.com/bitcoin/bips/master/bip-0341/wallet-test-vectors.json |
92ee5a7 Test BIP341 sighash code (sanket1729) Pull request description: Based on #695 . Adds the remaining test vectors to test sighash paths. Will rebase after #695 ACKs for top commit: apoelstra: ACK 92ee5a7 RCasatta: ACK 92ee5a7 Tree-SHA512: 4bd66632dd9ffeab5a70f44763d87ddd1fccffe22df66385b79835f9033408a67e0b157e855ea2394797ac2572cc08db1d66a5a71bfb58e2adbcb9f2ff7d1f0b
Add tests for taproot.
Also fixes one bug in Add taproot data structures #677, namely, I was returningLeafVersion::default()instead of given version