Skip to content

Commit 347dec7

Browse files
feat(tests): make typecheck happy
1 parent 4f83efe commit 347dec7

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

tests/zkevm/test_worst_compute.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ def test_worst_precompile_only_data_input(
465465

466466
calldata = Op.CODECOPY(0, 0, optimal_input_length)
467467
attack_block = Op.POP(Op.STATICCALL(Op.GAS, address, 0, optimal_input_length, 0, 0))
468-
code = code_loop_precompile_call(calldata, attack_block)
468+
code = code_loop_precompile_call(calldata, attack_block, fork)
469469

470470
code_address = pre.deploy_contract(code=code)
471471

@@ -484,10 +484,7 @@ def test_worst_precompile_only_data_input(
484484

485485

486486
@pytest.mark.valid_from("Cancun")
487-
def test_worst_modexp(
488-
state_test: StateTestFiller,
489-
pre: Alloc,
490-
):
487+
def test_worst_modexp(state_test: StateTestFiller, pre: Alloc, fork: Fork):
491488
"""Test running a block with as many MODEXP calls as possible."""
492489
env = Environment()
493490

@@ -513,7 +510,7 @@ def test_worst_modexp(
513510
iter_complexity = exp.bit_length() - 1
514511
gas_cost = math.floor((mul_complexity * iter_complexity) / 3)
515512
attack_block = Op.POP(Op.STATICCALL(gas_cost, 0x5, 0, 32 * 6, 0, 0))
516-
code = code_loop_precompile_call(calldata, attack_block)
513+
code = code_loop_precompile_call(calldata, attack_block, fork)
517514

518515
code_address = pre.deploy_contract(code=code)
519516

@@ -680,6 +677,7 @@ def test_worst_modexp(
680677
def test_worst_precompile_fixed_cost(
681678
state_test: StateTestFiller,
682679
pre: Alloc,
680+
fork: Fork,
683681
precompile_address: Address,
684682
parameters: list[str] | list[BytesConcatenation] | list[bytes],
685683
):
@@ -714,7 +712,7 @@ def test_worst_precompile_fixed_cost(
714712
attack_block = Op.POP(
715713
Op.STATICCALL(Op.GAS, precompile_address, 0, len(concatenated_bytes), 0, 0)
716714
)
717-
code = code_loop_precompile_call(calldata, attack_block)
715+
code = code_loop_precompile_call(calldata, attack_block, fork)
718716
code_address = pre.deploy_contract(code=bytes(code))
719717

720718
tx = Transaction(
@@ -1383,7 +1381,7 @@ def test_amortized_bn128_pairings(
13831381

13841382
calldata = Op.CALLDATACOPY(size=Op.CALLDATASIZE)
13851383
attack_block = Op.POP(Op.STATICCALL(Op.GAS, 0x08, 0, Op.CALLDATASIZE, 0, 0))
1386-
code = code_loop_precompile_call(calldata, attack_block)
1384+
code = code_loop_precompile_call(calldata, attack_block, fork)
13871385

13881386
code_address = pre.deploy_contract(code=code)
13891387

0 commit comments

Comments
 (0)