Skip to content

Commit

Permalink
Merge #328: gui: update liana#66e37a2
Browse files Browse the repository at this point in the history
f5de5e9 gui: update liana#66e37a2 (edouard)

Pull request description:

ACKs for top commit:
  edouardparis:
    Self-ACK f5de5e9

Tree-SHA512: 50514a0238cc78c9de0469e70325e60b8c9fb299de85cfccc8d6e6d2a008b9c0c3192bcc1cb91aea41f7a0c7d0ba96a79afeb098c4025ee3bc5ffe13693f35af
  • Loading branch information
edouardparis committed Feb 6, 2023
2 parents 66e37a2 + f5de5e9 commit 4a7a6d1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
2 changes: 1 addition & 1 deletion gui/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 17 additions & 13 deletions gui/src/app/view/spend/detail.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ use iced::{

use liana::{
descriptors::{LianaDescInfo, PathInfo, PathSpendInfo},
miniscript::bitcoin::{util::bip32::Fingerprint, Address, Amount, Network, Transaction},
miniscript::bitcoin::{
util::bip32::{DerivationPath, Fingerprint},
Address, Amount, Network, Transaction,
},
};

use crate::{
Expand Down Expand Up @@ -301,19 +304,19 @@ pub fn signatures<'a>(
sigs.signed_pubkeys
.keys()
.fold(Row::new().spacing(5), |row, value| {
row.push(if let Some(alias) = keys_aliases.get(value) {
row.push(if let Some(alias) = keys_aliases.get(&value.0) {
Container::new(
tooltip::Tooltip::new(
Container::new(text(alias))
.padding(3)
.style(badge::PillStyle::Simple),
value.to_string(),
value.0.to_string(),
tooltip::Position::Bottom,
)
.style(card::SimpleCardStyle),
)
} else {
Container::new(text(value.to_string()))
Container::new(text(value.0.to_string()))
.padding(3)
.style(badge::PillStyle::Simple)
})
Expand Down Expand Up @@ -419,7 +422,8 @@ pub fn path_view<'a>(
sigs: &'a PathSpendInfo,
key_aliases: &'a HashMap<Fingerprint, String>,
) -> Element<'a, Message> {
let mut keys: Vec<Fingerprint> = path.thresh_fingerprints().1.into_iter().collect();
let mut keys: Vec<(Fingerprint, DerivationPath)> =
path.thresh_origins().1.into_iter().collect();
let missing_signatures = if sigs.sigs_count >= sigs.threshold {
0
} else {
Expand Down Expand Up @@ -448,21 +452,21 @@ pub fn path_view<'a>(
.push_maybe(if keys.is_empty() {
None
} else {
Some(keys.iter().fold(Row::new().spacing(5), |row, &value| {
row.push_maybe(if !sigs.signed_pubkeys.contains_key(&value) {
Some(if let Some(alias) = key_aliases.get(&value) {
Some(keys.iter().fold(Row::new().spacing(5), |row, value| {
row.push_maybe(if !sigs.signed_pubkeys.contains_key(value) {
Some(if let Some(alias) = key_aliases.get(&value.0) {
Container::new(
tooltip::Tooltip::new(
Container::new(text(alias))
.padding(3)
.style(badge::PillStyle::Simple),
value.to_string(),
value.0.to_string(),
tooltip::Position::Bottom,
)
.style(card::SimpleCardStyle),
)
} else {
Container::new(text(value.to_string()))
Container::new(text(value.0.to_string()))
.padding(3)
.style(badge::PillStyle::Simple)
})
Expand All @@ -480,19 +484,19 @@ pub fn path_view<'a>(
sigs.signed_pubkeys
.keys()
.fold(Row::new().spacing(5), |row, value| {
row.push(if let Some(alias) = key_aliases.get(value) {
row.push(if let Some(alias) = key_aliases.get(&value.0) {
Container::new(
tooltip::Tooltip::new(
Container::new(text(alias))
.padding(3)
.style(badge::PillStyle::Simple),
value.to_string(),
value.0.to_string(),
tooltip::Position::Bottom,
)
.style(card::SimpleCardStyle),
)
} else {
Container::new(text(value.to_string()))
Container::new(text(value.0.to_string()))
.padding(3)
.style(badge::PillStyle::Simple)
})
Expand Down

0 comments on commit 4a7a6d1

Please sign in to comment.