Skip to content

Commit

Permalink
treat CallGasCostMoreThanGasLimit as error
Browse files Browse the repository at this point in the history
  • Loading branch information
oXtxNt9U committed Dec 20, 2024
1 parent 8215582 commit 3500a24
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class EvmCallTransactionHandler extends Handlers.TransactionHandler {

return receipt;
} catch (error) {
return this.app.terminate("invalid EVM call", error);
throw new Error(`invalid EVM call: ${error.message}`);
}
}

Expand Down
9 changes: 2 additions & 7 deletions packages/evm/bindings/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,13 +424,8 @@ impl EvmInner {
match err {
EVMError::Transaction(err) => {
match err {
revm::primitives::InvalidTransaction::CallGasCostMoreThanGasLimit => {
return Ok(TxReceipt {
gas_used: gas_limit,
..Default::default()
});
}
revm::primitives::InvalidTransaction::NonceTooHigh { .. }
revm::primitives::InvalidTransaction::CallGasCostMoreThanGasLimit
| revm::primitives::InvalidTransaction::NonceTooHigh { .. }
| revm::primitives::InvalidTransaction::NonceTooLow { .. } => {
return Err(EVMError::Transaction(err));
}
Expand Down

0 comments on commit 3500a24

Please sign in to comment.