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
Use infallible conversions from hashes to secp256k1::Message
#824
Comments
Thanks! I think I'll have a stab! Could you assign it to me please? 🙏 |
Go for it man! Thanks |
Hi @tcharding / @Kixunil - I'm having some trouble with this one. I've replaced all instances of Line 143 in cd790dc
The error I'm getting is: error[E0277]: the trait bound `hashes::sha256d::Hash: secp256k1::ThirtyTwoByteHash` is not satisfied
--> src/util/misc.rs:143:23
|
143 | let msg = secp256k1::Message::from(msg_hash);
| ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `secp256k1::ThirtyTwoByteHash` is not implemented for `hashes::sha256d::Hash`
|
= note: required because of the requirements on the impl of `std::convert::From<hashes::sha256d::Hash>` for `secp256k1::Message`
For more information about this error, try `rustc --explain E0277`.
error: could not compile `bitcoin` due to previous error This is confusing me because such Digging deeper, I believe this might be due to a mismatch between the versions of Interestingly, I think the approach taken here does not work due to 58f94be. I'm unsure about which could be the appropriate direction here 🤔 My bet is on matching the |
We should update rust-secp I guess. Annoying because this will require a major version bump there. We should've coordinated this better ... I think I literally forgot that rust-secp depended on bitcoin_hashes and that we'd have to update things in order. |
Sorry to be the bearer of these bad news! :/ Question: is there a specific reason why |
I'll take the rap for that one, I did the release PR without checking if this would break things. |
Prior to 1.0, cargo treats the minor version number as a major version number. There is no way you can tell it "use 0.10 or 0.11 or...", nor would we want to, because there are breaking changes between those releases. |
Got it. Thanks for the clarification. |
I've tried to clean up my mess, please see: |
You can using @tcharding no need to beat yourself up about this one. It would've easily slipped anyone. The only way I can think of avoiding it is to have a good release checklist with a reminder to use it. |
I don't think a checklist would've helped, given that this would've been caught by #1104 but only if we'd thought of it beforehand.. |
Replace all instances of `secp256k1::Message::from_slice(_).expect(_)` with `secp256k1::Message::from(_)`. Solves rust-bitcoin#824
Replace all instances of `secp256k1::Message::from_slice(_).expect(_)` with `secp256k1::Message::from(_)`. Also adds an implementation of ThirtyTwoByteHash for TapSighashHash. Solves rust-bitcoin#824
Replace all instances of `secp256k1::Message::from_slice(_).expect(_)` with `secp256k1::Message::from(_)`. Also adds an implementation of ThirtyTwoByteHash for TapSighashHash. Solves rust-bitcoin#824
Replace all instances of `secp256k1::Message::from_slice(_).expect(_)` with `secp256k1::Message::from(_)`. Also adds an implementation of ThirtyTwoByteHash for TapSighashHash. Solves rust-bitcoin#824
Replace all instances of `secp256k1::Message::from_slice(_).expect(_)` with `secp256k1::Message::from(_)`. Also adds an implementation of ThirtyTwoByteHash for TapSighashHash. Solves rust-bitcoin/rust-bitcoin#824
…sh` -> `secp256k1::Message` aeede12 Infallible conversions: `Hash` -> `Message` (Arturo Marquez) Pull request description: Replaces all instances of `secp256k1::Message::from_slice(_).expect(_)` with `secp256k1::Message::from(_)`. This also implements `ThirtyTwoByteHash` for `TapSighashHash`. Closes rust-bitcoin/rust-bitcoin#824 ACKs for top commit: Kixunil: ACK aeede12 tcharding: ACK aeede12 apoelstra: ACK aeede12 Tree-SHA512: cd392f0e93e2560680c579a889a46f7e4484380058b2d8d03b6ecec351d880efa9beea5e3be128158e9e26243b7dfcef1f48a448028d9155958a5af62bcc9ec2
#819 (comment)
And check/fix other cases as well.
The text was updated successfully, but these errors were encountered: