mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-11-26 02:36:20 -05:00
Rename ExecutionParams to EnvironmentConfig
This commit is contained in:
parent
bc43ed6ebd
commit
09c41f89c4
14 changed files with 132 additions and 136 deletions
|
|
@ -1,6 +1,6 @@
|
|||
use crate::bitcoin::ExpiredTimelocks;
|
||||
use crate::database::{Database, Swap};
|
||||
use crate::execution_params::ExecutionParams;
|
||||
use crate::env::Config;
|
||||
use crate::monero::InsufficientFunds;
|
||||
use crate::protocol::bob;
|
||||
use crate::protocol::bob::event_loop::EventLoopHandle;
|
||||
|
|
@ -41,7 +41,7 @@ pub async fn run_until(
|
|||
swap.bitcoin_wallet,
|
||||
swap.monero_wallet,
|
||||
swap.swap_id,
|
||||
swap.exec_params,
|
||||
swap.env_config,
|
||||
swap.receive_monero_address,
|
||||
)
|
||||
.await
|
||||
|
|
@ -58,7 +58,7 @@ async fn run_until_internal(
|
|||
bitcoin_wallet: Arc<bitcoin::Wallet>,
|
||||
monero_wallet: Arc<monero::Wallet>,
|
||||
swap_id: Uuid,
|
||||
exec_params: ExecutionParams,
|
||||
env_config: Config,
|
||||
receive_monero_address: monero::Address,
|
||||
) -> Result<BobState> {
|
||||
trace!("Current state: {}", state);
|
||||
|
|
@ -74,7 +74,7 @@ async fn run_until_internal(
|
|||
let state2 = request_price_and_setup(
|
||||
btc_amount,
|
||||
&mut event_loop_handle,
|
||||
exec_params,
|
||||
env_config,
|
||||
bitcoin_refund_address,
|
||||
)
|
||||
.await?;
|
||||
|
|
@ -90,7 +90,7 @@ async fn run_until_internal(
|
|||
bitcoin_wallet,
|
||||
monero_wallet,
|
||||
swap_id,
|
||||
exec_params,
|
||||
env_config,
|
||||
receive_monero_address,
|
||||
)
|
||||
.await
|
||||
|
|
@ -121,7 +121,7 @@ async fn run_until_internal(
|
|||
bitcoin_wallet,
|
||||
monero_wallet,
|
||||
swap_id,
|
||||
exec_params,
|
||||
env_config,
|
||||
receive_monero_address,
|
||||
)
|
||||
.await
|
||||
|
|
@ -177,7 +177,7 @@ async fn run_until_internal(
|
|||
bitcoin_wallet,
|
||||
monero_wallet,
|
||||
swap_id,
|
||||
exec_params,
|
||||
env_config,
|
||||
receive_monero_address,
|
||||
)
|
||||
.await
|
||||
|
|
@ -232,7 +232,7 @@ async fn run_until_internal(
|
|||
bitcoin_wallet,
|
||||
monero_wallet,
|
||||
swap_id,
|
||||
exec_params,
|
||||
env_config,
|
||||
receive_monero_address,
|
||||
)
|
||||
.await
|
||||
|
|
@ -275,7 +275,7 @@ async fn run_until_internal(
|
|||
bitcoin_wallet,
|
||||
monero_wallet,
|
||||
swap_id,
|
||||
exec_params,
|
||||
env_config,
|
||||
receive_monero_address,
|
||||
)
|
||||
.await
|
||||
|
|
@ -311,7 +311,7 @@ async fn run_until_internal(
|
|||
bitcoin_wallet.clone(),
|
||||
monero_wallet,
|
||||
swap_id,
|
||||
exec_params,
|
||||
env_config,
|
||||
receive_monero_address,
|
||||
)
|
||||
.await
|
||||
|
|
@ -342,7 +342,7 @@ async fn run_until_internal(
|
|||
bitcoin_wallet,
|
||||
monero_wallet,
|
||||
swap_id,
|
||||
exec_params,
|
||||
env_config,
|
||||
receive_monero_address,
|
||||
)
|
||||
.await
|
||||
|
|
@ -368,7 +368,7 @@ async fn run_until_internal(
|
|||
bitcoin_wallet,
|
||||
monero_wallet,
|
||||
swap_id,
|
||||
exec_params,
|
||||
env_config,
|
||||
receive_monero_address,
|
||||
)
|
||||
.await
|
||||
|
|
@ -398,7 +398,7 @@ async fn run_until_internal(
|
|||
bitcoin_wallet,
|
||||
monero_wallet,
|
||||
swap_id,
|
||||
exec_params,
|
||||
env_config,
|
||||
receive_monero_address,
|
||||
)
|
||||
.await
|
||||
|
|
@ -414,7 +414,7 @@ async fn run_until_internal(
|
|||
pub async fn request_price_and_setup(
|
||||
btc: bitcoin::Amount,
|
||||
event_loop_handle: &mut EventLoopHandle,
|
||||
exec_params: ExecutionParams,
|
||||
env_config: Config,
|
||||
bitcoin_refund_address: bitcoin::Address,
|
||||
) -> Result<bob::state::State2> {
|
||||
let xmr = event_loop_handle.request_spot_price(btc).await?;
|
||||
|
|
@ -425,10 +425,10 @@ pub async fn request_price_and_setup(
|
|||
&mut OsRng,
|
||||
btc,
|
||||
xmr,
|
||||
exec_params.bitcoin_cancel_timelock,
|
||||
exec_params.bitcoin_punish_timelock,
|
||||
env_config.bitcoin_cancel_timelock,
|
||||
env_config.bitcoin_punish_timelock,
|
||||
bitcoin_refund_address,
|
||||
exec_params.monero_finality_confirmations,
|
||||
env_config.monero_finality_confirmations,
|
||||
);
|
||||
|
||||
let state2 = event_loop_handle.execution_setup(state0).await?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue