rust-bitcoin-unsafe-fast/bitcoin
Andrew Poelstra e0d58a9c1c
Merge rust-bitcoin/rust-bitcoin#2576: Return error when constructing pubkey from slice
6ecc41d126 Return error when constructing pubkey from slice (Tobin C. Harding)

Pull request description:

  This PR fixes a bug introduced by me in #2473, and uncovered by #2563 - amazing that it was found so quickly!

  Constructing a pubkey using `PublicKey::from_slice` can fail for reasons other than just incorrect length - we should not be using `expect` but rather returning the error.

  A purist might argue that we are now returning a nested error type with an unreachable variant:

    `ParsePublicKeyError::Encoding(FromSliceError::InvalidLength)`

  Is this acceptable or do we want to further improve this?

ACKs for top commit:
  sanket1729:
    ACK 6ecc41d126
  apoelstra:
    ACK 6ecc41d126

Tree-SHA512: ae8299b21c4787a104f98533105308e8e7678cd5a29b78c30012982d741c05ba5f2bb1edd1d61d3a5ce028235d18c1511e1f94207479bc19e88cfec7a7ca1737
2024-03-14 07:19:12 +00:00
..
contrib ci: delete *test.sh files 2024-02-28 20:45:56 +00:00
embedded Add a new base58 crate 2024-02-23 12:54:24 +11:00
examples Fix new nightly warnings/errors 2024-02-21 14:13:49 +11:00
src Merge rust-bitcoin/rust-bitcoin#2576: Return error when constructing pubkey from slice 2024-03-14 07:19:12 +00:00
tests Fix new nightly warnings/errors 2024-02-21 14:13:49 +11:00
CHANGELOG.md Remove no-std feature 2023-12-06 09:54:33 +11:00
Cargo.toml Upgrade bitcoinconsenus 2024-03-12 12:04:32 +11:00
build.rs Bump MSRV to Rust version 1.56.1 2023-11-23 06:20:02 +11:00