Skip to content

Commit 5bb3b31

Browse files
committed
fix(types): v24 ListUnspentItem might not have a label field
1 parent 014e158 commit 5bb3b31

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

types/src/v24/wallet/into.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ impl ListUnspentItem {
216216
let vout = crate::to_u32(self.vout, "vout")?;
217217
let address = self.address.parse::<Address<_>>().map_err(E::Address)?;
218218
let script_pubkey = ScriptBuf::from_hex(&self.script_pubkey).map_err(E::ScriptPubkey)?;
219+
let label = self.label.unwrap_or_default();
219220

220221
let amount = SignedAmount::from_btc(self.amount).map_err(E::Amount)?;
221222
let confirmations = crate::to_u32(self.confirmations, "confirmations")?;
@@ -228,7 +229,7 @@ impl ListUnspentItem {
228229
txid,
229230
vout,
230231
address,
231-
label: self.label,
232+
label,
232233
script_pubkey,
233234
amount,
234235
confirmations,

types/src/v24/wallet/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ pub struct ListUnspentItem {
250250
/// The bitcoin address of the transaction.
251251
pub address: String,
252252
/// The associated label, or "" for the default label.
253-
pub label: String,
253+
pub label: Option<String>,
254254
/// The script key.
255255
#[serde(rename = "scriptPubKey")]
256256
pub script_pubkey: String,

0 commit comments

Comments
 (0)