Remove and fix comments

This commit is contained in:
rishflab 2020-12-14 11:56:14 +11:00
parent 6ff440d0cc
commit d8d6477ee9
2 changed files with 2 additions and 5 deletions

View File

@ -90,7 +90,7 @@ impl fmt::Display for AliceState {
AliceState::Negotiated { .. } => write!(f, "negotiated"),
AliceState::BtcLocked { .. } => write!(f, "btc_locked"),
AliceState::XmrLocked { .. } => write!(f, "xmr_locked"),
AliceState::EncSignLearned { .. } => write!(f, "encsig_learnt"),
AliceState::EncSignLearned { .. } => write!(f, "encsig_learned"),
AliceState::BtcRedeemed => write!(f, "btc_redeemed"),
AliceState::BtcCancelled { .. } => write!(f, "btc_cancelled"),
AliceState::BtcRefunded { .. } => write!(f, "btc_refunded"),
@ -219,7 +219,7 @@ pub async fn run_until(
.await
}
AliceState::XmrLocked { state3 } => {
// todo: match statement and wait for t1 can probably expressed more cleanly
// todo: match statement and wait for t1 can probably be expressed more cleanly
match state3.current_epoch(bitcoin_wallet.as_ref()).await? {
Epoch::T0 => {
let wait_for_enc_sig = wait_for_bitcoin_encrypted_signature(

View File

@ -265,7 +265,6 @@ where
BobState::Cancelled(state) => {
// Bob has cancelled the swap
match state.current_epoch(bitcoin_wallet.as_ref()).await? {
// todo: Is this an invalid state?. Should I remove the T0 match branch
Epoch::T0 => panic!("Cancelled before t1??? Something is really wrong"),
Epoch::T1 => {
state.refund_btc(bitcoin_wallet.as_ref()).await?;
@ -282,8 +281,6 @@ where
.await
}
Epoch::T2 => {
// todo: If t2 has elapsed should we check whether Alice has punished? If
// not can we still refund?
run_until(
BobState::Punished,
is_target_state,