Merge rust-bitcoin/rust-bitcoin#1248: implement `From<PublicKey>` for `PubkeyHash`
81f81caa04
implement `From<PublicKey>` for `PubkeyHash` (Noah Lanson) Pull request description: Part of #1245. Do we also want a method on `PubkeyHash` or is the `From` impl sufficient? ACKs for top commit: tcharding: ACK81f81caa04
Kixunil: ACK81f81caa04
sanket1729: ACK81f81caa04
apoelstra: ACK81f81caa04
Tree-SHA512: 760ea2991de60fd72d0aae18d375024f001f331d8a57b1e6e39b5933efa3a5af379effecb89cde0defb960b25c997b417fc126248589953655fb83db8b8dd608
This commit is contained in:
commit
4b662f8c57
|
@ -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
|
/// A Bitcoin ECDSA private key
|
||||||
#[derive(Copy, Clone, PartialEq, Eq)]
|
#[derive(Copy, Clone, PartialEq, Eq)]
|
||||||
#[cfg_attr(feature = "std", derive(Debug))]
|
#[cfg_attr(feature = "std", derive(Debug))]
|
||||||
|
|
Loading…
Reference in New Issue