Skip to content

Commit

Permalink
gui: bump liana
Browse files Browse the repository at this point in the history
  • Loading branch information
edouardparis committed Aug 9, 2023
1 parent abaadde commit 41aebcf
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
3 changes: 2 additions & 1 deletion gui/src/app/state/recovery.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::collections::HashSet;
use std::str::FromStr;
use std::sync::Arc;

Expand Down Expand Up @@ -197,7 +198,7 @@ impl From<RecoveryPanel> for Box<dyn State> {
pub struct RecoveryPath {
threshold: usize,
sequence: u16,
origins: Vec<(Fingerprint, DerivationPath)>,
origins: Vec<(Fingerprint, HashSet<DerivationPath>)>,
total_amount: Amount,
number_of_coins: usize,
}
Expand Down
18 changes: 9 additions & 9 deletions gui/src/app/view/psbt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,19 +309,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.0) {
row.push(if let Some(alias) = keys_aliases.get(value) {
Container::new(
tooltip::Tooltip::new(
Container::new(text(alias))
.padding(10)
.style(theme::Container::Pill(theme::Pill::Simple)),
value.0.to_string(),
value.to_string(),
tooltip::Position::Bottom,
)
.style(theme::Container::Card(theme::Card::Simple)),
)
} else {
Container::new(text(value.0.to_string()))
Container::new(text(value.to_string()))
.padding(10)
.style(theme::Container::Pill(theme::Pill::Simple))
})
Expand Down Expand Up @@ -401,14 +401,14 @@ pub fn path_view<'a>(
sigs: &'a PathSpendInfo,
key_aliases: &'a HashMap<Fingerprint, String>,
) -> Element<'a, Message> {
let mut keys: Vec<(Fingerprint, DerivationPath)> =
let mut keys: Vec<(Fingerprint, HashSet<DerivationPath>)> =
path.thresh_origins().1.into_iter().collect();
let missing_signatures = if sigs.sigs_count >= sigs.threshold {
0
} else {
sigs.threshold - sigs.sigs_count
};
keys.sort();
keys.sort_by_key(|a| a.0);
scrollable(
Row::new()
.align_items(Alignment::Center)
Expand Down Expand Up @@ -439,7 +439,7 @@ pub fn path_view<'a>(
None
} else {
Some(keys.iter().fold(Row::new().spacing(5), |row, value| {
row.push_maybe(if !sigs.signed_pubkeys.contains_key(value) {
row.push_maybe(if !sigs.signed_pubkeys.contains_key(&value.0) {
Some(if let Some(alias) = key_aliases.get(&value.0) {
Container::new(
tooltip::Tooltip::new(
Expand Down Expand Up @@ -470,19 +470,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.0) {
row.push(if let Some(alias) = key_aliases.get(value) {
Container::new(
tooltip::Tooltip::new(
Container::new(text(alias))
.padding(10)
.style(theme::Container::Pill(theme::Pill::Simple)),
value.0.to_string(),
value.to_string(),
tooltip::Position::Bottom,
)
.style(theme::Container::Card(theme::Card::Simple)),
)
} else {
Container::new(text(value.0.to_string()))
Container::new(text(value.to_string()))
.padding(10)
.style(theme::Container::Pill(theme::Pill::Simple))
})
Expand Down
4 changes: 2 additions & 2 deletions gui/src/app/view/recovery.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::collections::HashMap;
use std::collections::{HashMap, HashSet};

use iced::{
widget::{checkbox, tooltip, Space},
Expand Down Expand Up @@ -137,7 +137,7 @@ pub fn recovery<'a>(
pub fn recovery_path_view<'a>(
index: usize,
threshold: usize,
origins: &'a [(Fingerprint, DerivationPath)],
origins: &'a [(Fingerprint, HashSet<DerivationPath>)],
total_amount: Amount,
number_of_coins: usize,
key_aliases: &'a HashMap<Fingerprint, String>,
Expand Down
4 changes: 2 additions & 2 deletions gui/src/daemon/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,12 @@ impl SpendTx {

pub fn signers(&self) -> HashSet<Fingerprint> {
let mut signers = HashSet::new();
for (fg, _) in self.sigs.primary_path().signed_pubkeys.keys() {
for fg in self.sigs.primary_path().signed_pubkeys.keys() {
signers.insert(*fg);
}

for path in self.sigs.recovery_paths().values() {
for (fg, _) in path.signed_pubkeys.keys() {
for fg in path.signed_pubkeys.keys() {
signers.insert(*fg);
}
}
Expand Down

0 comments on commit 41aebcf

Please sign in to comment.