rust-bitcoin-unsafe-fast/bitcoin/src
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
..
address Implement infallible for errors 2024-03-08 16:48:34 +11:00
blockdata Merge rust-bitcoin/rust-bitcoin#2565: Removes txid prefix in transaction IDs 2024-03-13 17:28:09 +00:00
consensus Upgrade hex dependency 2024-03-10 10:35:01 +11:00
crypto Return error when constructing pubkey from slice 2024-03-13 09:22:11 +11:00
merkle_tree Implement infallible for errors 2024-03-08 16:48:34 +11:00
p2p Add ServiceFlags::P2P_V2 2024-03-08 15:07:34 -05:00
psbt Upgrade hex dependency 2024-03-10 10:35:01 +11:00
taproot Upgrade hex dependency 2024-03-10 10:35:01 +11:00
bip32.rs Implement infallible for errors 2024-03-08 16:48:34 +11:00
bip152.rs Implement infallible for errors 2024-03-08 16:48:34 +11:00
bip158.rs Implement infallible for errors 2024-03-08 16:48:34 +11:00
error.rs Do infallible int from hex conversions 2024-02-27 10:40:52 +11:00
hash_types.rs Add deprecation comment to hash_types module 2023-12-05 15:01:18 +11:00
internal_macros.rs Make from_hex inherent for byte-like types 2024-02-22 09:16:31 +11:00
lib.rs Merge rust-bitcoin/rust-bitcoin#2492: Remove the FromHexStr trait 2024-03-07 14:36:53 +00:00
network.rs Add ServiceFlags::P2P_V2 2024-03-08 15:07:34 -05:00
parse.rs Merge rust-bitcoin/rust-bitcoin#2492: Remove the FromHexStr trait 2024-03-07 14:36:53 +00:00
policy.rs bitcoin: Remove attribution from all files 2023-05-01 09:22:48 +10:00
pow.rs Merge rust-bitcoin/rust-bitcoin#2530: Improve leaf errors 2024-03-13 15:03:57 +00:00
serde_utils.rs Fix new nightly warnings/errors 2024-02-21 14:13:49 +11:00
sign_message.rs Implement infallible for errors 2024-03-08 16:48:34 +11:00
test_macros.rs bitcoin: Remove attribution from all files 2023-05-01 09:22:48 +10:00