Skip to content

Commit

Permalink
log confirmation by adding status.append(" Confirmed.")
Browse files Browse the repository at this point in the history
  • Loading branch information
shamardy committed Mar 21, 2023
1 parent 020ff25 commit e441ffa
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions mm2src/coins/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1734,8 +1734,8 @@ impl MarketCoinOps for EthCoin {
}

fn wait_for_confirmations(&self, input: ConfirmPaymentInput) -> Box<dyn Future<Item = (), Error = String> + Send> {
macro_rules! update_status {
($error: ident, $status: ident) => {
macro_rules! update_status_with_error {
($status: ident, $error: ident) => {
match $error.get_inner() {
Web3RpcError::Timeout(_) => $status.append(" Timed out."),
_ => $status.append(" Failed."),
Expand Down Expand Up @@ -1765,7 +1765,7 @@ impl MarketCoinOps for EthCoin {
{
Ok(c) => c,
Err(e) => {
update_status!(e, status);
update_status_with_error!(status, e);
return Err(e.to_string());
},
};
Expand All @@ -1777,7 +1777,7 @@ impl MarketCoinOps for EthCoin {
.compat()
.await
{
update_status!(e, status);
update_status_with_error!(status, e);
return Err(e.to_string());
}

Expand All @@ -1789,11 +1789,12 @@ impl MarketCoinOps for EthCoin {
{
Ok(conf) => {
if conf == confirmed_at {
status.append(" Confirmed.");
break Ok(());
}
},
Err(e) => {
update_status!(e, status);
update_status_with_error!(status, e);
return Err(e.to_string());
},
}
Expand Down

0 comments on commit e441ffa

Please sign in to comment.