Skip to content

Commit 9333b0d

Browse files
committed
improvements
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
1 parent e877c7b commit 9333b0d

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

tests/zkevm/test_worst_stateful_opcodes.py

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -493,15 +493,8 @@ def test_worst_selfdestruct_existing(
493493
env = Environment(gas_limit=100_000_000_000)
494494
attack_gas_limit = Environment().gas_limit
495495

496-
# Create an account that will be used as the beneficiary of the SELFDESTRUCT calls, to avoid
497-
# account creation costs. All SELFDESTRUCT calls will target the same account to avoid
498-
# cold costs.
499-
selfdestruct_beneficiary = pre.fund_eoa()
500-
501496
# Template code that will be used to deploy a large number of contracts.
502-
selfdestructable_contract_addr = pre.deploy_contract(
503-
code=Op.SELFDESTRUCT(selfdestruct_beneficiary)
504-
)
497+
selfdestructable_contract_addr = pre.deploy_contract(code=Op.SELFDESTRUCT(Op.COINBASE))
505498
initcode = Op.EXTCODECOPY(
506499
address=selfdestructable_contract_addr,
507500
dest_offset=0,
@@ -629,15 +622,8 @@ def test_worst_selfdestruct_created(
629622
"""
630623
env = Environment()
631624

632-
# Create an account that will be used as the beneficiary of the SELFDESTRUCT calls, to avoid
633-
# account creation costs. All SELFDESTRUCT calls will target the same account to avoid
634-
# cold costs.
635-
selfdestruct_beneficiary = pre.fund_eoa()
636-
637625
# Template code that will be used to deploy a large number of contracts.
638-
selfdestructable_contract_addr = pre.deploy_contract(
639-
code=Op.SELFDESTRUCT(selfdestruct_beneficiary)
640-
)
626+
selfdestructable_contract_addr = pre.deploy_contract(code=Op.SELFDESTRUCT(Op.COINBASE))
641627
initcode = Op.EXTCODECOPY(
642628
address=selfdestructable_contract_addr,
643629
dest_offset=0,
@@ -665,7 +651,7 @@ def test_worst_selfdestruct_created(
665651
),
666652
# Stop before we run out of gas for the whole tx execution.
667653
# The value was found by trial-error rounded to the next 1000 multiple.
668-
condition=Op.GT(Op.GAS, 33_000),
654+
condition=Op.GT(Op.GAS, 42_000),
669655
)
670656
+ Op.SSTORE(0, 42) # Done for successful tx execution assertion below.
671657
)
@@ -679,7 +665,6 @@ def test_worst_selfdestruct_created(
679665
)
680666

681667
post = {code_addr: Account(storage={0: 42})} # Check for successful execution.
682-
683668
state_test(
684669
env=env,
685670
pre=pre,

0 commit comments

Comments
 (0)