mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-09-23 06:14:45 -04:00
Create means creating the current wallet
This commit is contained in:
parent
5b798217bc
commit
70494fcb4f
4 changed files with 15 additions and 17 deletions
|
@ -167,14 +167,11 @@ async fn init_wallets(
|
||||||
// Setup the Monero wallet
|
// Setup the Monero wallet
|
||||||
let open_wallet_response = monero_wallet.open().await;
|
let open_wallet_response = monero_wallet.open().await;
|
||||||
if open_wallet_response.is_err() {
|
if open_wallet_response.is_err() {
|
||||||
monero_wallet
|
monero_wallet.create().await.context(format!(
|
||||||
.create_wallet(DEFAULT_WALLET_NAME)
|
"Unable to create Monero wallet.\
|
||||||
.await
|
|
||||||
.context(format!(
|
|
||||||
"Unable to create Monero wallet.\
|
|
||||||
Please ensure that the monero-wallet-rpc is available at {}",
|
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);
|
info!("Created Monero wallet {}", DEFAULT_WALLET_NAME);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -295,14 +295,11 @@ async fn init_monero_wallet(
|
||||||
// Setup the temporary Monero wallet necessary for monitoring the blockchain
|
// Setup the temporary Monero wallet necessary for monitoring the blockchain
|
||||||
let open_monitoring_wallet_response = monero_wallet.open().await;
|
let open_monitoring_wallet_response = monero_wallet.open().await;
|
||||||
if open_monitoring_wallet_response.is_err() {
|
if open_monitoring_wallet_response.is_err() {
|
||||||
monero_wallet
|
monero_wallet.create().await.context(format!(
|
||||||
.create_wallet(MONERO_BLOCKCHAIN_MONITORING_WALLET_NAME)
|
"Unable to create Monero wallet for blockchain monitoring.\
|
||||||
.await
|
|
||||||
.context(format!(
|
|
||||||
"Unable to create Monero wallet for blockchain monitoring.\
|
|
||||||
Please ensure that the monero-wallet-rpc is available at {}",
|
Please ensure that the monero-wallet-rpc is available at {}",
|
||||||
monero_wallet_rpc_url
|
monero_wallet_rpc_url
|
||||||
))?;
|
))?;
|
||||||
|
|
||||||
debug!(
|
debug!(
|
||||||
"Created Monero wallet for blockchain monitoring with name {}",
|
"Created Monero wallet for blockchain monitoring with name {}",
|
||||||
|
|
|
@ -245,7 +245,7 @@ pub trait OpenWallet {
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
pub trait CreateWallet {
|
pub trait CreateWallet {
|
||||||
async fn create_wallet(&self, file_name: &str) -> Result<()>;
|
async fn create(&self) -> Result<()>;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
|
|
|
@ -178,8 +178,12 @@ impl OpenWallet for Wallet {
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl CreateWallet for Wallet {
|
impl CreateWallet for Wallet {
|
||||||
async fn create_wallet(&self, file_name: &str) -> Result<()> {
|
async fn create(&self) -> Result<()> {
|
||||||
self.inner.lock().await.create_wallet(file_name).await?;
|
self.inner
|
||||||
|
.lock()
|
||||||
|
.await
|
||||||
|
.create_wallet(self.default_wallet_name.as_str())
|
||||||
|
.await?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue