Skip to content

Commit

Permalink
set storage oog for try_consume check case
Browse files Browse the repository at this point in the history
  • Loading branch information
librelois committed Sep 16, 2024
1 parent d3e3ec3 commit 09d0188
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions primitives/evm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ impl WeightInfo {
fn try_consume(&self, cost: u64, limit: u64, usage: u64) -> Result<u64, ExitError> {
let usage = usage.checked_add(cost).ok_or(ExitError::OutOfGas)?;
if usage > limit {
storage_oog::set_storage_oog();
return Err(ExitError::OutOfGas);
}
Ok(usage)
Expand Down

0 comments on commit 09d0188

Please sign in to comment.