mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-07-15 11:09:52 -04:00
Throw appealing error in case that cancel timelock hasnt expired yet
This commit is contained in:
parent
b80cc820f7
commit
3beb41c25c
2 changed files with 2 additions and 5 deletions
|
@ -75,7 +75,7 @@ pub async fn cancel(
|
|||
if let ExpiredTimelocks::None { .. } =
|
||||
state6.expired_timelock(bitcoin_wallet.as_ref()).await?
|
||||
{
|
||||
tracing::info!("Cancel timelock hasn't expired yet.");
|
||||
bail!("Cancel timelock hasn't expired yet");
|
||||
}
|
||||
if let Ok(error_code) = parse_rpc_error_code(&err) {
|
||||
tracing::debug!(%error_code, "parse rpc error");
|
||||
|
|
|
@ -42,10 +42,7 @@ 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!(
|
||||
parse_rpc_error_code(&error).unwrap(),
|
||||
i64::from(RpcErrorCode::RpcVerifyRejected)
|
||||
);
|
||||
assert_eq!(error.to_string(), "Cancel timelock hasn't expired yet");
|
||||
|
||||
ctx.restart_alice().await;
|
||||
let alice_swap = ctx.alice_next_swap().await;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue