Skip to content

Commit

Permalink
generate small enough gas to fit EVM stipend
Browse files Browse the repository at this point in the history
  • Loading branch information
joonazan committed Jun 10, 2024
1 parent f01ee0e commit 0da56df
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/single_instruction_test/callframe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use crate::{
};
use arbitrary::Arbitrary;
use u256::H160;
use zkevm_opcode_defs::EVM_SIMULATOR_STIPEND;

impl<'a> Arbitrary<'a> for Flags {
fn arbitrary(u: &mut arbitrary::Unstructured<'a>) -> arbitrary::Result<Self> {
Expand All @@ -28,7 +29,8 @@ impl<'a> Arbitrary<'a> for Callframe {
is_kernel: is_kernel(address),
stack: u.arbitrary()?,
sp: u.arbitrary()?,
gas: u.arbitrary()?,
// It is assumed that it is always possible to add the stipend
gas: u.int_in_range(0..=u32::MAX - EVM_SIMULATOR_STIPEND)?,
stipend: u.arbitrary()?,
near_calls: vec![],
program: u.arbitrary()?,
Expand Down

0 comments on commit 0da56df

Please sign in to comment.