From cfa542abe025e1abb195a581437d8635d405ff2c Mon Sep 17 00:00:00 2001 From: Dimitry Kh Date: Tue, 25 Jun 2024 12:46:41 +0200 Subject: [PATCH] try yul --- .../eip1153_tstore/test_yul_coverage.py | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/tests/cancun/eip1153_tstore/test_yul_coverage.py b/tests/cancun/eip1153_tstore/test_yul_coverage.py index 14012f5708..10263f18eb 100644 --- a/tests/cancun/eip1153_tstore/test_yul_coverage.py +++ b/tests/cancun/eip1153_tstore/test_yul_coverage.py @@ -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" @@ -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) @@ -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(