Skip to content

Commit 97e8906

Browse files
committed
Add missing listunspent field in v18
There is a missing return field `desc` in v18 Add the field to ListUnspentItem in v18. Update v17 and v18 into functions. Type redefined in v18 already, no change in reexports needed.
1 parent 4c88282 commit 97e8906

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

types/src/model/wallet.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,8 @@ pub struct ListUnspentItem {
610610
pub spendable: bool,
611611
/// Whether we know how to spend this output, ignoring the lack of keys.
612612
pub solvable: bool,
613+
/// A descriptor for spending this output (only when solvable)
614+
pub descriptor: Option<String>,
613615
/// Whether this output is considered safe to spend. Unconfirmed transactions from outside keys
614616
/// and unconfirmed replacement transactions are considered unsafe and are not eligible for
615617
/// spending by fundrawtransaction and sendtoaddress.

types/src/v17/wallet/into.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,7 @@ impl ListUnspentItem {
668668
redeem_script,
669669
spendable: self.spendable,
670670
solvable: self.solvable,
671+
descriptor: None,
671672
safe: self.safe,
672673
})
673674
}

types/src/v18/wallet/into.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ impl ListUnspentItem {
7272
.redeem_script
7373
.map(|hex| ScriptBuf::from_hex(&hex).map_err(E::RedeemScript))
7474
.transpose()?;
75-
7675
Ok(model::ListUnspentItem {
7776
txid,
7877
vout,
@@ -84,6 +83,7 @@ impl ListUnspentItem {
8483
redeem_script,
8584
spendable: self.spendable,
8685
solvable: self.solvable,
86+
descriptor: self.descriptor,
8787
safe: self.safe,
8888
})
8989
}

types/src/v18/wallet/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ pub struct ListUnspentItem {
7676
pub spendable: bool,
7777
/// Whether we know how to spend this output, ignoring the lack of keys.
7878
pub solvable: bool,
79+
/// A descriptor for spending this output (only when solvable)
80+
#[serde(rename = "desc")]
81+
pub descriptor: Option<String>,
7982
/// Whether this output is considered safe to spend. Unconfirmed transactions from outside keys
8083
/// and unconfirmed replacement transactions are considered unsafe and are not eligible for
8184
/// spending by fundrawtransaction and sendtoaddress.

0 commit comments

Comments
 (0)