mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2024-09-28 20:35:51 +00:00
work in review comments
This commit is contained in:
parent
c930ad84a4
commit
86290649e7
@ -29,7 +29,7 @@ use protocol::{alice, bob, bob::Builder, SwapAmounts};
|
|||||||
use std::{path::PathBuf, sync::Arc};
|
use std::{path::PathBuf, sync::Arc};
|
||||||
use structopt::StructOpt;
|
use structopt::StructOpt;
|
||||||
use trace::init_tracing;
|
use trace::init_tracing;
|
||||||
use tracing::info;
|
use tracing::{error, info, warn};
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
|
|
||||||
pub mod bitcoin;
|
pub mod bitcoin;
|
||||||
@ -247,11 +247,12 @@ async fn main() -> Result<()> {
|
|||||||
Ok((txid, _)) => {
|
Ok((txid, _)) => {
|
||||||
info!("Cancel transaction successfully published with id {}", txid)
|
info!("Cancel transaction successfully published with id {}", txid)
|
||||||
}
|
}
|
||||||
Err(CancelError::CancelTimelockNotExpiredYet) => {
|
Err(CancelError::CancelTimelockNotExpiredYet) => error!(
|
||||||
info!("The Cancel Transaction cannot be published yet, because the timelock has not expired. Please try again later.")
|
"The Cancel Transaction cannot be published yet, \
|
||||||
}
|
because the timelock has not expired. Please try again later."
|
||||||
|
),
|
||||||
Err(CancelError::CancelTxAlreadyPublished) => {
|
Err(CancelError::CancelTxAlreadyPublished) => {
|
||||||
info!("The Cancel Transaction has already been published.")
|
warn!("The Cancel Transaction has already been published.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ async fn given_bob_manually_cancels_when_timelock_not_expired_errors() {
|
|||||||
let (bob_swap, bob_join_handle) = ctx.stop_and_resume_bob_from_db(bob_join_handle).await;
|
let (bob_swap, bob_join_handle) = ctx.stop_and_resume_bob_from_db(bob_join_handle).await;
|
||||||
assert!(matches!(bob_swap.state, BobState::BtcLocked { .. }));
|
assert!(matches!(bob_swap.state, BobState::BtcLocked { .. }));
|
||||||
|
|
||||||
// Bob manually cancels
|
// Bob tries but fails to manually cancel
|
||||||
let result = bob::cancel(
|
let result = bob::cancel(
|
||||||
bob_swap.swap_id,
|
bob_swap.swap_id,
|
||||||
bob_swap.state,
|
bob_swap.state,
|
||||||
@ -37,7 +37,7 @@ async fn given_bob_manually_cancels_when_timelock_not_expired_errors() {
|
|||||||
let (bob_swap, bob_join_handle) = ctx.stop_and_resume_bob_from_db(bob_join_handle).await;
|
let (bob_swap, bob_join_handle) = ctx.stop_and_resume_bob_from_db(bob_join_handle).await;
|
||||||
assert!(matches!(bob_swap.state, BobState::BtcLocked { .. }));
|
assert!(matches!(bob_swap.state, BobState::BtcLocked { .. }));
|
||||||
|
|
||||||
// Bob manually refunds
|
// Bob tries but fails to manually refund
|
||||||
bob::refund(
|
bob::refund(
|
||||||
bob_swap.swap_id,
|
bob_swap.swap_id,
|
||||||
bob_swap.state,
|
bob_swap.state,
|
||||||
|
Loading…
Reference in New Issue
Block a user