Skip to content

Commit

Permalink
don't use yul code in yul_coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
winsvega committed Jul 1, 2024
1 parent 95de715 commit 4e92159
Showing 1 changed file with 4 additions and 32 deletions.
36 changes: 4 additions & 32 deletions tests/cancun/eip1153_tstore/test_yul_coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,7 @@

import pytest

from ethereum_test_forks import Shanghai
from ethereum_test_tools import (
Account,
Address,
Alloc,
Environment,
StateTestFiller,
Transaction,
Yul,
)
from ethereum_test_tools import Address, Alloc, Environment, StateTestFiller, Transaction
from ethereum_test_tools.vm.opcode import Opcodes as Op

REFERENCE_SPEC_GIT_PATH = "N/A"
Expand All @@ -29,8 +20,7 @@ def test_yul_coverage(
"""
This test complete the coverage gaps by calling the codes, produced by yul compiler
"""
pre.deploy_contract(
address=Address("0xB00000000000000000000000000000000000000B"),
missed_coverage = pre.deploy_contract(
balance=0,
code=Op.SHL(0x0000000000000000000000000000000000000000000000000000000000000001, 0x00)
+ Op.SHR(0x0000000000000000000000000000000000000000000000000000000000000001, 0x00)
Expand All @@ -51,27 +41,9 @@ def test_yul_coverage(
)
address_to = pre.deploy_contract(
balance=1_000_000_000_000_000_000,
code=Yul(
"""
{
let ok := call(gas(), 0xB00000000000000000000000000000000000000B, 0, 0, 0, 0, 0)
mstore(0, ok)
return(0, 32)
}
""",
fork=Shanghai,
),
code=Op.MSTORE(0, Op.CALL(Op.GAS, missed_coverage, 0, 0, 0, 0, 0)) + Op.RETURN(0, 32),
)

# Uncalled account
uncalled_account = pre.deploy_contract(
nonce=0,
balance=7_000_000_000_000_000_000,
code="0x",
storage={},
)
post = {uncalled_account: Account()}

tx = Transaction(
sender=pre.fund_eoa(7_000_000_000_000_000_000),
gas_limit=100000,
Expand All @@ -83,4 +55,4 @@ def test_yul_coverage(
max_priority_fee_per_gas=5,
)

state_test(env=Environment(), pre=pre, post=post, tx=tx)
state_test(env=Environment(), pre=pre, post={}, tx=tx)

0 comments on commit 4e92159

Please sign in to comment.