diff --git a/swap/src/bin/asb.rs b/swap/src/bin/asb.rs index 26920365..26721e77 100644 --- a/swap/src/bin/asb.rs +++ b/swap/src/bin/asb.rs @@ -167,14 +167,11 @@ async fn init_wallets( // Setup the Monero wallet let open_wallet_response = monero_wallet.open().await; if open_wallet_response.is_err() { - monero_wallet - .create_wallet(DEFAULT_WALLET_NAME) - .await - .context(format!( - "Unable to create Monero wallet.\ + monero_wallet.create().await.context(format!( + "Unable to create Monero wallet.\ Please ensure that the monero-wallet-rpc is available at {}", - config.monero.wallet_rpc_url - ))?; + config.monero.wallet_rpc_url + ))?; info!("Created Monero wallet {}", DEFAULT_WALLET_NAME); } else { diff --git a/swap/src/bin/swap_cli.rs b/swap/src/bin/swap_cli.rs index 0834151c..a68ce755 100644 --- a/swap/src/bin/swap_cli.rs +++ b/swap/src/bin/swap_cli.rs @@ -295,14 +295,11 @@ async fn init_monero_wallet( // Setup the temporary Monero wallet necessary for monitoring the blockchain let open_monitoring_wallet_response = monero_wallet.open().await; if open_monitoring_wallet_response.is_err() { - monero_wallet - .create_wallet(MONERO_BLOCKCHAIN_MONITORING_WALLET_NAME) - .await - .context(format!( - "Unable to create Monero wallet for blockchain monitoring.\ + monero_wallet.create().await.context(format!( + "Unable to create Monero wallet for blockchain monitoring.\ Please ensure that the monero-wallet-rpc is available at {}", - monero_wallet_rpc_url - ))?; + monero_wallet_rpc_url + ))?; debug!( "Created Monero wallet for blockchain monitoring with name {}", diff --git a/swap/src/monero.rs b/swap/src/monero.rs index 00056c2e..b3c9c51a 100644 --- a/swap/src/monero.rs +++ b/swap/src/monero.rs @@ -245,7 +245,7 @@ pub trait OpenWallet { #[async_trait] pub trait CreateWallet { - async fn create_wallet(&self, file_name: &str) -> Result<()>; + async fn create(&self) -> Result<()>; } #[async_trait] diff --git a/swap/src/monero/wallet.rs b/swap/src/monero/wallet.rs index 202b7185..cc79a250 100644 --- a/swap/src/monero/wallet.rs +++ b/swap/src/monero/wallet.rs @@ -178,8 +178,12 @@ impl OpenWallet for Wallet { #[async_trait] impl CreateWallet for Wallet { - async fn create_wallet(&self, file_name: &str) -> Result<()> { - self.inner.lock().await.create_wallet(file_name).await?; + async fn create(&self) -> Result<()> { + self.inner + .lock() + .await + .create_wallet(self.default_wallet_name.as_str()) + .await?; Ok(()) } }