From a3bb03eeb9dfdf29ad13135766b704127c8b5322 Mon Sep 17 00:00:00 2001 From: Sebastian Geisler Date: Wed, 3 Jun 2020 17:44:42 +0200 Subject: [PATCH] Derive more traits to use DerivationPath in rust-miniscript --- src/util/bip32.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/bip32.rs b/src/util/bip32.rs index 2e8103e7..5d66841b 100644 --- a/src/util/bip32.rs +++ b/src/util/bip32.rs @@ -64,7 +64,7 @@ pub struct ExtendedPrivKey { serde_string_impl!(ExtendedPrivKey, "a BIP-32 extended private key"); /// Extended public key -#[derive(Copy, Clone, PartialEq, Eq, Debug)] +#[derive(Copy, Clone, PartialEq, Eq, Debug, PartialOrd, Ord, Hash)] pub struct ExtendedPubKey { /// The network this key is to be used on pub network: Network, @@ -82,7 +82,7 @@ pub struct ExtendedPubKey { serde_string_impl!(ExtendedPubKey, "a BIP-32 extended public key"); /// A child number for a derived key -#[derive(Copy, Clone, PartialEq, Eq, Debug)] +#[derive(Copy, Clone, PartialEq, Eq, Debug, PartialOrd, Ord, Hash)] pub enum ChildNumber { /// Non-hardened key Normal { @@ -209,7 +209,7 @@ impl serde::Serialize for ChildNumber { } /// A BIP-32 derivation path. -#[derive(Clone, PartialEq, Eq)] +#[derive(Clone, PartialEq, Eq, Ord, PartialOrd, Hash)] pub struct DerivationPath(Vec); impl_index_newtype!(DerivationPath, ChildNumber); serde_string_impl!(DerivationPath, "a BIP-32 derivation path");