Skip to content

Commit

Permalink
Add address to NoToken and NoGas status properties
Browse files Browse the repository at this point in the history
  • Loading branch information
kamirr committed Nov 7, 2023
1 parent 484ccd2 commit f355998
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions crates/erc20_payment_lib/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,12 @@ pub enum StatusProperty {
},
NoGas {
chain_id: i64,
address: String,
missing_gas: Decimal,
},
NoToken {
chain_id: i64,
address: String,
missing_token: Decimal,
},
}
Expand Down Expand Up @@ -235,27 +237,31 @@ impl StatusTracker {
(
NoGas {
chain_id: id1,
address: addr1,
missing_gas: old_missing,
},
NoGas {
chain_id: id2,
address: addr2,
missing_gas: new_missing,
},
) if id1 == id2 => {
) if id1 == id2 && addr1 == addr2 => {
*old_missing = *new_missing;
return true;
}
// NoToken statuses add up
(
NoToken {
chain_id: id1,
address: addr1,
missing_token: old_missing,
},
NoToken {
chain_id: id2,
address: addr2,
missing_token: new_missing,
},
) if id1 == id2 => {
) if id1 == id2 && addr1 == addr2 => {
*old_missing = *new_missing;
return true;
}
Expand Down Expand Up @@ -315,6 +321,7 @@ impl StatusTracker {
status2.lock().await.deref_mut(),
StatusProperty::NoGas {
chain_id: details.tx.chain_id,
address: details.tx.from_addr.clone(),
missing_gas,
},
)
Expand All @@ -327,6 +334,7 @@ impl StatusTracker {
status2.lock().await.deref_mut(),
StatusProperty::NoToken {
chain_id: details.tx.chain_id,
address: details.tx.from_addr.clone(),
missing_token,
},
)
Expand Down

0 comments on commit f355998

Please sign in to comment.