Merge #569: gui: bitcoin=0.30 and async-hwi=0.0.8

e327928f8383187b49d263176495582472fe099c gui: bitcoin=0.30 and async-hwi=0.0.8 (edouard)

Pull request description:

ACKs for top commit:
  edouardparis:
    Self-ACK e327928f8383187b49d263176495582472fe099c

Tree-SHA512: 92e2c71348fc8e8700750b661cc24cc479a2c0840caa3c0810f94a5d638da156cd0453981da336be3306a23b4e34aa460b880f38a5a52daa2099ff4482c71c3e
This commit is contained in:
edouard 2023-07-19 17:38:53 +02:00
commit 20331bcf8c
No known key found for this signature in database
GPG Key ID: E65F7A089C20DC8F
29 changed files with 140 additions and 122 deletions

117
gui/Cargo.lock generated
View File

@ -60,12 +60,6 @@ version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
[[package]]
name = "ahash"
version = "0.3.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e8fd72866655d1904d6b0997d0b07ba561047d070fbe29de039031c641b61217"
[[package]]
name = "ahash"
version = "0.7.6"
@ -139,9 +133,9 @@ dependencies = [
[[package]]
name = "async-hwi"
version = "0.0.7"
version = "0.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fd74315dfee3384712b3f22849db68c6f4e77b86a483c57630abcd05eaba9a62"
checksum = "85192c0f286ebcf3f154ea7220ac343a097aa327a0e748c001b685a0c7f05e4f"
dependencies = [
"async-trait",
"base64 0.13.1",
@ -222,7 +216,7 @@ version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "93f2635620bf0b9d4576eb7bb9a38a55df78bd1205d26fa994b25911a69f212f"
dependencies = [
"bitcoin_hashes",
"bitcoin_hashes 0.11.0",
"serde",
"unicode-normalization",
]
@ -250,25 +244,39 @@ checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61"
[[package]]
name = "bitcoin"
version = "0.29.2"
version = "0.30.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0694ea59225b0c5f3cb405ff3f670e4828358ed26aec49dc352f730f0cb1a8a3"
checksum = "b36f4c848f6bd9ff208128f08751135846cc23ae57d66ab10a22efff1c675f3c"
dependencies = [
"base64 0.13.1",
"bech32",
"bitcoin_hashes",
"bitcoin-private",
"bitcoin_hashes 0.12.0",
"core2",
"hashbrown 0.8.2",
"hex_lit",
"secp256k1",
"serde",
]
[[package]]
name = "bitcoin-private"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "73290177011694f38ec25e165d0387ab7ea749a4b81cd4c80dae5988229f7a57"
[[package]]
name = "bitcoin_hashes"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4"
[[package]]
name = "bitcoin_hashes"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d7066118b13d4b20b23645932dfb3a81ce7e29f95726c2036fa33cd7b092501"
dependencies = [
"bitcoin-private",
"core2",
"serde",
]
@ -1420,23 +1428,13 @@ dependencies = [
"crunchy",
]
[[package]]
name = "hashbrown"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e91b62f79061a0bc2e046024cb7ba44b08419ed238ecbd9adbd787434b9e8c25"
dependencies = [
"ahash 0.3.8",
"autocfg",
]
[[package]]
name = "hashbrown"
version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e"
dependencies = [
"ahash 0.7.6",
"ahash",
]
[[package]]
@ -1445,7 +1443,7 @@ version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
dependencies = [
"ahash 0.7.6",
"ahash",
]
[[package]]
@ -1493,6 +1491,12 @@ version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
[[package]]
name = "hex_lit"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3011d1213f159867b13cfd6ac92d2cd5f1345762c63be3554e84092d85a50bbd"
[[package]]
name = "hexf-parse"
version = "0.2.1"
@ -1796,6 +1800,18 @@ dependencies = [
"serde_json",
]
[[package]]
name = "jsonrpc"
version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "34efde8d2422fb79ed56db1d3aea8fa5b583351d15a26770cdee2f88813dd702"
dependencies = [
"base64 0.13.1",
"minreq",
"serde",
"serde_json",
]
[[package]]
name = "kamadak-exif"
version = "0.5.5"
@ -1891,26 +1907,26 @@ dependencies = [
[[package]]
name = "ledger_bitcoin_client"
version = "0.1.3"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23425498fc8127d0ec3938ddce6d0f926ad9ff27bde27278b061a79c782f542d"
checksum = "bd0a13c32d94c0313fa58f77f14f7aa425fddc6cd13aa375bde12f98740f0e6a"
dependencies = [
"async-trait",
"bitcoin",
"miniscript",
]
[[package]]
name = "liana"
version = "0.4.0"
source = "git+https://github.com/wizardsardine/liana?branch=master#9a78b8cfffd5075dea3a041a9e661c27b14c57a2"
version = "1.0.0"
source = "git+https://github.com/wizardsardine/liana?branch=master#ebea147c2fd6768a8fee9aea8255721e305d568d"
dependencies = [
"backtrace",
"base64 0.13.1",
"bip39",
"dirs 5.0.0",
"fern",
"getrandom",
"jsonrpc",
"jsonrpc 0.16.0",
"log",
"miniscript",
"rdrand",
@ -1929,10 +1945,11 @@ dependencies = [
"base64 0.13.1",
"chrono",
"dirs 3.0.2",
"hex",
"iced",
"iced_lazy",
"iced_native",
"jsonrpc",
"jsonrpc 0.12.1",
"liana",
"liana_ui",
"log",
@ -1979,9 +1996,9 @@ checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb"
[[package]]
name = "libsqlite3-sys"
version = "0.23.2"
version = "0.24.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2cafc7c74096c336d9d27145f7ebd4f4b6f95ba16aa5a282387267e6925cb58"
checksum = "898745e570c7d0453cc1fbc4a701eb6c662ed54e8fec8b7d14be137ebeeb9d14"
dependencies = [
"cc",
"pkg-config",
@ -2185,10 +2202,13 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
[[package]]
name = "miniscript"
version = "9.0.0"
source = "git+https://github.com/darosior/rust-miniscript?branch=multipath_descriptors_on_9.0#3104519501ce6ad15b36dcec759936f4d3bd3980"
version = "10.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1eb102b66b2127a872dbcc73095b7b47aeb9d92f7b03c2b2298253ffc82c7594"
dependencies = [
"bitcoin",
"bitcoin-private",
"hashbrown 0.11.2",
"serde",
]
@ -2201,6 +2221,17 @@ dependencies = [
"adler",
]
[[package]]
name = "minreq"
version = "2.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3de406eeb24aba36ed3829532fa01649129677186b44a49debec0ec574ca7da7"
dependencies = [
"log",
"serde",
"serde_json",
]
[[package]]
name = "mio"
version = "0.8.6"
@ -3021,9 +3052,9 @@ dependencies = [
[[package]]
name = "rusqlite"
version = "0.26.3"
version = "0.27.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ba4d3462c8b2e4d7f4fcfcf2b296dc6b65404fbbc7b63daa37fd485c149daf7"
checksum = "85127183a999f7db96d1a976a309eebbfb6ea3b0b400ddd8340190129de6eb7a"
dependencies = [
"bitflags",
"fallible-iterator",
@ -3109,20 +3140,20 @@ dependencies = [
[[package]]
name = "secp256k1"
version = "0.24.3"
version = "0.27.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6b1629c9c557ef9b293568b338dddfc8208c98a18c59d722a9d53f859d9c9b62"
checksum = "25996b82292a7a57ed3508f052cfff8640d38d32018784acd714758b43da9c8f"
dependencies = [
"bitcoin_hashes",
"bitcoin_hashes 0.12.0",
"secp256k1-sys",
"serde",
]
[[package]]
name = "secp256k1-sys"
version = "0.6.1"
version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "83080e2c2fc1006e625be82e5d1eb6a43b7fd9578b617fcc55814daf286bba4b"
checksum = "70a129b9e9efbfb223753b9163c4ab3b13cff7fd9c7f010fbac25ab4099fa07e"
dependencies = [
"cc",
]

View File

@ -14,11 +14,12 @@ name = "liana-gui"
path = "src/main.rs"
[dependencies]
async-hwi = "0.0.7"
async-hwi = "0.0.9"
liana = { git = "https://github.com/wizardsardine/liana", branch = "master", default-features = false }
liana_ui = { path = "ui" }
backtrace = "0.3"
base64 = "0.13"
hex = "0.4.3"
iced = { version = "0.9", default-features= false, features = ["tokio", "glow", "svg", "qr_code", "image"] }
iced_native = "0.10"

View File

@ -2,10 +2,7 @@ use std::sync::Arc;
use liana::{
config::Config as DaemonConfig,
miniscript::bitcoin::{
util::{bip32::Fingerprint, psbt::Psbt},
Address,
},
miniscript::bitcoin::{bip32::Fingerprint, psbt::Psbt, Address},
};
use crate::{

View File

@ -3,7 +3,7 @@ use std::fs::OpenOptions;
use std::io::Write;
use std::path::PathBuf;
use liana::miniscript::bitcoin::{util::bip32::Fingerprint, Network};
use liana::miniscript::bitcoin::{bip32::Fingerprint, Network};
use serde::{Deserialize, Serialize};
use crate::{app::wallet::Wallet, hw::HardwareWalletConfig};

View File

@ -310,7 +310,7 @@ impl State for ReceivePanel {
async move {
daemon
.get_new_address()
.map(|res| res.address)
.map(|res| res.address().clone())
.map_err(|e| e.into())
},
Message::ReceiveAddress,
@ -351,12 +351,11 @@ mod tests {
async fn test_receive_panel() {
let addr =
Address::from_str("tb1qkldgvljmjpxrjq2ev5qxe8dvhn0dph9q85pwtfkjeanmwdue2akqj4twxj")
.unwrap();
.unwrap()
.assume_checked();
let daemon = Daemon::new(vec![(
Some(json!({"method": "getnewaddress", "params": Option::<Request>::None})),
Ok(json!(GetAddressResult {
address: addr.clone()
})),
Ok(json!(GetAddressResult::new(addr.clone()))),
)]);
let sandbox: Sandbox<ReceivePanel> = Sandbox::new(ReceivePanel::default());

View File

@ -4,10 +4,7 @@ use std::sync::Arc;
use iced::Command;
use liana::{
descriptors::LianaPolicy,
miniscript::bitcoin::{
consensus,
util::{bip32::Fingerprint, psbt::Psbt},
},
miniscript::bitcoin::{bip32::Fingerprint, psbt::Psbt},
};
use liana_ui::{
@ -463,10 +460,8 @@ impl Action for UpdateAction {
Ok(()) => {
self.success = true;
self.error = None;
let psbt = consensus::encode::deserialize::<Psbt>(
&base64::decode(&self.updated.value).unwrap(),
)
.expect("Already checked");
let psbt = Psbt::deserialize(&base64::decode(&self.updated.value).unwrap())
.expect("Already checked");
for (i, input) in tx.psbt.inputs.iter_mut().enumerate() {
if tx
.psbt
@ -501,7 +496,7 @@ impl Action for UpdateAction {
self.updated.value = s;
if let Some(psbt) = base64::decode(&self.updated.value)
.ok()
.and_then(|bytes| consensus::encode::deserialize::<Psbt>(&bytes).ok())
.and_then(|bytes| Psbt::deserialize(&bytes).ok())
{
self.updated.valid = tx.psbt.unsigned_tx.txid() == psbt.unsigned_tx.txid();
}
@ -510,7 +505,7 @@ impl Action for UpdateAction {
if self.updated.valid {
self.processing = true;
self.error = None;
let updated: Psbt = consensus::encode::deserialize(
let updated = Psbt::deserialize(
&base64::decode(&self.updated.value).expect("Already checked"),
)
.unwrap();

View File

@ -2,7 +2,7 @@ use std::sync::Arc;
use iced::Command;
use liana::miniscript::bitcoin::{consensus, util::psbt::Psbt};
use liana::miniscript::bitcoin::psbt::Psbt;
use liana_ui::{
component::{form, modal},
widget::Element,
@ -172,14 +172,14 @@ impl ImportPsbtModal {
self.imported.value = s;
self.imported.valid = base64::decode(&self.imported.value)
.ok()
.and_then(|bytes| consensus::encode::deserialize::<Psbt>(&bytes).ok())
.and_then(|bytes| Psbt::deserialize(&bytes).ok())
.is_some();
}
Message::View(view::Message::ImportSpend(view::ImportSpendMessage::Confirm)) => {
if self.imported.valid {
self.processing = true;
self.error = None;
let imported: Psbt = consensus::encode::deserialize(
let imported = Psbt::deserialize(
&base64::decode(&self.imported.value).expect("Already checked"),
)
.unwrap();

View File

@ -3,7 +3,7 @@ use std::sync::Arc;
use iced::Command;
use liana::miniscript::bitcoin::util::bip32::{DerivationPath, Fingerprint};
use liana::miniscript::bitcoin::bip32::{DerivationPath, Fingerprint};
use liana_ui::{component::form, widget::Element};
use crate::{

View File

@ -5,7 +5,7 @@ use std::sync::Arc;
use iced::Command;
use liana::miniscript::bitcoin::{hashes::hex::ToHex, util::bip32::Fingerprint, Network};
use liana::miniscript::bitcoin::{bip32::Fingerprint, Network};
use liana_ui::{
component::{form, modal},
@ -318,11 +318,11 @@ async fn register_wallet(
.iter_mut()
.find(|cfg| cfg.kind == kind && cfg.fingerprint == fingerprint)
{
hw_config.token = hmac.to_hex();
hw_config.token = hex::encode(hmac);
} else {
wallet_setting.hardware_wallets.push(HardwareWalletConfig {
kind,
token: hmac.to_hex(),
token: hex::encode(hmac),
fingerprint,
})
}

View File

@ -6,7 +6,7 @@ use iced::Command;
use liana::{
descriptors::LianaDescriptor,
miniscript::bitcoin::{
self, util::psbt::Psbt, Address, Amount, Denomination, Network, OutPoint,
self, address, psbt::Psbt, Address, Amount, Denomination, Network, OutPoint,
},
};
@ -168,7 +168,7 @@ impl DefineSpend {
// needed.
let tx_template = bitcoin::Transaction {
version: 2,
lock_time: bitcoin::PackedLockTime(0),
lock_time: bitcoin::blockdata::locktime::absolute::LockTime::ZERO,
input: selected_coins
.iter()
.map(|_| bitcoin::TxIn::default())
@ -181,6 +181,7 @@ impl DefineSpend {
Some(bitcoin::TxOut {
script_pubkey: Address::from_str(&recipient.address.value)
.unwrap()
.payload
.script_pubkey(),
value: recipient.amount().unwrap(),
})
@ -253,7 +254,8 @@ impl Step for DefineSpend {
|(coin, selected)| if *selected { Some(coin.outpoint) } else { None },
)
.collect();
let mut outputs: HashMap<Address, u64> = HashMap::new();
let mut outputs: HashMap<Address<address::NetworkUnchecked>, u64> =
HashMap::new();
for recipient in &self.recipients {
outputs.insert(
Address::from_str(&recipient.address.value).expect("Checked before"),
@ -355,7 +357,7 @@ impl Recipient {
}
if let Ok(address) = Address::from_str(&self.address.value) {
if amount <= address.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(),
));

View File

@ -1,5 +1,5 @@
use crate::app::menu::Menu;
use liana::miniscript::bitcoin::util::bip32::Fingerprint;
use liana::miniscript::bitcoin::bip32::Fingerprint;
#[derive(Debug, Clone)]
pub enum Message {

View File

@ -8,7 +8,7 @@ use iced::{
use liana::{
descriptors::{LianaPolicy, PathInfo, PathSpendInfo},
miniscript::bitcoin::{
util::bip32::{DerivationPath, Fingerprint},
bip32::{DerivationPath, Fingerprint},
Address, Amount, Network, Transaction,
},
};

View File

@ -6,7 +6,7 @@ use iced::{
};
use liana::miniscript::bitcoin::{
util::bip32::{DerivationPath, Fingerprint},
bip32::{DerivationPath, Fingerprint},
Amount,
};

View File

@ -7,7 +7,7 @@ use iced::{
Alignment, Length,
};
use liana::miniscript::bitcoin::{util::bip32::Fingerprint, Network};
use liana::miniscript::bitcoin::{bip32::Fingerprint, Network};
use super::{dashboard, message::*};

View File

@ -8,7 +8,7 @@ use iced::{
use liana::{
descriptors::LianaPolicy,
miniscript::bitcoin::{util::bip32::Fingerprint, Amount, Network},
miniscript::bitcoin::{bip32::Fingerprint, Amount, Network},
};
use liana_ui::{

View File

@ -10,7 +10,7 @@ use crate::{
use liana::{miniscript::bitcoin, signer::HotSigner};
use liana::descriptors::LianaDescriptor;
use liana::miniscript::bitcoin::util::bip32::Fingerprint;
use liana::miniscript::bitcoin::bip32::Fingerprint;
pub const DEFAULT_WALLET_NAME: &str = "Liana";

View File

@ -11,7 +11,7 @@ pub mod jsonrpc;
use liana::{
config::Config,
miniscript::bitcoin::{consensus, util::psbt::Psbt, Address, OutPoint, Txid},
miniscript::bitcoin::{address, psbt::Psbt, Address, OutPoint, Txid},
};
use super::{model::*, Daemon, DaemonError};
@ -82,7 +82,7 @@ impl<C: Client + Debug> Daemon for Lianad<C> {
fn create_spend_tx(
&self,
coins_outpoints: &[OutPoint],
destinations: &HashMap<Address, u64>,
destinations: &HashMap<Address<address::NetworkUnchecked>, u64>,
feerate_vb: u64,
) -> Result<CreateSpendResult, DaemonError> {
self.call(
@ -96,7 +96,7 @@ impl<C: Client + Debug> Daemon for Lianad<C> {
}
fn update_spend_tx(&self, psbt: &Psbt) -> Result<(), DaemonError> {
let spend_tx = base64::encode(consensus::serialize(psbt));
let spend_tx = base64::encode(psbt.serialize());
let _res: serde_json::value::Value = self.call("updatespend", Some(vec![spend_tx]))?;
Ok(())
}
@ -136,7 +136,7 @@ impl<C: Client + Debug> Daemon for Lianad<C> {
fn create_recovery(
&self,
address: Address,
address: Address<address::NetworkUnchecked>,
feerate_vb: u64,
sequence: Option<u16>,
) -> Result<Psbt, DaemonError> {

View File

@ -4,7 +4,7 @@ use std::sync::RwLock;
use super::{model::*, Daemon, DaemonError};
use liana::{
config::Config,
miniscript::bitcoin::{util::psbt::Psbt, Address, OutPoint, Txid},
miniscript::bitcoin::{address, psbt::Psbt, Address, OutPoint, Txid},
DaemonHandle,
};
@ -137,7 +137,7 @@ impl Daemon for EmbeddedDaemon {
fn create_spend_tx(
&self,
coins_outpoints: &[OutPoint],
destinations: &HashMap<Address, u64>,
destinations: &HashMap<Address<address::NetworkUnchecked>, u64>,
feerate_vb: u64,
) -> Result<CreateSpendResult, DaemonError> {
self.handle
@ -196,7 +196,7 @@ impl Daemon for EmbeddedDaemon {
fn create_recovery(
&self,
address: Address,
address: Address<address::NetworkUnchecked>,
feerate_vb: u64,
sequence: Option<u16>,
) -> Result<Psbt, DaemonError> {

View File

@ -8,7 +8,7 @@ use std::io::ErrorKind;
use liana::{
config::Config,
miniscript::bitcoin::{util::psbt::Psbt, Address, OutPoint, Txid},
miniscript::bitcoin::{address, psbt::Psbt, Address, OutPoint, Txid},
StartupError,
};
@ -55,7 +55,7 @@ pub trait Daemon: Debug {
fn create_spend_tx(
&self,
coins_outpoints: &[OutPoint],
destinations: &HashMap<Address, u64>,
destinations: &HashMap<Address<address::NetworkUnchecked>, u64>,
feerate_vb: u64,
) -> Result<model::CreateSpendResult, DaemonError>;
fn update_spend_tx(&self, psbt: &Psbt) -> Result<(), DaemonError>;
@ -70,7 +70,7 @@ pub trait Daemon: Debug {
) -> Result<model::ListTransactionsResult, DaemonError>;
fn create_recovery(
&self,
address: Address,
address: Address<address::NetworkUnchecked>,
feerate_vb: u64,
sequence: Option<u16>,
) -> Result<Psbt, DaemonError>;

View File

@ -6,10 +6,7 @@ pub use liana::{
ListSpendEntry, ListSpendResult, ListTransactionsResult, TransactionInfo,
},
descriptors::{PartialSpendInfo, PathSpendInfo},
miniscript::bitcoin::{
util::{bip32::Fingerprint, psbt::Psbt},
Amount, Transaction,
},
miniscript::bitcoin::{bip32::Fingerprint, psbt::Psbt, Amount, Transaction},
};
pub type Coin = ListCoinsEntry;

View File

@ -2,10 +2,7 @@ use std::{collections::HashMap, sync::Arc};
use crate::app::wallet::Wallet;
use async_hwi::{ledger, specter, DeviceKind, Error as HWIError, Version, HWI};
use liana::miniscript::bitcoin::{
hashes::hex::{FromHex, ToHex},
util::bip32::Fingerprint,
};
use liana::miniscript::bitcoin::{bip32::Fingerprint, hashes::hex::FromHex};
use serde::{Deserialize, Serialize};
use tracing::{debug, warn};
@ -75,7 +72,7 @@ impl HardwareWalletConfig {
Self {
kind: kind.to_string(),
fingerprint,
token: token.to_hex(),
token: hex::encode(token),
}
}
@ -126,8 +123,8 @@ pub async fn list_hardware_wallets(wallet: &Wallet) -> Vec<HardwareWallet> {
.iter()
.find(|cfg| cfg.fingerprint == fingerprint)
{
device
.load_wallet(&wallet.name, &descriptor, Some(cfg.token()))
device = device
.with_wallet(&wallet.name, &descriptor, Some(cfg.token()))
.expect("Configuration must be correct");
registered = true;
}
@ -177,8 +174,8 @@ pub async fn list_hardware_wallets(wallet: &Wallet) -> Vec<HardwareWallet> {
.iter()
.find(|cfg| cfg.fingerprint == fingerprint)
{
device
.load_wallet(&wallet.name, &descriptor, Some(cfg.token()))
device = device
.with_wallet(&wallet.name, &descriptor, Some(cfg.token()))
.expect("Configuration must be correct");
registered = true;
}

View File

@ -24,11 +24,7 @@ pub struct Context {
pub bitcoind_config: Option<BitcoindConfig>,
pub descriptor: Option<LianaDescriptor>,
pub keys: Vec<KeySetting>,
pub hws: Vec<(
DeviceKind,
bitcoin::util::bip32::Fingerprint,
Option<[u8; 32]>,
)>,
pub hws: Vec<(DeviceKind, bitcoin::bip32::Fingerprint, Option<[u8; 32]>)>,
pub data_dir: PathBuf,
pub hw_is_used: bool,
// In case a user entered a mnemonic,

View File

@ -1,5 +1,5 @@
use liana::miniscript::{
bitcoin::{util::bip32::Fingerprint, Network},
bitcoin::{bip32::Fingerprint, Network},
DescriptorPublicKey,
};
use std::path::PathBuf;

View File

@ -8,7 +8,7 @@ use liana::{
descriptors::{LianaDescriptor, LianaPolicy, PathInfo},
miniscript::{
bitcoin::{
util::bip32::{ChildNumber, DerivationPath, Fingerprint},
bip32::{ChildNumber, DerivationPath, Fingerprint},
Network,
},
descriptor::{
@ -975,7 +975,7 @@ async fn get_extended_pubkey(
derivation_path: DerivationPath,
) -> Result<DescriptorPublicKey, Error> {
let xkey = hw
.get_extended_pubkey(&derivation_path, false)
.get_extended_pubkey(&derivation_path)
.await
.map_err(Error::from)?;
Ok(DescriptorPublicKey::XPub(DescriptorXKey {

View File

@ -13,7 +13,7 @@ use std::str::FromStr;
use iced::Command;
use liana::{
config::BitcoindConfig,
miniscript::bitcoin::{util::bip32::Fingerprint, Network},
miniscript::bitcoin::{bip32::Fingerprint, Network},
};
use jsonrpc::{client::Client, simple_http::SimpleHttpTransport};
@ -91,6 +91,9 @@ fn bitcoind_default_cookie_path(network: &Network) -> Option<String> {
Network::Signet => {
path.push("signet/.cookie");
}
_ => {
path.push(".cookie");
}
}
return path.to_str().map(|s| s.to_string());
@ -104,6 +107,7 @@ fn bitcoind_default_address(network: &Network) -> String {
Network::Testnet => "127.0.0.1:18332".to_string(),
Network::Regtest => "127.0.0.1:18443".to_string(),
Network::Signet => "127.0.0.1:38332".to_string(),
_ => "127.0.0.1:8332".to_string(),
}
}

View File

@ -5,7 +5,7 @@ use iced::{alignment, Alignment, Length};
use std::{collections::HashSet, str::FromStr};
use liana::miniscript::bitcoin::{self, util::bip32::Fingerprint};
use liana::miniscript::bitcoin::{self, bip32::Fingerprint};
use liana_ui::{
color,
component::{
@ -42,6 +42,7 @@ impl From<bitcoin::Network> for Network {
bitcoin::Network::Testnet => Network::Testnet,
bitcoin::Network::Regtest => Network::Regtest,
bitcoin::Network::Signet => Network::Signet,
_ => Network::Mainnet,
}
}
}
@ -653,7 +654,7 @@ pub fn register_descriptor<'a>(
progress: (usize, usize),
descriptor: String,
hws: &'a [HardwareWallet],
registered: &HashSet<bitcoin::util::bip32::Fingerprint>,
registered: &HashSet<bitcoin::bip32::Fingerprint>,
error: Option<&Error>,
processing: bool,
chosen_hw: Option<usize>,

View File

@ -114,6 +114,7 @@ impl Launcher {
Network::Testnet => "Bitcoin Testnet",
Network::Signet => "Bitcoin Signet",
Network::Regtest => "Bitcoin Regtest",
_ => "Bitcoin unknown",
})),
)
.on_press(ViewMessage::Check(*choice))

View File

@ -2,12 +2,9 @@ pub use liana::signer::SignerError;
use liana::{
miniscript::bitcoin::{
secp256k1,
util::{
bip32::{DerivationPath, ExtendedPubKey, Fingerprint},
psbt::Psbt,
},
Network,
bip32::{DerivationPath, ExtendedPubKey, Fingerprint},
psbt::Psbt,
secp256k1, Network,
},
signer::HotSigner,
};

View File

@ -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.29"
bitcoin = "0.30"
chrono = "0.4"