BlockstreamResearch / rust-simplicity

Creative Commons Zero v1.0 Universal
58 stars 12 forks source link

test: compilation error "the trait bound `hashes::sha256::Hash: ThirtyTwoByteHash` is not satisfied" #194

Closed delta1 closed 8 months ago

delta1 commented 8 months ago

I still see these errors with cargo test --all-features after a cargo clean

error[E0277]: the trait bound `hashes::sha256::Hash: ThirtyTwoByteHash` is not satisfied
   --> src/policy/satisfy.rs:293:23
    |
293 |             let msg = secp256k1_zkp::Message::from(sighash);
    |                       ^^^^^^^^^^^^^^^^^^^^^^ the trait `ThirtyTwoByteHash` is not implemented for `hashes::sha256::Hash`
    |
    = help: the following other types implement trait `ThirtyTwoByteHash`:
              bitcoin::secp256k1::bitcoin_hashes::sha256t::Hash<T>
              bitcoin::secp256k1::bitcoin_hashes::sha256::Hash
              bitcoin::secp256k1::bitcoin_hashes::sha256d::Hash
              Sighash
              bitcoin::LegacySighash
              bitcoin::SegwitV0Sighash
              bitcoin::TapSighash
    = note: required for `Message` to implement `From<hashes::sha256::Hash>`

error[E0277]: the trait bound `hashes::sha256::Hash: ThirtyTwoByteHash` is not satisfied
   --> src/policy/satisfy.rs:376:23
    |
376 |         let message = secp256k1_zkp::Message::from(sighash);
    |                       ^^^^^^^^^^^^^^^^^^^^^^ the trait `ThirtyTwoByteHash` is not implemented for `hashes::sha256::Hash`
    |
    = help: the following other types implement trait `ThirtyTwoByteHash`:
              bitcoin::secp256k1::bitcoin_hashes::sha256t::Hash<T>
              bitcoin::secp256k1::bitcoin_hashes::sha256::Hash
              bitcoin::secp256k1::bitcoin_hashes::sha256d::Hash
              Sighash
              bitcoin::LegacySighash
              bitcoin::SegwitV0Sighash
              bitcoin::TapSighash
    = note: required for `Message` to implement `From<hashes::sha256::Hash>`

error[E0277]: the trait bound `hashes::sha256::Hash: ThirtyTwoByteHash` is not satisfied
   --> src/policy/serialize.rs:307:23
    |
307 |         let message = secp256k1_zkp::Message::from(sighash);
    |                       ^^^^^^^^^^^^^^^^^^^^^^ the trait `ThirtyTwoByteHash` is not implemented for `hashes::sha256::Hash`
    |
    = help: the following other types implement trait `ThirtyTwoByteHash`:
              bitcoin::secp256k1::bitcoin_hashes::sha256t::Hash<T>
              bitcoin::secp256k1::bitcoin_hashes::sha256::Hash
              bitcoin::secp256k1::bitcoin_hashes::sha256d::Hash
              Sighash
              bitcoin::LegacySighash
              bitcoin::SegwitV0Sighash
              bitcoin::TapSighash
    = note: required for `Message` to implement `From<hashes::sha256::Hash>`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `simplicity` (lib test) due to 3 previous errors
delta1 commented 8 months ago

rust version: 1.74.1

cargo clippy --all-targets actually does the same locally, not sure why it's not caught by CI

delta1 commented 8 months ago

Sigh. Another case of outdated Cargo.lock file.

uncomputable commented 8 months ago

Frustrating, but yes: The set of dependencies that cargo resolves can make or break the crate :/

apoelstra commented 8 months ago

cc https://github.com/rust-bitcoin/rust-secp256k1/issues/673