Skip to content

Commit 82a5402

Browse files
committed
trying to fix coverage
1 parent 1b7ae66 commit 82a5402

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

tests/cancun/eip6780_selfdestruct/test_selfdestruct_revert.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,3 +511,44 @@ def test_selfdestruct_not_created_in_same_tx_with_revert(
511511
)
512512

513513
state_test(env=env, pre=pre, post=post, tx=tx)
514+
515+
516+
@pytest.mark.valid_from("Cancun")
517+
def test_coverage_script_fix(
518+
state_test: StateTestFiller,
519+
env: Environment,
520+
pre: Alloc,
521+
):
522+
"""Fixes coverage script by making use of SWAP3 and JUMP."""
523+
env = Environment()
524+
sender = pre.fund_eoa()
525+
526+
account_code = (
527+
Op.PUSH1(0x08)
528+
+ Op.PUSH0
529+
+ Op.PUSH0
530+
+ Op.PUSH0
531+
+ Op.SWAP3
532+
+ Op.JUMP # jump to JUMPDEST when 0x08 is on top of stack
533+
+ Op.INVALID
534+
+ Op.JUMPDEST
535+
+ Op.STOP
536+
)
537+
538+
account = pre.deploy_contract(account_code)
539+
540+
tx = Transaction(
541+
ty=0x0,
542+
nonce=0,
543+
sender=sender,
544+
to=account,
545+
gas_limit=20_000_000,
546+
gas_price=10,
547+
value=0,
548+
data="",
549+
)
550+
551+
post = {}
552+
post[account] = Account(storage={})
553+
554+
state_test(env=env, pre=pre, post=post, tx=tx)

0 commit comments

Comments
 (0)