Skip to content

Commit f0725b4

Browse files
feat(fill, execute): track execution & setup testing phase (ethereum#2157)
* feat: implement phase manager * feat(tests): add testPhase attribute to transaction test cases * fix: update transaction phase handling * fix failing test
1 parent cdd45ac commit f0725b4

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

benchmark/test_worst_stateful_opcodes.py

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
compute_create2_address,
2525
compute_create_address,
2626
)
27+
from ethereum_test_types import TestPhaseManager
2728
from ethereum_test_vm import Opcodes as Op
2829

2930
REFERENCE_SPEC_GIT_PATH = "TODO"
@@ -405,23 +406,26 @@ def test_worst_storage_access_warm(
405406
)
406407
+ Op.RETURN(0, Op.MSIZE)
407408
)
408-
sender_addr = pre.fund_eoa()
409-
setup_tx = Transaction(
410-
to=None,
411-
gas_limit=env.gas_limit,
412-
data=creation_code,
413-
sender=sender_addr,
414-
)
415-
blocks.append(Block(txs=[setup_tx]))
409+
410+
with TestPhaseManager.setup():
411+
sender_addr = pre.fund_eoa()
412+
setup_tx = Transaction(
413+
to=None,
414+
gas_limit=env.gas_limit,
415+
data=creation_code,
416+
sender=sender_addr,
417+
)
418+
blocks.append(Block(txs=[setup_tx]))
416419

417420
contract_address = compute_create_address(address=sender_addr, nonce=0)
418421

419-
op_tx = Transaction(
420-
to=contract_address,
421-
gas_limit=gas_benchmark_value,
422-
sender=pre.fund_eoa(),
423-
)
424-
blocks.append(Block(txs=[op_tx]))
422+
with TestPhaseManager.execution():
423+
op_tx = Transaction(
424+
to=contract_address,
425+
gas_limit=gas_benchmark_value,
426+
sender=pre.fund_eoa(),
427+
)
428+
blocks.append(Block(txs=[op_tx]))
425429

426430
benchmark_test(blocks=blocks)
427431

0 commit comments

Comments
 (0)