Skip to content

Commit

Permalink
gui: bump liana:master and async-hwi:master
Browse files Browse the repository at this point in the history
  • Loading branch information
edouardparis committed Jan 22, 2024
1 parent 99bc44d commit 043b7c7
Show file tree
Hide file tree
Showing 8 changed files with 190 additions and 123 deletions.
269 changes: 168 additions & 101 deletions gui/Cargo.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions gui/src/app/state/spend/step.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,9 +440,9 @@ impl Step for DefineSpend {
!recipient.label.value.is_empty()
&& Address::from_str(&recipient.address.value)
.unwrap()
.payload
.payload()
.matches_script_pubkey(&output.script_pubkey)
&& output.value == recipient.amount().unwrap()
&& output.value.to_sat() == recipient.amount().unwrap()
})
.map(|recipient| recipient.label.value.to_string())
{
Expand Down Expand Up @@ -517,7 +517,7 @@ impl Recipient {
}

if let Ok(address) = Address::from_str(&self.address.value) {
if amount <= address.payload.script_pubkey().dust_value() {
if amount <= address.payload().script_pubkey().dust_value() {
return Err(Error::Unexpected(
"Amount must be superior to script dust value".to_string(),
));
Expand Down
10 changes: 5 additions & 5 deletions gui/src/app/view/home.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,13 @@ fn event_list_view(i: usize, event: &HistoryTransaction) -> Column<'_, Message>
col.push(event::confirmed_incoming_event(
label,
NaiveDateTime::from_timestamp_opt(t as i64, 0).unwrap(),
&Amount::from_sat(output.value),
&output.value,
Message::SelectSub(i, output_index),
))
} else {
col.push(event::unconfirmed_incoming_event(
label,
&Amount::from_sat(output.value),
&output.value,
Message::SelectSub(i, output_index),
))
}
Expand All @@ -190,13 +190,13 @@ fn event_list_view(i: usize, event: &HistoryTransaction) -> Column<'_, Message>
col.push(event::confirmed_outgoing_event(
label,
NaiveDateTime::from_timestamp_opt(t as i64, 0).unwrap(),
&Amount::from_sat(output.value),
&output.value,
Message::SelectSub(i, output_index),
))
} else {
col.push(event::unconfirmed_outgoing_event(
label,
&Amount::from_sat(output.value),
&output.value,
Message::SelectSub(i, output_index),
))
}
Expand Down Expand Up @@ -251,7 +251,7 @@ pub fn payment_view<'a>(
label::label_editable(vec![outpoint.clone()], tx.labels.get(&outpoint), H3_SIZE)
})
.push(Container::new(amount_with_size(
&Amount::from_sat(tx.tx.output[output_index].value),
&tx.tx.output[output_index].value,
H3_SIZE,
)))
.push(Space::with_height(H3_SIZE))
Expand Down
6 changes: 3 additions & 3 deletions gui/src/app/view/psbt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use iced::{
use liana::{
descriptors::{LianaPolicy, PathInfo, PathSpendInfo},
miniscript::bitcoin::{
bip32::Fingerprint, blockdata::transaction::TxOut, Address, Amount, Network, OutPoint,
bip32::Fingerprint, blockdata::transaction::TxOut, Address, Network, OutPoint,
Transaction, Txid,
},
};
Expand Down Expand Up @@ -868,7 +868,7 @@ fn payment_view<'a>(
})
.width(Length::Fill),
)
.push(amount(&Amount::from_sat(output.value))),
.push(amount(&output.value)),
)
.push_maybe(addr.map(|addr| {
Column::new()
Expand Down Expand Up @@ -932,7 +932,7 @@ fn change_view(output: &TxOut, network: Network) -> Element<Message> {
),
),
)
.push(amount(&Amount::from_sat(output.value)))
.push(amount(&output.value))
.into()
}

Expand Down
10 changes: 5 additions & 5 deletions gui/src/daemon/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ impl SpendTx {
|(change, spend), (i, output)| {
if !psbt.outputs[i].bip32_derivation.is_empty() {
change_indexes.push(i);
(change + Amount::from_sat(output.value), spend)
(change + output.value, spend)
} else {
(change, spend + Amount::from_sat(output.value))
(change, spend + output.value)
}
},
);
Expand Down Expand Up @@ -103,7 +103,7 @@ impl SpendTx {
let mut inputs_amount = Amount::from_sat(0);
for (i, input) in psbt.inputs.iter().enumerate() {
if let Some(utxo) = &input.witness_utxo {
inputs_amount += Amount::from_sat(utxo.value);
inputs_amount += utxo.value;
// we try to have it from the coin
} else if let Some(coin) = psbt
.unsigned_tx
Expand Down Expand Up @@ -285,9 +285,9 @@ impl HistoryTransaction {
(Amount::from_sat(0), Amount::from_sat(0)),
|(change, spend), (i, output)| {
if change_indexes.contains(&i) {
(change + Amount::from_sat(output.value), spend)
(change + output.value, spend)
} else {
(change, spend + Amount::from_sat(output.value))
(change, spend + output.value)
}
},
);
Expand Down
6 changes: 3 additions & 3 deletions gui/src/installer/step/descriptor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::str::FromStr;
use std::sync::{Arc, Mutex};

use iced::Command;
use liana::miniscript::bitcoin::bip32::ExtendedPubKey;
use liana::miniscript::bitcoin::bip32::Xpub;
use liana::{
descriptors::{LianaDescriptor, LianaPolicy, PathInfo},
miniscript::{
Expand Down Expand Up @@ -565,9 +565,9 @@ impl Step for DefineDescriptor {
}

fn new_multixkey_from_xpub(
xpub: DescriptorXKey<ExtendedPubKey>,
xpub: DescriptorXKey<Xpub>,
derivation_index: usize,
) -> DescriptorMultiXKey<ExtendedPubKey> {
) -> DescriptorMultiXKey<Xpub> {
DescriptorMultiXKey {
origin: xpub.origin,
xkey: xpub.xkey,
Expand Down
4 changes: 2 additions & 2 deletions gui/src/signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ pub use liana::signer::SignerError;

use liana::{
miniscript::bitcoin::{
bip32::{DerivationPath, ExtendedPubKey, Fingerprint},
bip32::{DerivationPath, Fingerprint, Xpub},
psbt::Psbt,
secp256k1, Network,
},
Expand Down Expand Up @@ -48,7 +48,7 @@ impl Signer {
self.fingerprint
}

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

Expand Down
2 changes: 1 addition & 1 deletion gui/ui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ edition = "2021"
iced = { version = "0.9", default_features = false, features = ["svg", "image", "glow"] }
iced_native = "0.10"
iced_lazy = { version = "0.6"}
bitcoin = "0.30"
bitcoin = "0.31"
chrono = "0.4"

0 comments on commit 043b7c7

Please sign in to comment.