implement `From<PublicKey>` for `PubkeyHash`

This commit is contained in:
Noah Lanson 2022-09-09 11:02:05 +10:00
parent ed9012c25c
commit 81f81caa04
1 changed files with 6 additions and 0 deletions

View File

@ -296,6 +296,12 @@ impl FromStr for PublicKey {
}
}
impl From<PublicKey> for PubkeyHash {
fn from(key: PublicKey) -> PubkeyHash {
key.pubkey_hash()
}
}
/// A Bitcoin ECDSA private key
#[derive(Copy, Clone, PartialEq, Eq)]
#[cfg_attr(feature = "std", derive(Debug))]