Merge pull request #559 from LNP-BP/fix/error-derives-2

Fix/error derives 2
This commit is contained in:
Andrew Poelstra 2021-05-19 15:02:10 +00:00 committed by GitHub
commit 052aaf1d80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 12 additions and 12 deletions

View File

@ -22,12 +22,12 @@ secp-lowmemory = ["secp256k1/lowmemory"]
secp-recovery = ["secp256k1/recovery"] secp-recovery = ["secp256k1/recovery"]
[dependencies] [dependencies]
bech32 = "0.7.2" bech32 = "0.7.3"
bitcoin_hashes = "0.9.6" bitcoin_hashes = "0.9.6"
secp256k1 = "0.20.0" secp256k1 = "0.20.2"
base64-compat = { version = "1.0.0", optional = true } base64-compat = { version = "1.0.0", optional = true }
bitcoinconsensus = { version = "0.19.0-1", optional = true } bitcoinconsensus = { version = "0.19.0-3", optional = true }
serde = { version = "1", features = [ "derive" ], optional = true } serde = { version = "1", features = [ "derive" ], optional = true }
[dev-dependencies] [dev-dependencies]

View File

@ -105,7 +105,7 @@ display_from_debug!(Builder);
/// Ways that a script might fail. Not everything is split up as /// Ways that a script might fail. Not everything is split up as
/// much as it could be; patches welcome if more detailed errors /// much as it could be; patches welcome if more detailed errors
/// would help you. /// would help you.
#[derive(PartialEq, Eq, Debug, Clone)] #[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)]
pub enum Error { pub enum Error {
/// Something did a non-minimal push; for more information see /// Something did a non-minimal push; for more information see
/// `https://github.com/bitcoin/bips/blob/master/bip-0062.mediawiki#Push_operators` /// `https://github.com/bitcoin/bips/blob/master/bip-0062.mediawiki#Push_operators`

View File

@ -46,7 +46,7 @@ use util::base58;
use util::ecdsa; use util::ecdsa;
/// Address error. /// Address error.
#[derive(Debug, PartialEq)] #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone)]
pub enum Error { pub enum Error {
/// Base58 encoding error /// Base58 encoding error
Base58(base58::Error), Base58(base58::Error),

View File

@ -423,16 +423,16 @@ impl fmt::Debug for DerivationPath {
pub type KeySource = (Fingerprint, DerivationPath); pub type KeySource = (Fingerprint, DerivationPath);
/// A BIP32 error /// A BIP32 error
#[derive(Clone, PartialEq, Eq, Debug)] #[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
pub enum Error { pub enum Error {
/// A pk->pk derivation was attempted on a hardened key /// A pk->pk derivation was attempted on a hardened key
CannotDeriveFromHardenedKey, CannotDeriveFromHardenedKey,
/// A secp256k1 error occurred /// A secp256k1 error occurred
Ecdsa(secp256k1::Error), Ecdsa(secp256k1::Error), // TODO: This is not necessary ECDSA error and should be renamed
/// A child number was provided that was out of range /// A child number was provided that was out of range
InvalidChildNumber(u32), InvalidChildNumber(u32),
/// Error creating a master seed --- for application use /// Error creating a master seed --- for application use
RngError(String), RngError(String), // TODO: This option seems unused and should be removed, opening a way to make this type copiable
/// Invalid childnumber format. /// Invalid childnumber format.
InvalidChildNumberFormat, InvalidChildNumberFormat,
/// Invalid derivation path format. /// Invalid derivation path format.

View File

@ -36,7 +36,7 @@ use util::address;
static PUBKEY: u8 = 0xFE; static PUBKEY: u8 = 0xFE;
/// A contract-hash error /// A contract-hash error
#[derive(Debug, PartialEq, Eq, Clone)] #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
pub enum Error { pub enum Error {
/// Other secp256k1 related error /// Other secp256k1 related error
Secp(secp256k1::Error), Secp(secp256k1::Error),

View File

@ -26,7 +26,7 @@ use secp256k1;
use util::base58; use util::base58;
/// A key-related error. /// A key-related error.
#[derive(Debug, PartialEq, Eq, Clone)] #[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
pub enum Error { pub enum Error {
/// Base58 encoding error /// Base58 encoding error
Base58(base58::Error), Base58(base58::Error),

View File

@ -21,7 +21,7 @@ use util::psbt::raw;
use hashes; use hashes;
#[derive(Copy, Clone, PartialEq, Eq, Debug)] #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
/// Enum for marking psbt hash error /// Enum for marking psbt hash error
pub enum PsbtHash { pub enum PsbtHash {
Ripemd, Ripemd,
@ -30,7 +30,7 @@ pub enum PsbtHash {
Hash256, Hash256,
} }
/// Ways that a Partially Signed Transaction might fail. /// Ways that a Partially Signed Transaction might fail.
#[derive(Clone, PartialEq, Eq, Debug)] #[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
pub enum Error { pub enum Error {
/// Magic bytes for a PSBT must be the ASCII for "psbt" serialized in most /// Magic bytes for a PSBT must be the ASCII for "psbt" serialized in most
/// significant byte order. /// significant byte order.