Skip to content

Commit d5e6317

Browse files
feat(tests): make typecheck happy
1 parent 24f8463 commit d5e6317

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
@@ -196,7 +196,7 @@ def test_worst_precompile_only_data_input(
196196

197197
calldata = Op.CODECOPY(0, 0, optimal_input_length)
198198
attack_block = Op.POP(Op.STATICCALL(Op.GAS, address, 0, optimal_input_length, 0, 0))
199-
code = code_loop_precompile_call(calldata, attack_block)
199+
code = code_loop_precompile_call(calldata, attack_block, fork)
200200

201201
code_address = pre.deploy_contract(code=code)
202202

@@ -215,10 +215,7 @@ def test_worst_precompile_only_data_input(
215215

216216

217217
@pytest.mark.valid_from("Cancun")
218-
def test_worst_modexp(
219-
state_test: StateTestFiller,
220-
pre: Alloc,
221-
):
218+
def test_worst_modexp(state_test: StateTestFiller, pre: Alloc, fork: Fork):
222219
"""Test running a block with as many MODEXP calls as possible."""
223220
env = Environment()
224221

@@ -244,7 +241,7 @@ def test_worst_modexp(
244241
iter_complexity = exp.bit_length() - 1
245242
gas_cost = math.floor((mul_complexity * iter_complexity) / 3)
246243
attack_block = Op.POP(Op.STATICCALL(gas_cost, 0x5, 0, 32 * 6, 0, 0))
247-
code = code_loop_precompile_call(calldata, attack_block)
244+
code = code_loop_precompile_call(calldata, attack_block, fork)
248245

249246
code_address = pre.deploy_contract(code=code)
250247

@@ -411,6 +408,7 @@ def test_worst_modexp(
411408
def test_worst_precompile_fixed_cost(
412409
state_test: StateTestFiller,
413410
pre: Alloc,
411+
fork: Fork,
414412
precompile_address: Address,
415413
parameters: list[str] | list[BytesConcatenation] | list[bytes],
416414
):
@@ -445,7 +443,7 @@ def test_worst_precompile_fixed_cost(
445443
attack_block = Op.POP(
446444
Op.STATICCALL(Op.GAS, precompile_address, 0, len(concatenated_bytes), 0, 0)
447445
)
448-
code = code_loop_precompile_call(calldata, attack_block)
446+
code = code_loop_precompile_call(calldata, attack_block, fork)
449447
code_address = pre.deploy_contract(code=bytes(code))
450448

451449
tx = Transaction(
@@ -1114,7 +1112,7 @@ def test_amortized_bn128_pairings(
11141112

11151113
calldata = Op.CALLDATACOPY(size=Op.CALLDATASIZE)
11161114
attack_block = Op.POP(Op.STATICCALL(Op.GAS, 0x08, 0, Op.CALLDATASIZE, 0, 0))
1117-
code = code_loop_precompile_call(calldata, attack_block)
1115+
code = code_loop_precompile_call(calldata, attack_block, fork)
11181116

11191117
code_address = pre.deploy_contract(code=code)
11201118

0 commit comments

Comments
 (0)