Skip to content

Commit 46c2995

Browse files
committed
improvements
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
1 parent 305c10a commit 46c2995

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,
@@ -627,15 +620,8 @@ def test_worst_selfdestruct_created(
627620
"""
628621
env = Environment()
629622

630-
# Create an account that will be used as the beneficiary of the SELFDESTRUCT calls, to avoid
631-
# account creation costs. All SELFDESTRUCT calls will target the same account to avoid
632-
# cold costs.
633-
selfdestruct_beneficiary = pre.fund_eoa()
634-
635623
# Template code that will be used to deploy a large number of contracts.
636-
selfdestructable_contract_addr = pre.deploy_contract(
637-
code=Op.SELFDESTRUCT(selfdestruct_beneficiary)
638-
)
624+
selfdestructable_contract_addr = pre.deploy_contract(code=Op.SELFDESTRUCT(Op.COINBASE))
639625
initcode = Op.EXTCODECOPY(
640626
address=selfdestructable_contract_addr,
641627
dest_offset=0,
@@ -663,7 +649,7 @@ def test_worst_selfdestruct_created(
663649
),
664650
# Stop before we run out of gas for the whole tx execution.
665651
# The value was found by trial-error rounded to the next 1000 multiple.
666-
condition=Op.GT(Op.GAS, 33_000),
652+
condition=Op.GT(Op.GAS, 42_000),
667653
)
668654
+ Op.SSTORE(0, 42) # Done for successful tx execution assertion below.
669655
)
@@ -677,7 +663,6 @@ def test_worst_selfdestruct_created(
677663
)
678664

679665
post = {code_addr: Account(storage={0: 42})} # Check for successful execution.
680-
681666
state_test(
682667
env=env,
683668
pre=pre,

0 commit comments

Comments
 (0)