Skip to content

Commit 676d87f

Browse files
feat(tests): make typecheck happy
1 parent 8980cf7 commit 676d87f

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
@@ -466,7 +466,7 @@ def test_worst_precompile_only_data_input(
466466

467467
calldata = Op.CODECOPY(0, 0, optimal_input_length)
468468
attack_block = Op.POP(Op.STATICCALL(Op.GAS, address, 0, optimal_input_length, 0, 0))
469-
code = code_loop_precompile_call(calldata, attack_block)
469+
code = code_loop_precompile_call(calldata, attack_block, fork)
470470

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

@@ -485,10 +485,7 @@ def test_worst_precompile_only_data_input(
485485

486486

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

@@ -514,7 +511,7 @@ def test_worst_modexp(
514511
iter_complexity = exp.bit_length() - 1
515512
gas_cost = math.floor((mul_complexity * iter_complexity) / 3)
516513
attack_block = Op.POP(Op.STATICCALL(gas_cost, 0x5, 0, 32 * 6, 0, 0))
517-
code = code_loop_precompile_call(calldata, attack_block)
514+
code = code_loop_precompile_call(calldata, attack_block, fork)
518515

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

@@ -681,6 +678,7 @@ def test_worst_modexp(
681678
def test_worst_precompile_fixed_cost(
682679
state_test: StateTestFiller,
683680
pre: Alloc,
681+
fork: Fork,
684682
precompile_address: Address,
685683
parameters: list[str] | list[BytesConcatenation] | list[bytes],
686684
):
@@ -715,7 +713,7 @@ def test_worst_precompile_fixed_cost(
715713
attack_block = Op.POP(
716714
Op.STATICCALL(Op.GAS, precompile_address, 0, len(concatenated_bytes), 0, 0)
717715
)
718-
code = code_loop_precompile_call(calldata, attack_block)
716+
code = code_loop_precompile_call(calldata, attack_block, fork)
719717
code_address = pre.deploy_contract(code=bytes(code))
720718

721719
tx = Transaction(
@@ -1507,7 +1505,7 @@ def test_amortized_bn128_pairings(
15071505

15081506
calldata = Op.CALLDATACOPY(size=Op.CALLDATASIZE)
15091507
attack_block = Op.POP(Op.STATICCALL(Op.GAS, 0x08, 0, Op.CALLDATASIZE, 0, 0))
1510-
code = code_loop_precompile_call(calldata, attack_block)
1508+
code = code_loop_precompile_call(calldata, attack_block, fork)
15111509

15121510
code_address = pre.deploy_contract(code=code)
15131511

0 commit comments

Comments
 (0)