Skip to content

Commit

Permalink
style(anvil): use revm return macros in match arms (#2061)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Jun 21, 2022
1 parent f1c04c2 commit 935c113
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions anvil/src/eth/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1571,14 +1571,14 @@ impl EthApi {
let (exit, _, gas, _) =
self.backend.call(call_to_estimate, fees.clone(), block_number).await?;
match exit {
Return::Return | Return::Continue | Return::SelfDestruct | Return::Stop => {
return_ok!() => {
// succeeded
}
Return::OutOfGas | Return::LackOfFundForGasLimit | Return::OutOfFund => {
return Err(InvalidTransactionError::OutOfGas(gas_limit).into())
}
// need to check if the revert was due to lack of gas or unrelated reason
Return::Revert => {
return_revert!() => {
// if price or limit was included in the request then we can execute the request
// again with the max gas limit to check if revert is gas related or not
return if request.gas.is_some() || request.gas_price.is_some() {
Expand Down

0 comments on commit 935c113

Please sign in to comment.