diff --git a/side-node/src/bitcoin/clients/esplora.rs b/side-node/src/bitcoin/clients/esplora.rs index 81b2d79..9188188 100644 --- a/side-node/src/bitcoin/clients/esplora.rs +++ b/side-node/src/bitcoin/clients/esplora.rs @@ -1,4 +1,4 @@ -use std::{collections::BTreeSet, fs, io::Write, str::FromStr}; +use std::{collections::BTreeSet, fs, io::Write}; use bdk::keys::bip39::Mnemonic; use bdk_esplora::{ @@ -20,6 +20,7 @@ use crate::utils; const STOP_GAP: usize = 50; const PARALLEL_REQUESTS: usize = 5; +/// A wallet that uses the Esplora client to interact with the Bitcoin network. pub struct EsploraWallet { wallet: Wallet, db: Store, @@ -124,8 +125,8 @@ impl EsploraWallet { } } -/// Creates a Bitcoin Signet descriptor wallet with the mnemonic in the given user directory. -pub(crate) fn create_wallet(name: &str) -> anyhow::Result { +/// Creates a Bitcoin descriptor wallet with the mnemonic in the given user directory. +pub(crate) fn create_wallet(name: &str, network: Network) -> anyhow::Result { let keys_dir = utils::home(name); let mnemonic_path = crate::utils::side_paths(keys_dir).1; // TODO: this tuple stinks @@ -157,7 +158,7 @@ pub(crate) fn create_wallet(name: &str) -> anyhow::Result { &external_descriptor, &internal_descriptor, changeset, - Network::Signet, + network, ) .expect("problem setting up wallet"); diff --git a/side-node/src/bitcoin/driver.rs b/side-node/src/bitcoin/driver.rs index b102466..ea2cab1 100644 --- a/side-node/src/bitcoin/driver.rs +++ b/side-node/src/bitcoin/driver.rs @@ -11,7 +11,7 @@ use crate::bitcoin::clients; /// Also, it very handily works with the mutinynet.com esplora server, which is configured /// with 30 second block times. pub(crate) async fn run() -> Result<(), anyhow::Error> { - let mut dave = clients::esplora::create_wallet("dave")?; + let mut dave = clients::esplora::create_wallet("dave", Network::Signet)?; let _next_address = dave.next_unused_address()?;