From ee45beafa88c2dc49db478277e4886833d40bd0d Mon Sep 17 00:00:00 2001 From: binarybaron <86064887+binarybaron@users.noreply.github.com> Date: Fri, 28 Jun 2024 17:49:08 +0200 Subject: [PATCH] Update alice_and_bob_refund_using_cancel_and_refund_command_timelock_not_expired.rs --- ...cancel_and_refund_command_timelock_not_expired.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/swap/tests/alice_and_bob_refund_using_cancel_and_refund_command_timelock_not_expired.rs b/swap/tests/alice_and_bob_refund_using_cancel_and_refund_command_timelock_not_expired.rs index 00f56b5c..a64377da 100644 --- a/swap/tests/alice_and_bob_refund_using_cancel_and_refund_command_timelock_not_expired.rs +++ b/swap/tests/alice_and_bob_refund_using_cancel_and_refund_command_timelock_not_expired.rs @@ -42,10 +42,9 @@ async fn given_alice_and_bob_manually_cancel_when_timelock_not_expired_errors() let error = cli::cancel(bob_swap.id, bob_swap.bitcoin_wallet, bob_swap.db) .await .unwrap_err(); - assert_eq!( - error.to_string(), - "Cancel timelock hasn't expired yet. Bob tried to cancel the swap too early" - ); + + assert!(error.to_string().contains("Cannot cancel swap because the cancel timelock has not expired yet")); + ctx.restart_alice().await; let alice_swap = ctx.alice_next_swap().await; @@ -72,10 +71,7 @@ async fn given_alice_and_bob_manually_cancel_when_timelock_not_expired_errors() let error = cli::refund(bob_swap.id, bob_swap.bitcoin_wallet, bob_swap.db) .await .unwrap_err(); - assert_eq!( - parse_rpc_error_code(&error).unwrap(), - i64::from(RpcErrorCode::RpcVerifyError) - ); + assert!(error.to_string().contains("Cannot refund swap because the cancel timelock has not expired yet")); let (bob_swap, _) = ctx .stop_and_resume_bob_from_db(bob_join_handle, swap_id)