Merge #551: gui: update async-hwi 0.0.7

89d8e660beb2b4fee13effefdc32daf6341a2728 gui: update async-hwi 0.0.7 (edouard)

Pull request description:

ACKs for top commit:
  edouardparis:
    Self-ACK 89d8e660beb2b4fee13effefdc32daf6341a2728

Tree-SHA512: 9725e422231997c8eb03d01dacf343c66060c1676527a4ea7510b0013f6653acef973b507876f290aab07638a3dfaa04c63d86ade641b55bef171c818de663de
This commit is contained in:
edouard 2023-05-31 17:40:38 +02:00
commit 825a69bd2b
No known key found for this signature in database
GPG Key ID: E65F7A089C20DC8F
3 changed files with 24 additions and 23 deletions

4
gui/Cargo.lock generated
View File

@ -139,9 +139,9 @@ dependencies = [
[[package]]
name = "async-hwi"
version = "0.0.6"
version = "0.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09be30d154c732f398ebe57645f2074c1993fb88b7a457dc41c73487737fcfc6"
checksum = "fd74315dfee3384712b3f22849db68c6f4e77b86a483c57630abcd05eaba9a62"
dependencies = [
"async-trait",
"base64",

View File

@ -14,7 +14,7 @@ name = "liana-gui"
path = "src/main.rs"
[dependencies]
async-hwi = "0.0.6"
async-hwi = "0.0.7"
liana = { git = "https://github.com/wizardsardine/liana", branch = "master", default-features = false }
liana_ui = { path = "ui" }
backtrace = "0.3"

View File

@ -7,7 +7,7 @@ use liana::miniscript::bitcoin::{
util::bip32::Fingerprint,
};
use serde::{Deserialize, Serialize};
use tracing::debug;
use tracing::{debug, warn};
#[derive(Debug, Clone)]
pub enum HardwareWallet {
@ -102,18 +102,18 @@ pub async fn list_hardware_wallets(wallet: &Wallet) -> Vec<HardwareWallet> {
debug!("{}", e);
}
}
match specter::Specter::try_connect_serial().await {
Ok(device) => match HardwareWallet::new(Arc::new(device), Some(&wallet.keys_aliases)).await
{
Ok(hw) => hws.push(hw),
Err(e) => {
debug!("{}", e);
match specter::Specter::enumerate().await {
Ok(devices) => {
for device in devices {
match HardwareWallet::new(Arc::new(device), Some(&wallet.keys_aliases)).await {
Ok(hw) => hws.push(hw),
Err(e) => {
debug!("{}", e);
}
}
}
},
Err(HWIError::DeviceNotFound) => {}
Err(e) => {
debug!("{}", e);
}
Err(e) => warn!("Error while listing specter wallets: {}", e),
}
match ledger::LedgerSimulator::try_connect().await {
Ok(mut device) => match device.get_master_fingerprint().await {
@ -249,17 +249,18 @@ pub async fn list_unregistered_hardware_wallets(
debug!("{}", e);
}
}
match specter::Specter::try_connect_serial().await {
Ok(device) => match HardwareWallet::new(Arc::new(device), aliases).await {
Ok(hw) => hws.push(hw),
Err(e) => {
debug!("{}", e);
match specter::Specter::enumerate().await {
Ok(devices) => {
for device in devices {
match HardwareWallet::new(Arc::new(device), aliases).await {
Ok(hw) => hws.push(hw),
Err(e) => {
debug!("{}", e);
}
}
}
},
Err(HWIError::DeviceNotFound) => {}
Err(e) => {
debug!("{}", e);
}
Err(e) => warn!("Error while listing specter wallets: {}", e),
}
match ledger::LedgerSimulator::try_connect().await {
Ok(device) => match device.get_master_fingerprint().await {