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;
80
80
use bitcoin:: network:: constants:: Network ;
81
81
use bitcoin:: secp256k1:: { KeyPair , PublicKey , Secp256k1 , self } ;
82
82
use core:: convert:: TryFrom ;
83
+ use core:: hash:: { Hash , Hasher } ;
83
84
use core:: num:: NonZeroU64 ;
84
85
use core:: ops:: Deref ;
85
86
use core:: str:: FromStr ;
@@ -591,6 +592,12 @@ impl PartialEq for Offer {
591
592
592
593
impl Eq for Offer { }
593
594
595
+ impl Hash for Offer {
596
+ fn hash < H : Hasher > ( & self , state : & mut H ) {
597
+ self . bytes . hash ( state) ;
598
+ }
599
+ }
600
+
594
601
impl OfferContents {
595
602
pub fn chains ( & self ) -> Vec < ChainHash > {
596
603
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;
85
85
use bitcoin:: network:: constants:: Network ;
86
86
use bitcoin:: secp256k1:: { PublicKey , Secp256k1 , self } ;
87
87
use core:: convert:: TryFrom ;
88
+ use core:: hash:: { Hash , Hasher } ;
88
89
use core:: ops:: Deref ;
89
90
use core:: str:: FromStr ;
90
91
use core:: time:: Duration ;
@@ -546,6 +547,12 @@ impl PartialEq for Refund {
546
547
547
548
impl Eq for Refund { }
548
549
550
+ impl Hash for Refund {
551
+ fn hash < H : Hasher > ( & self , state : & mut H ) {
552
+ self . bytes . hash ( state) ;
553
+ }
554
+ }
555
+
549
556
impl RefundContents {
550
557
pub fn description ( & self ) -> PrintableString {
551
558
PrintableString ( & self . description )
You can’t perform that action at this time.
0 commit comments