Skip to content

Commit 5da62e7

Browse files
committed
Add missing decodescript field to v17
There is an undocumented field p2sh-segwit in v17. It is documented in v19 onwards.
1 parent 60f8e75 commit 5da62e7

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

types/src/model/raw_transactions.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ pub struct DecodeScript {
101101
pub addresses: Vec<Address<NetworkUnchecked>>,
102102
/// Address of P2SH script wrapping this redeem script (not returned if the script is already a P2SH).
103103
pub p2sh: Option<Address<NetworkUnchecked>>,
104+
/// Address of the P2SH script wrapping this witness redeem script
105+
pub p2sh_segwit: Option<String>,
104106
}
105107

106108
/// Models the result of JSON-RPC method `descriptorprocesspsbt`.

types/src/v17/raw_transactions/into.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ impl DecodeScript {
307307
required_signatures: self.required_signatures,
308308
addresses,
309309
p2sh,
310+
p2sh_segwit: self.p2sh_segwit,
310311
})
311312
}
312313
}

types/src/v17/raw_transactions/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,9 @@ pub struct DecodeScript {
219219
pub p2sh: Option<String>,
220220
/// Segwit data (see `DecodeScriptSegwit` for explanation).
221221
pub segwit: Option<DecodeScriptSegwit>,
222+
/// Address of the P2SH script wrapping this witness redeem script
223+
#[serde(rename = "p2sh-segwit")]
224+
pub p2sh_segwit: Option<String>,
222225
}
223226

224227
/// Seemingly undocumented data returned in the `segwit` field of `DecodeScript`.
@@ -238,6 +241,7 @@ pub struct DecodeScriptSegwit {
238241
/// List of bitcoin addresses.
239242
pub addresses: Option<Vec<String>>,
240243
/// Address of P2SH script wrapping this redeem script (not returned if the script is already a P2SH).
244+
#[serde(rename = "p2sh-segwit")]
241245
pub p2sh_segtwit: Option<String>,
242246
}
243247

0 commit comments

Comments
 (0)