From 7f80851c4cac93cde3252c2462bfd70892518adb Mon Sep 17 00:00:00 2001 From: patrini32 Date: Fri, 28 Jun 2024 16:59:26 +0000 Subject: [PATCH] Fix test --- ...e_manually_punishes_after_bob_dead_and_bob_cancels.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/swap/tests/alice_manually_punishes_after_bob_dead_and_bob_cancels.rs b/swap/tests/alice_manually_punishes_after_bob_dead_and_bob_cancels.rs index 131f04f1..fe412f76 100644 --- a/swap/tests/alice_manually_punishes_after_bob_dead_and_bob_cancels.rs +++ b/swap/tests/alice_manually_punishes_after_bob_dead_and_bob_cancels.rs @@ -85,8 +85,13 @@ async fn alice_manually_punishes_after_bob_dead_and_bob_cancels() { .await; assert!(matches!(bob_swap.state, BobState::BtcCancelled { .. })); // Alice punished Bob, so he should be in the BtcPunished state. - let state = cli::refund(bob_swap_id, bob_swap.bitcoin_wallet, bob_swap.db).await?; - ctx.assert_bob_punished(state).await; + let error = cli::refund(bob_swap_id, bob_swap.bitcoin_wallet, bob_swap.db) + .await + .unwrap_err(); + assert_eq!( + &error, + "Cannot refund swap because we have already been punished" + ); Ok(()) }) .await;