Simplifying Bitcoin client creation a bit

This commit is contained in:
Dave Hrycyszyn
2024-07-25 20:16:56 +01:00
parent b031fbc244
commit 0edfbfaab1
2 changed files with 3 additions and 3 deletions

View File

@@ -75,7 +75,7 @@ impl BitcoinClient {
}
/// Creates a Bitcoin descriptor wallet with the mnemonic in the given user directory.
pub(crate) fn create_wallet(name: &str, network: Network) -> anyhow::Result<BitcoinClient> {
pub(crate) fn create(name: &str, network: Network) -> anyhow::Result<BitcoinClient> {
let keys_dir = utils::home(name);
let mnemonic_path = crate::utils::side_paths(keys_dir).1; // TODO: this tuple stinks

View File

@@ -9,8 +9,8 @@ use super::client::BitcoinClient;
async fn setup() -> Result<(BitcoinClient, BitcoinClient), anyhow::Error> {
tracing_setup();
let dave = BitcoinClient::create_wallet("dave", Network::Signet)?;
let sammy = BitcoinClient::create_wallet("sammy", Network::Signet)?;
let dave = BitcoinClient::create("dave", Network::Signet)?;
let sammy = BitcoinClient::create("sammy", Network::Signet)?;
dave.sync()?;
let _ = dave.wallet.get_balance();