File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,7 @@ use bitcoin::blockdata::constants::ChainHash;
8080use bitcoin:: network:: constants:: Network ;
8181use bitcoin:: secp256k1:: { KeyPair , PublicKey , Secp256k1 , self } ;
8282use core:: convert:: TryFrom ;
83+ use core:: hash:: { Hash , Hasher } ;
8384use core:: num:: NonZeroU64 ;
8485use core:: ops:: Deref ;
8586use core:: str:: FromStr ;
@@ -591,6 +592,12 @@ impl PartialEq for Offer {
591592
592593impl Eq for Offer { }
593594
595+ impl Hash for Offer {
596+ fn hash < H : Hasher > ( & self , state : & mut H ) {
597+ self . bytes . hash ( state) ;
598+ }
599+ }
600+
594601impl OfferContents {
595602 pub fn chains ( & self ) -> Vec < ChainHash > {
596603 self . chains . as_ref ( ) . cloned ( ) . unwrap_or_else ( || vec ! [ self . implied_chain( ) ] )
Original file line number Diff line number Diff line change @@ -85,6 +85,7 @@ use bitcoin::blockdata::constants::ChainHash;
8585use bitcoin:: network:: constants:: Network ;
8686use bitcoin:: secp256k1:: { PublicKey , Secp256k1 , self } ;
8787use core:: convert:: TryFrom ;
88+ use core:: hash:: { Hash , Hasher } ;
8889use core:: ops:: Deref ;
8990use core:: str:: FromStr ;
9091use core:: time:: Duration ;
@@ -546,6 +547,12 @@ impl PartialEq for Refund {
546547
547548impl Eq for Refund { }
548549
550+ impl Hash for Refund {
551+ fn hash < H : Hasher > ( & self , state : & mut H ) {
552+ self . bytes . hash ( state) ;
553+ }
554+ }
555+
549556impl RefundContents {
550557 pub fn description ( & self ) -> PrintableString {
551558 PrintableString ( & self . description )
You can’t perform that action at this time.
0 commit comments