Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 043b7c7

Browse files
committedJan 22, 2024
gui: bump liana:master and async-hwi:master
1 parent 99bc44d commit 043b7c7

File tree

8 files changed

+190
-123
lines changed

8 files changed

+190
-123
lines changed
 

‎gui/Cargo.lock

+168-101
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎gui/src/app/state/spend/step.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -440,9 +440,9 @@ impl Step for DefineSpend {
440440
!recipient.label.value.is_empty()
441441
&& Address::from_str(&recipient.address.value)
442442
.unwrap()
443-
.payload
443+
.payload()
444444
.matches_script_pubkey(&output.script_pubkey)
445-
&& output.value == recipient.amount().unwrap()
445+
&& output.value.to_sat() == recipient.amount().unwrap()
446446
})
447447
.map(|recipient| recipient.label.value.to_string())
448448
{
@@ -517,7 +517,7 @@ impl Recipient {
517517
}
518518

519519
if let Ok(address) = Address::from_str(&self.address.value) {
520-
if amount <= address.payload.script_pubkey().dust_value() {
520+
if amount <= address.payload().script_pubkey().dust_value() {
521521
return Err(Error::Unexpected(
522522
"Amount must be superior to script dust value".to_string(),
523523
));

‎gui/src/app/view/home.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,13 @@ fn event_list_view(i: usize, event: &HistoryTransaction) -> Column<'_, Message>
174174
col.push(event::confirmed_incoming_event(
175175
label,
176176
NaiveDateTime::from_timestamp_opt(t as i64, 0).unwrap(),
177-
&Amount::from_sat(output.value),
177+
&output.value,
178178
Message::SelectSub(i, output_index),
179179
))
180180
} else {
181181
col.push(event::unconfirmed_incoming_event(
182182
label,
183-
&Amount::from_sat(output.value),
183+
&output.value,
184184
Message::SelectSub(i, output_index),
185185
))
186186
}
@@ -190,13 +190,13 @@ fn event_list_view(i: usize, event: &HistoryTransaction) -> Column<'_, Message>
190190
col.push(event::confirmed_outgoing_event(
191191
label,
192192
NaiveDateTime::from_timestamp_opt(t as i64, 0).unwrap(),
193-
&Amount::from_sat(output.value),
193+
&output.value,
194194
Message::SelectSub(i, output_index),
195195
))
196196
} else {
197197
col.push(event::unconfirmed_outgoing_event(
198198
label,
199-
&Amount::from_sat(output.value),
199+
&output.value,
200200
Message::SelectSub(i, output_index),
201201
))
202202
}
@@ -251,7 +251,7 @@ pub fn payment_view<'a>(
251251
label::label_editable(vec![outpoint.clone()], tx.labels.get(&outpoint), H3_SIZE)
252252
})
253253
.push(Container::new(amount_with_size(
254-
&Amount::from_sat(tx.tx.output[output_index].value),
254+
&tx.tx.output[output_index].value,
255255
H3_SIZE,
256256
)))
257257
.push(Space::with_height(H3_SIZE))

‎gui/src/app/view/psbt.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use iced::{
88
use liana::{
99
descriptors::{LianaPolicy, PathInfo, PathSpendInfo},
1010
miniscript::bitcoin::{
11-
bip32::Fingerprint, blockdata::transaction::TxOut, Address, Amount, Network, OutPoint,
11+
bip32::Fingerprint, blockdata::transaction::TxOut, Address, Network, OutPoint,
1212
Transaction, Txid,
1313
},
1414
};
@@ -868,7 +868,7 @@ fn payment_view<'a>(
868868
})
869869
.width(Length::Fill),
870870
)
871-
.push(amount(&Amount::from_sat(output.value))),
871+
.push(amount(&output.value)),
872872
)
873873
.push_maybe(addr.map(|addr| {
874874
Column::new()
@@ -932,7 +932,7 @@ fn change_view(output: &TxOut, network: Network) -> Element<Message> {
932932
),
933933
),
934934
)
935-
.push(amount(&Amount::from_sat(output.value)))
935+
.push(amount(&output.value))
936936
.into()
937937
}
938938

‎gui/src/daemon/model.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ impl SpendTx {
7070
|(change, spend), (i, output)| {
7171
if !psbt.outputs[i].bip32_derivation.is_empty() {
7272
change_indexes.push(i);
73-
(change + Amount::from_sat(output.value), spend)
73+
(change + output.value, spend)
7474
} else {
75-
(change, spend + Amount::from_sat(output.value))
75+
(change, spend + output.value)
7676
}
7777
},
7878
);
@@ -103,7 +103,7 @@ impl SpendTx {
103103
let mut inputs_amount = Amount::from_sat(0);
104104
for (i, input) in psbt.inputs.iter().enumerate() {
105105
if let Some(utxo) = &input.witness_utxo {
106-
inputs_amount += Amount::from_sat(utxo.value);
106+
inputs_amount += utxo.value;
107107
// we try to have it from the coin
108108
} else if let Some(coin) = psbt
109109
.unsigned_tx
@@ -285,9 +285,9 @@ impl HistoryTransaction {
285285
(Amount::from_sat(0), Amount::from_sat(0)),
286286
|(change, spend), (i, output)| {
287287
if change_indexes.contains(&i) {
288-
(change + Amount::from_sat(output.value), spend)
288+
(change + output.value, spend)
289289
} else {
290-
(change, spend + Amount::from_sat(output.value))
290+
(change, spend + output.value)
291291
}
292292
},
293293
);

‎gui/src/installer/step/descriptor.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::str::FromStr;
55
use std::sync::{Arc, Mutex};
66

77
use iced::Command;
8-
use liana::miniscript::bitcoin::bip32::ExtendedPubKey;
8+
use liana::miniscript::bitcoin::bip32::Xpub;
99
use liana::{
1010
descriptors::{LianaDescriptor, LianaPolicy, PathInfo},
1111
miniscript::{
@@ -565,9 +565,9 @@ impl Step for DefineDescriptor {
565565
}
566566

567567
fn new_multixkey_from_xpub(
568-
xpub: DescriptorXKey<ExtendedPubKey>,
568+
xpub: DescriptorXKey<Xpub>,
569569
derivation_index: usize,
570-
) -> DescriptorMultiXKey<ExtendedPubKey> {
570+
) -> DescriptorMultiXKey<Xpub> {
571571
DescriptorMultiXKey {
572572
origin: xpub.origin,
573573
xkey: xpub.xkey,

‎gui/src/signer.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ pub use liana::signer::SignerError;
22

33
use liana::{
44
miniscript::bitcoin::{
5-
bip32::{DerivationPath, ExtendedPubKey, Fingerprint},
5+
bip32::{DerivationPath, Fingerprint, Xpub},
66
psbt::Psbt,
77
secp256k1, Network,
88
},
@@ -48,7 +48,7 @@ impl Signer {
4848
self.fingerprint
4949
}
5050

51-
pub fn get_extended_pubkey(&self, path: &DerivationPath) -> ExtendedPubKey {
51+
pub fn get_extended_pubkey(&self, path: &DerivationPath) -> Xpub {
5252
self.key.xpub_at(path, &self.curve)
5353
}
5454

‎gui/ui/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ edition = "2021"
99
iced = { version = "0.9", default_features = false, features = ["svg", "image", "glow"] }
1010
iced_native = "0.10"
1111
iced_lazy = { version = "0.6"}
12-
bitcoin = "0.30"
12+
bitcoin = "0.31"
1313
chrono = "0.4"

0 commit comments

Comments
 (0)
Please sign in to comment.