diff --git a/swap/src/protocol/alice/swap.rs b/swap/src/protocol/alice/swap.rs index 7e1b8e20..6f97f2c0 100644 --- a/swap/src/protocol/alice/swap.rs +++ b/swap/src/protocol/alice/swap.rs @@ -2,9 +2,8 @@ //! Alice holds XMR and wishes receive BTC. use crate::bitcoin::ExpiredTimelocks; use crate::env::Config; -use crate::protocol::alice; use crate::protocol::alice::event_loop::EventLoopHandle; -use crate::protocol::alice::AliceState; +use crate::protocol::alice::{AliceState, Swap}; use crate::{bitcoin, database, monero}; use anyhow::{bail, Context, Result}; use tokio::select; @@ -12,15 +11,12 @@ use tokio::time::timeout; use tracing::{error, info}; use uuid::Uuid; -pub async fn run(swap: alice::Swap) -> Result { +pub async fn run(swap: Swap) -> Result { run_until(swap, |_| false).await } #[tracing::instrument(name = "swap", skip(swap,exit_early), fields(id = %swap.swap_id), err)] -pub async fn run_until( - mut swap: alice::Swap, - exit_early: fn(&AliceState) -> bool, -) -> Result { +pub async fn run_until(mut swap: Swap, exit_early: fn(&AliceState) -> bool) -> Result { let mut current_state = swap.state; while !is_complete(¤t_state) && !exit_early(¤t_state) {