diff --git a/src/descriptor/key.rs b/src/descriptor/key.rs index 4b82bce97..95a9dfd2f 100644 --- a/src/descriptor/key.rs +++ b/src/descriptor/key.rs @@ -22,7 +22,7 @@ pub enum DescriptorPublicKey { } /// The descriptor secret key, either a single private key or an xprv. -#[derive(Debug)] +#[derive(Debug, Hash)] pub enum DescriptorSecretKey { /// Single private key. Single(SinglePriv), diff --git a/src/expression.rs b/src/expression.rs index a004d7a19..6eaff93a3 100644 --- a/src/expression.rs +++ b/src/expression.rs @@ -37,6 +37,7 @@ pub trait FromTree: Sized { fn from_tree(top: &Tree) -> Result; } +#[derive(Hash)] enum Found { Nothing, LBracket(usize), // Either a left ( or { diff --git a/src/interpreter/mod.rs b/src/interpreter/mod.rs index e658b579c..884037b0d 100644 --- a/src/interpreter/mod.rs +++ b/src/interpreter/mod.rs @@ -59,7 +59,7 @@ pub struct Interpreter<'txin> { // Ecdsa and Schnorr signatures /// A type for representing signatures supported as of bitcoin core 22.0 -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub enum KeySigPair { /// A Full public key and corresponding Ecdsa signature Ecdsa(bitcoin::PublicKey, bitcoin::EcdsaSig), @@ -451,7 +451,7 @@ impl<'txin> Interpreter<'txin> { } /// Type of HashLock used for SatisfiedConstraint structure -#[derive(Copy, Clone, Debug, Eq, PartialEq)] +#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)] pub enum HashLockType { ///SHA 256 hashlock Sha256(sha256::Hash), @@ -466,7 +466,7 @@ pub enum HashLockType { /// A satisfied Miniscript condition (Signature, Hashlock, Timelock) /// 'intp represents the lifetime of descriptor and `stack represents /// the lifetime of witness -#[derive(Copy, Clone, Debug, Eq, PartialEq)] +#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)] pub enum SatisfiedConstraint { ///Public key and corresponding signature PublicKey { diff --git a/src/miniscript/decode.rs b/src/miniscript/decode.rs index 7f706c2d8..8890d3051 100644 --- a/src/miniscript/decode.rs +++ b/src/miniscript/decode.rs @@ -95,7 +95,7 @@ mod private { impl Sealed for super::bitcoin::secp256k1::XOnlyPublicKey {} } -#[derive(Copy, Clone, Debug)] +#[derive(Copy, Clone, Debug, Hash)] enum NonTerm { Expression, WExpression, diff --git a/src/miniscript/lex.rs b/src/miniscript/lex.rs index 8927f9844..1c940f311 100644 --- a/src/miniscript/lex.rs +++ b/src/miniscript/lex.rs @@ -24,7 +24,7 @@ use std::fmt; use super::Error; /// Atom of a tokenized version of a script -#[derive(Debug, Copy, Clone, PartialEq, Eq)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] #[allow(missing_docs)] pub enum Token<'s> { BoolAnd,