From 81f81caa04269c2cfcf6fcf189ccbb21be48f7f7 Mon Sep 17 00:00:00 2001 From: Noah Lanson Date: Fri, 9 Sep 2022 11:02:05 +1000 Subject: [PATCH] implement `From` for `PubkeyHash` --- src/util/key.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/util/key.rs b/src/util/key.rs index 52f72a10..b295c6a7 100644 --- a/src/util/key.rs +++ b/src/util/key.rs @@ -296,6 +296,12 @@ impl FromStr for PublicKey { } } +impl From 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))]