From 170e90ffed5743a999c6feb38ef320bf488b6241 Mon Sep 17 00:00:00 2001 From: Daniel Karzel Date: Wed, 20 Jan 2021 10:37:16 +1100 Subject: [PATCH] Rename do_run_until to _run_until_internal --- swap/src/protocol/alice/swap.rs | 26 +++++++++++++------------- swap/src/protocol/bob/swap.rs | 20 ++++++++++---------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/swap/src/protocol/alice/swap.rs b/swap/src/protocol/alice/swap.rs index f6dcb3e0..2ed2eb2f 100644 --- a/swap/src/protocol/alice/swap.rs +++ b/swap/src/protocol/alice/swap.rs @@ -72,7 +72,7 @@ pub async fn run_until( swap: alice::Swap, is_target_state: fn(&AliceState) -> bool, ) -> Result { - do_run_until( + run_until_internal( swap.state, is_target_state, swap.event_loop_handle, @@ -88,7 +88,7 @@ pub async fn run_until( // State machine driver for swap execution #[async_recursion] #[allow(clippy::too_many_arguments)] -async fn do_run_until( +async fn run_until_internal( state: AliceState, is_target_state: fn(&AliceState) -> bool, mut event_loop_handle: EventLoopHandle, @@ -116,7 +116,7 @@ async fn do_run_until( let db_state = (&state).into(); db.insert_latest_state(swap_id, database::Swap::Alice(db_state)) .await?; - do_run_until( + run_until_internal( state, is_target_state, event_loop_handle, @@ -159,7 +159,7 @@ async fn do_run_until( let db_state = (&state).into(); db.insert_latest_state(swap_id, database::Swap::Alice(db_state)) .await?; - do_run_until( + run_until_internal( state, is_target_state, event_loop_handle, @@ -200,7 +200,7 @@ async fn do_run_until( let db_state = (&state).into(); db.insert_latest_state(swap_id, database::Swap::Alice(db_state)) .await?; - do_run_until( + run_until_internal( state, is_target_state, event_loop_handle, @@ -238,7 +238,7 @@ async fn do_run_until( let db_state = (&state).into(); db.insert_latest_state(swap_id, database::Swap::Alice(db_state)) .await?; - do_run_until( + run_until_internal( state, is_target_state, event_loop_handle, @@ -276,7 +276,7 @@ async fn do_run_until( let db_state = (&state).into(); db.insert_latest_state(swap_id, database::Swap::Alice(db_state)) .await?; - return do_run_until( + return run_until_internal( state, is_target_state, event_loop_handle, @@ -304,7 +304,7 @@ async fn do_run_until( let db_state = (&state).into(); db.insert_latest_state(swap_id, database::Swap::Alice(db_state)) .await?; - do_run_until( + run_until_internal( state, is_target_state, event_loop_handle, @@ -331,7 +331,7 @@ async fn do_run_until( let db_state = (&state).into(); db.insert_latest_state(swap_id, database::Swap::Alice(db_state)) .await?; - do_run_until( + run_until_internal( state, is_target_state, event_loop_handle, @@ -365,7 +365,7 @@ async fn do_run_until( db.insert_latest_state(swap_id, database::Swap::Alice(db_state)) .await?; - do_run_until( + run_until_internal( state, is_target_state, event_loop_handle, @@ -390,7 +390,7 @@ async fn do_run_until( let db_state = (&state).into(); db.insert_latest_state(swap_id, database::Swap::Alice(db_state)) .await?; - do_run_until( + run_until_internal( state, is_target_state, event_loop_handle, @@ -445,7 +445,7 @@ async fn do_run_until( let db_state = (&state).into(); db.insert_latest_state(swap_id, database::Swap::Alice(db_state)) .await?; - do_run_until( + run_until_internal( state, is_target_state, event_loop_handle, @@ -469,7 +469,7 @@ async fn do_run_until( let db_state = (&state).into(); db.insert_latest_state(swap_id, database::Swap::Alice(db_state)) .await?; - do_run_until( + run_until_internal( state, is_target_state, event_loop_handle, diff --git a/swap/src/protocol/bob/swap.rs b/swap/src/protocol/bob/swap.rs index b01a129b..02efb241 100644 --- a/swap/src/protocol/bob/swap.rs +++ b/swap/src/protocol/bob/swap.rs @@ -46,7 +46,7 @@ pub async fn run_until( swap: bob::Swap, is_target_state: fn(&BobState) -> bool, ) -> Result { - do_run_until( + run_until_internal( swap.state, is_target_state, swap.event_loop_handle, @@ -62,7 +62,7 @@ pub async fn run_until( // State machine driver for swap execution #[allow(clippy::too_many_arguments)] #[async_recursion] -async fn do_run_until( +async fn run_until_internal( state: BobState, is_target_state: fn(&BobState) -> bool, mut event_loop_handle: EventLoopHandle, @@ -95,7 +95,7 @@ where let state = BobState::Negotiated(state2); let db_state = state.clone().into(); db.insert_latest_state(swap_id, Swap::Bob(db_state)).await?; - do_run_until( + run_until_internal( state, is_target_state, event_loop_handle, @@ -116,7 +116,7 @@ where let state = BobState::BtcLocked(state3); let db_state = state.clone().into(); db.insert_latest_state(swap_id, Swap::Bob(db_state)).await?; - do_run_until( + run_until_internal( state, is_target_state, event_loop_handle, @@ -181,7 +181,7 @@ where }; let db_state = state.clone().into(); db.insert_latest_state(swap_id, Swap::Bob(db_state)).await?; - do_run_until( + run_until_internal( state, is_target_state, event_loop_handle, @@ -222,7 +222,7 @@ where }; let db_state = state.clone().into(); db.insert_latest_state(swap_id, Swap::Bob(db_state)).await?; - do_run_until( + run_until_internal( state, is_target_state, event_loop_handle, @@ -257,7 +257,7 @@ where let db_state = state.clone().into(); db.insert_latest_state(swap_id, Swap::Bob(db_state)).await?; - do_run_until( + run_until_internal( state, is_target_state, event_loop_handle, @@ -278,7 +278,7 @@ where }; let db_state = state.clone().into(); db.insert_latest_state(swap_id, Swap::Bob(db_state)).await?; - do_run_until( + run_until_internal( state, is_target_state, event_loop_handle, @@ -303,7 +303,7 @@ where db.insert_latest_state(swap_id, Swap::Bob(state.clone().into())) .await?; - do_run_until( + run_until_internal( state, is_target_state, event_loop_handle, @@ -332,7 +332,7 @@ where let db_state = state.clone().into(); db.insert_latest_state(swap_id, Swap::Bob(db_state)).await?; - do_run_until( + run_until_internal( state, is_target_state, event_loop_handle,