Skip to content

Commit 0ed1dc1

Browse files
feat(tests): insert max_code_size for modarith zkevm test
1 parent 3734fc8 commit 0ed1dc1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/zkevm/test_worst_compute.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1350,6 +1350,7 @@ def test_worst_memory_access(
13501350
def test_worst_modarith(
13511351
state_test: StateTestFiller,
13521352
pre: Alloc,
1353+
fork: Fork,
13531354
mod_bits: int,
13541355
op: Op,
13551356
):
@@ -1368,6 +1369,8 @@ def test_worst_modarith(
13681369
fixed_arg = 2**256 - 1
13691370
num_args = 15
13701371

1372+
max_code_size = fork.max_code_size()
1373+
13711374
# Pick the modulus min value so that it is _unlikely_ to drop to the lower word count.
13721375
assert mod_bits >= 63
13731376
mod_min = 2 ** (mod_bits - 63)
@@ -1428,7 +1431,7 @@ def test_worst_modarith(
14281431
# Construct the final code. Because of the usage of PUSH32 the code segment is very long,
14291432
# so don't try to include multiple of these.
14301433
code = code_constant_pool + Op.JUMPDEST + code_segment + Op.JUMP(len(code_constant_pool))
1431-
assert (MAX_CODE_SIZE - len(code_segment)) < len(code) <= MAX_CODE_SIZE
1434+
assert (max_code_size - len(code_segment)) < len(code) <= max_code_size
14321435

14331436
env = Environment()
14341437

0 commit comments

Comments
 (0)