mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-04-25 18:29:09 -04:00
Make variable naming consistent
This commit is contained in:
parent
8b59ac26ba
commit
683d565679
@ -20,7 +20,7 @@ pub struct Swap {
|
|||||||
pub monero_wallet: Arc<monero::Wallet>,
|
pub monero_wallet: Arc<monero::Wallet>,
|
||||||
pub env_config: env::Config,
|
pub env_config: env::Config,
|
||||||
pub id: Uuid,
|
pub id: Uuid,
|
||||||
pub receive_monero_address: monero::Address,
|
pub monero_receive_address: monero::Address,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Swap {
|
impl Swap {
|
||||||
@ -32,7 +32,7 @@ impl Swap {
|
|||||||
monero_wallet: Arc<monero::Wallet>,
|
monero_wallet: Arc<monero::Wallet>,
|
||||||
env_config: env::Config,
|
env_config: env::Config,
|
||||||
event_loop_handle: cli::EventLoopHandle,
|
event_loop_handle: cli::EventLoopHandle,
|
||||||
receive_monero_address: monero::Address,
|
monero_receive_address: monero::Address,
|
||||||
btc_amount: bitcoin::Amount,
|
btc_amount: bitcoin::Amount,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
Self {
|
Self {
|
||||||
@ -43,7 +43,7 @@ impl Swap {
|
|||||||
monero_wallet,
|
monero_wallet,
|
||||||
env_config,
|
env_config,
|
||||||
id,
|
id,
|
||||||
receive_monero_address,
|
monero_receive_address,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,7 +54,7 @@ impl Swap {
|
|||||||
monero_wallet: Arc<monero::Wallet>,
|
monero_wallet: Arc<monero::Wallet>,
|
||||||
env_config: env::Config,
|
env_config: env::Config,
|
||||||
event_loop_handle: cli::EventLoopHandle,
|
event_loop_handle: cli::EventLoopHandle,
|
||||||
receive_monero_address: monero::Address,
|
monero_receive_address: monero::Address,
|
||||||
) -> Result<Self> {
|
) -> Result<Self> {
|
||||||
let state = db.get_state(id)?.try_into_bob()?.into();
|
let state = db.get_state(id)?.try_into_bob()?.into();
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ impl Swap {
|
|||||||
monero_wallet,
|
monero_wallet,
|
||||||
env_config,
|
env_config,
|
||||||
id,
|
id,
|
||||||
receive_monero_address,
|
monero_receive_address,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ pub async fn run_until(
|
|||||||
&mut swap.event_loop_handle,
|
&mut swap.event_loop_handle,
|
||||||
swap.bitcoin_wallet.as_ref(),
|
swap.bitcoin_wallet.as_ref(),
|
||||||
swap.monero_wallet.as_ref(),
|
swap.monero_wallet.as_ref(),
|
||||||
swap.receive_monero_address,
|
swap.monero_receive_address,
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ async fn next_state(
|
|||||||
event_loop_handle: &mut EventLoopHandle,
|
event_loop_handle: &mut EventLoopHandle,
|
||||||
bitcoin_wallet: &bitcoin::Wallet,
|
bitcoin_wallet: &bitcoin::Wallet,
|
||||||
monero_wallet: &monero::Wallet,
|
monero_wallet: &monero::Wallet,
|
||||||
receive_monero_address: monero::Address,
|
monero_receive_address: monero::Address,
|
||||||
) -> Result<BobState> {
|
) -> Result<BobState> {
|
||||||
tracing::trace!(%state, "Advancing state");
|
tracing::trace!(%state, "Advancing state");
|
||||||
|
|
||||||
@ -224,10 +224,10 @@ async fn next_state(
|
|||||||
// Ensure that the generated wallet is synced so we have a proper balance
|
// Ensure that the generated wallet is synced so we have a proper balance
|
||||||
monero_wallet.refresh().await?;
|
monero_wallet.refresh().await?;
|
||||||
// Sweep (transfer all funds) to the given address
|
// Sweep (transfer all funds) to the given address
|
||||||
let tx_hashes = monero_wallet.sweep_all(receive_monero_address).await?;
|
let tx_hashes = monero_wallet.sweep_all(monero_receive_address).await?;
|
||||||
|
|
||||||
for tx_hash in tx_hashes {
|
for tx_hash in tx_hashes {
|
||||||
tracing::info!(%receive_monero_address, txid=%tx_hash.0, "Sent XMR to");
|
tracing::info!(%monero_receive_address, txid=%tx_hash.0, "Sent XMR to");
|
||||||
}
|
}
|
||||||
|
|
||||||
BobState::XmrRedeemed {
|
BobState::XmrRedeemed {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user