Skip to content

Commit

Permalink
try yul
Browse files Browse the repository at this point in the history
  • Loading branch information
winsvega committed Jun 25, 2024
1 parent 8f2b4c2 commit cfa542a
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions tests/cancun/eip1153_tstore/test_yul_coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,16 @@

import pytest

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

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

uncalled_account = pre.deploy_contract(
Expand Down

0 comments on commit cfa542a

Please sign in to comment.