gui: adapt to latest change in lianad API

This commit is contained in:
Antoine Poinsot committed 2023-08-29 19:11:30 +02:00
1 parent 339cf5d8fa
commit 3250d8dc87
4 files changed
+15 -7

No files matched your search

+9 -1
View File
@@ -35,7 +35,7 @@ impl CoinsPanel {
.iter() .iter()
.filter_map(|coin| { .filter_map(|coin| {
if coin.spend_info.is_none() { if coin.spend_info.is_none() {
Some(*coin) Some(coin.clone())
} else { } else {
None None
} }
@@ -129,6 +129,10 @@ mod tests {
"f7bd1b2a995b689d326e51eb742eb1088c4a8f110d9cb56128fd553acc9f88e5", "f7bd1b2a995b689d326e51eb742eb1088c4a8f110d9cb56128fd553acc9f88e5",
) )
.unwrap(); .unwrap();
let dummy_address =
bitcoin::Address::from_str("bc1qvrl2849aggm6qry9ea7xqp2kk39j8vaa8r3cwg")
.unwrap()
.assume_checked();
panel.update_coins(&[ panel.update_coins(&[
Coin { Coin {
@@ -137,6 +141,7 @@ mod tests {
block_height: Some(3), block_height: Some(3),
spend_info: None, spend_info: None,
is_immature: false, is_immature: false,
address: dummy_address.clone(),
}, },
Coin { Coin {
outpoint: bitcoin::OutPoint { txid, vout: 3 }, outpoint: bitcoin::OutPoint { txid, vout: 3 },
@@ -144,6 +149,7 @@ mod tests {
block_height: None, block_height: None,
spend_info: None, spend_info: None,
is_immature: false, is_immature: false,
address: dummy_address.clone(),
}, },
Coin { Coin {
outpoint: bitcoin::OutPoint { txid, vout: 0 }, outpoint: bitcoin::OutPoint { txid, vout: 0 },
@@ -151,6 +157,7 @@ mod tests {
block_height: Some(2), block_height: Some(2),
spend_info: None, spend_info: None,
is_immature: false, is_immature: false,
address: dummy_address.clone(),
}, },
Coin { Coin {
outpoint: bitcoin::OutPoint { txid, vout: 1 }, outpoint: bitcoin::OutPoint { txid, vout: 1 },
@@ -158,6 +165,7 @@ mod tests {
block_height: Some(3), block_height: Some(3),
spend_info: None, spend_info: None,
is_immature: false, is_immature: false,
address: dummy_address,
}, },
]); ]);
+1 -1
View File
@@ -152,7 +152,7 @@ impl State for RecoveryPanel {
.iter() .iter()
.any(|input| input.previous_output == coin.outpoint) .any(|input| input.previous_output == coin.outpoint)
}) })
.copied() .cloned()
.collect(); .collect();
let sigs = desc.partial_spend_info(&psbt).unwrap(); let sigs = desc.partial_spend_info(&psbt).unwrap();
Ok(SpendTx::new(None, psbt, coins, sigs)) Ok(SpendTx::new(None, psbt, coins, sigs))
+2 -2
View File
@@ -75,7 +75,7 @@ impl DefineSpend {
.iter() .iter()
.filter_map(|c| { .filter_map(|c| {
if c.spend_info.is_none() { if c.spend_info.is_none() {
Some((*c, false)) Some((c.clone(), false))
} else { } else {
None None
} }
@@ -302,7 +302,7 @@ impl Step for DefineSpend {
draft.inputs = self draft.inputs = self
.coins .coins
.iter() .iter()
.filter_map(|(coin, selected)| if *selected { Some(*coin) } else { None }) .filter_map(|(coin, selected)| if *selected { Some(coin.clone()) } else { None })
.collect(); .collect();
draft.generated = self.generated.clone(); draft.generated = self.generated.clone();
} }
+3 -3
View File
@@ -90,7 +90,7 @@ pub trait Daemon: Debug {
.iter() .iter()
.any(|input| input.previous_output == coin.outpoint) .any(|input| input.previous_output == coin.outpoint)
}) })
.copied() .cloned()
.collect(); .collect();
let sigs = info let sigs = info
.descriptors .descriptors
@@ -133,7 +133,7 @@ pub trait Daemon: Debug {
.iter() .iter()
.any(|input| input.previous_output == coin.outpoint) .any(|input| input.previous_output == coin.outpoint)
{ {
tx_coins.push(*coin); tx_coins.push(coin.clone());
} }
} }
model::HistoryTransaction::new(tx.tx, tx.height, tx.time, tx_coins, change_indexes) model::HistoryTransaction::new(tx.tx, tx.height, tx.time, tx_coins, change_indexes)
@@ -171,7 +171,7 @@ pub trait Daemon: Debug {
.iter() .iter()
.any(|input| input.previous_output == coin.outpoint) .any(|input| input.previous_output == coin.outpoint)
{ {
tx_coins.push(*coin); tx_coins.push(coin.clone());
} }
} }
model::HistoryTransaction::new(tx.tx, tx.height, tx.time, tx_coins, change_indexes) model::HistoryTransaction::new(tx.tx, tx.height, tx.time, tx_coins, change_indexes)