Add From<Address> for ScriptBuf
Add an implementation of `From<Address> for ScriptBuf` that calls through to `address.script_pubkey` (which calls `address.payload.script_pubkey()`). Fix: #1457
This commit is contained in:
parent
2a052acadf
commit
5f86b3091c
|
@ -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