From d9ea7ab60566b8e9c2f60c398e1085b25c71d1d6 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Fri, 18 Dec 2020 13:50:54 +1100 Subject: [PATCH] Only carry the tx_lock_id instead of the full state --- swap/tests/refund_restart_alice.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/swap/tests/refund_restart_alice.rs b/swap/tests/refund_restart_alice.rs index 3044c20e..abe9266e 100644 --- a/swap/tests/refund_restart_alice.rs +++ b/swap/tests/refund_restart_alice.rs @@ -108,8 +108,8 @@ async fn given_alice_restarts_after_xmr_is_locked_abort_swap() { _ = alice_event_loop_1.run() => panic!("The event loop should never finish") }; - let bob_state4 = if let BobState::BtcRefunded(state4) = bob_state { - state4 + let tx_lock_id = if let BobState::BtcRefunded(state4) = bob_state { + state4.tx_lock_id() } else { panic!("Bob in unexpected state"); }; @@ -138,10 +138,7 @@ async fn given_alice_restarts_after_xmr_is_locked_abort_swap() { let btc_alice_final = alice_btc_wallet.as_ref().balance().await.unwrap(); let btc_bob_final = bob_btc_wallet.as_ref().balance().await.unwrap(); - let lock_tx_bitcoin_fee = bob_btc_wallet - .transaction_fee(bob_state4.tx_lock_id()) - .await - .unwrap(); + let lock_tx_bitcoin_fee = bob_btc_wallet.transaction_fee(tx_lock_id).await.unwrap(); assert_eq!(btc_alice_final, alice_btc_starting_balance);