comparing NetworkUncheck addresses
Signed-off-by: Harshil Jani <harshiljani2002@gmail.com> implementation of PartialEq<Address> for Address<NetworkUnchecked> Signed-off-by: Harshil Jani <harshiljani2002@gmail.com>
This commit is contained in:
parent
dc72dfb9f2
commit
046bda321b
|
@ -1057,6 +1057,17 @@ impl Address<NetworkUnchecked> {
|
|||
pub fn assume_checked(self) -> Address { Address::new(self.network, self.payload) }
|
||||
}
|
||||
|
||||
// For NetworkUnchecked , it compare Addresses and if network and payload matches then return true.
|
||||
impl PartialEq<Address<NetworkUnchecked>> for Address {
|
||||
fn eq(&self, other: &Address<NetworkUnchecked>) -> bool {
|
||||
self.network == other.network && self.payload == other.payload
|
||||
}
|
||||
}
|
||||
|
||||
impl PartialEq<Address> for Address<NetworkUnchecked> {
|
||||
fn eq(&self, other: &Address) -> bool { other == self }
|
||||
}
|
||||
|
||||
impl From<Address> for script::ScriptBuf {
|
||||
fn from(a: Address) -> Self { a.script_pubkey() }
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue