Skip to content

Commit

Permalink
Merge branch 'main' into scx1332/mint
Browse files Browse the repository at this point in the history
  • Loading branch information
scx1332 authored Nov 7, 2023
2 parents 928405f + 1f5441d commit e3f072d
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 @@ -193,10 +193,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 @@ -237,27 +239,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 @@ -317,6 +323,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 @@ -329,6 +336,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 e3f072d

Please sign in to comment.