From 627b1a9f009e1b4c66df1ba2dbb8e44676349e11 Mon Sep 17 00:00:00 2001 From: rishflab Date: Mon, 7 Dec 2020 14:03:50 +1100 Subject: [PATCH] Remove unnecessary execution restart --- swap/tests/e2e.rs | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/swap/tests/e2e.rs b/swap/tests/e2e.rs index d60ceb80..e8260f95 100644 --- a/swap/tests/e2e.rs +++ b/swap/tests/e2e.rs @@ -161,32 +161,18 @@ async fn alice_punishes_if_bob_never_acts_after_fund() { Uuid::new_v4(), ); - let alice_xmr_locked_fut = alice::swap::run_until( + let alice_fut = alice::swap::swap( alice_state, - alice::swap::is_xmr_locked, alice_swarm, alice_btc_wallet.clone(), alice_xmr_wallet.clone(), Config::regtest(), ); - // Wait until alice has locked xmr and bob has locked btc - let ((alice_state, alice_swarm), _bob_state) = - try_join(alice_xmr_locked_fut, bob_xmr_locked_fut) - .await - .unwrap(); + // Wait until alice has locked xmr and bob h as locked btc + let ((alice_state, _), _bob_state) = try_join(alice_fut, bob_xmr_locked_fut).await.unwrap(); - let (punished, _) = alice::swap::swap( - alice_state, - alice_swarm, - alice_btc_wallet.clone(), - alice_xmr_wallet.clone(), - Config::regtest(), - ) - .await - .unwrap(); - - assert!(matches!(punished, AliceState::Punished)); + assert!(matches!(alice_state, AliceState::Punished)); // todo: Add balance assertions }