Merge rust-bitcoin/rust-bitcoin#1592: Add `From<Address>` for `ScriptBuf`
5f86b3091c
Add From<Address> for ScriptBuf (Tobin C. Harding) Pull request description: Add an implementation of `From<Address> for ScriptBuf` that calls through to `address.script_pubkey` (which calls `address.payload.script_pubkey()`). Fix: #1457 ACKs for top commit: apoelstra: ACK5f86b3091c
Kixunil: ACK5f86b3091c
Tree-SHA512: 8a45f292578765b345863946b276607d561b9bc75f6b9bb97f48b32d503143e234aedb658997db802c87289576361ec9ee6cb31fe3bbccfc06cc2fdabc7c41bb
This commit is contained in:
commit
c4e78661fd
|
@ -1014,6 +1014,12 @@ impl Address<NetworkUnchecked> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl From<Address> for script::ScriptBuf {
|
||||||
|
fn from(a: Address) -> Self {
|
||||||
|
a.script_pubkey()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Alternate formatting `{:#}` is used to return uppercase version of bech32 addresses which should
|
// Alternate formatting `{:#}` is used to return uppercase version of bech32 addresses which should
|
||||||
// be used in QR codes, see [`Address::to_qr_uri`].
|
// be used in QR codes, see [`Address::to_qr_uri`].
|
||||||
impl fmt::Display for Address {
|
impl fmt::Display for Address {
|
||||||
|
|
Loading…
Reference in New Issue