Skip to content

Commit 47d17a1

Browse files
winsvegadanceratopz
andauthored
feat(fill,tests): add ported_from pytest marker (ethereum#1590)
* add ported_from test marker to converted from json tests * chore: fix test in md link in `converted-ethereum-tests.txt` * docs: update changelog * Update docs/CHANGELOG.md --------- Co-authored-by: danceratopz <danceratopz@gmail.com>
1 parent 2918456 commit 47d17a1

File tree

12 files changed

+153
-0
lines changed

12 files changed

+153
-0
lines changed

cancun/eip1153_tstore/test_basic_tload.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@
1616
REFERENCE_SPEC_VERSION = ref_spec_1153.version
1717

1818

19+
@pytest.mark.ported_from(
20+
[
21+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/01_tloadBeginningTxnFiller.yml",
22+
],
23+
pr=["https://github.com/ethereum/execution-spec-tests/pull/440"],
24+
)
1925
@pytest.mark.valid_from("Cancun")
2026
def test_basic_tload_transaction_begin(
2127
state_test: StateTestFiller,
@@ -61,6 +67,12 @@ def test_basic_tload_transaction_begin(
6167
state_test(env=Environment(), pre=pre, post=post, tx=tx)
6268

6369

70+
@pytest.mark.ported_from(
71+
[
72+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/02_tloadAfterTstoreFiller.yml",
73+
],
74+
pr=["https://github.com/ethereum/execution-spec-tests/pull/440"],
75+
)
6476
@pytest.mark.valid_from("Cancun")
6577
def test_basic_tload_works(
6678
state_test: StateTestFiller,
@@ -113,6 +125,12 @@ def test_basic_tload_works(
113125
state_test(env=Environment(), pre=pre, post=post, tx=tx)
114126

115127

128+
@pytest.mark.ported_from(
129+
[
130+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/03_tloadAfterStoreIs0Filler.yml",
131+
],
132+
pr=["https://github.com/ethereum/execution-spec-tests/pull/440"],
133+
)
116134
@pytest.mark.valid_from("Cancun")
117135
def test_basic_tload_other_after_tstore(
118136
state_test: StateTestFiller,
@@ -161,6 +179,12 @@ def test_basic_tload_other_after_tstore(
161179
state_test(env=Environment(), pre=pre, post=post, tx=tx)
162180

163181

182+
@pytest.mark.ported_from(
183+
[
184+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/16_tloadGasFiller.yml",
185+
],
186+
pr=["https://github.com/ethereum/execution-spec-tests/pull/440"],
187+
)
164188
@pytest.mark.valid_from("Cancun")
165189
def test_basic_tload_gasprice(
166190
state_test: StateTestFiller,
@@ -239,6 +263,12 @@ def test_basic_tload_gasprice(
239263
state_test(env=Environment(), pre=pre, post=post, tx=tx)
240264

241265

266+
@pytest.mark.ported_from(
267+
[
268+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/18_tloadAfterStoreFiller.yml",
269+
],
270+
pr=["https://github.com/ethereum/execution-spec-tests/pull/440"],
271+
)
242272
@pytest.mark.valid_from("Cancun")
243273
def test_basic_tload_after_store(
244274
state_test: StateTestFiller,

cancun/eip1153_tstore/test_tload_calls.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@
1313
REFERENCE_SPEC_VERSION = "1eb863b534a5a3e19e9c196ab2a7f3db4bb9da17"
1414

1515

16+
@pytest.mark.ported_from(
17+
[
18+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/04_tloadAfterCallFiller.yml",
19+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/12_tloadDelegateCallFiller.yml",
20+
],
21+
pr=["https://github.com/ethereum/execution-spec-tests/pull/440"],
22+
)
1623
@pytest.mark.valid_from("Cancun")
1724
@pytest.mark.parametrize("call_type", [Op.CALL, Op.CALLCODE, Op.DELEGATECALL])
1825
def test_tload_calls(state_test: StateTestFiller, pre: Alloc, call_type: Op):

cancun/eip1153_tstore/test_tload_reentrancy.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ class CallDestType(Enum):
3333
EXTERNAL_CALL = 2
3434

3535

36+
@pytest.mark.ported_from(
37+
[
38+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/05_tloadReentrancyFiller.yml",
39+
],
40+
pr=["https://github.com/ethereum/execution-spec-tests/pull/440"],
41+
)
3642
@pytest.mark.valid_from("Cancun")
3743
@pytest.mark.parametrize("call_type", [Op.CALL, Op.CALLCODE, Op.DELEGATECALL, Op.STATICCALL])
3844
@pytest.mark.parametrize("call_return", [Op.RETURN, Op.REVERT, Om.OOG])

cancun/eip1153_tstore/test_tstore_reentrancy.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,18 @@ class CallDestType(Enum):
3333
EXTERNAL_CALL = 2
3434

3535

36+
@pytest.mark.ported_from(
37+
[
38+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/06_tstoreInReentrancyCallFiller.yml",
39+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/07_tloadAfterReentrancyStoreFiller.yml",
40+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/08_revertUndoesTransientStoreFiller.yml",
41+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/09_revertUndoesAllFiller.yml",
42+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/11_tstoreDelegateCallFiller.yml",
43+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/13_tloadStaticCallFiller.yml",
44+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/20_oogUndoesTransientStoreInCallFiller.yml",
45+
],
46+
pr=["https://github.com/ethereum/execution-spec-tests/pull/440"],
47+
)
3648
@pytest.mark.valid_from("Cancun")
3749
@pytest.mark.parametrize("call_type", [Op.CALL, Op.CALLCODE, Op.DELEGATECALL, Op.STATICCALL])
3850
@pytest.mark.parametrize("call_return", [Op.RETURN, Op.REVERT, Om.OOG])

constantinople/eip1014_create2/test_create_returndata.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@
1515
REFERENCE_SPEC_VERSION = ref_spec_1014.version
1616

1717

18+
@pytest.mark.ported_from(
19+
[
20+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stCreate2/call_outsize_then_create2_successful_then_returndatasizeFiller.json",
21+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stCreate2/call_then_create2_successful_then_returndatasizeFiller.json",
22+
],
23+
pr=["https://github.com/ethereum/execution-spec-tests/pull/497"],
24+
)
1825
@pytest.mark.valid_from("Istanbul")
1926
@pytest.mark.parametrize("call_return_size", [35, 32, 0])
2027
@pytest.mark.parametrize("create_type", [Op.CREATE, Op.CREATE2])

frontier/opcodes/test_all_opcodes.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ def prepare_suffix(opcode: Opcode) -> Bytecode:
4646
return Op.STOP
4747

4848

49+
@pytest.mark.ported_from(
50+
[
51+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stBadOpcode/badOpcodesFiller.json",
52+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stBugs/evmBytecodeFiller.json",
53+
],
54+
pr=["https://github.com/ethereum/execution-spec-tests/pull/748"],
55+
)
4956
@pytest.mark.valid_from("Frontier")
5057
def test_all_opcodes(state_test: StateTestFiller, pre: Alloc, fork: Fork):
5158
"""

frontier/opcodes/test_calldatacopy.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
from ethereum_test_tools.vm.opcode import Opcodes as Op
88

99

10+
@pytest.mark.ported_from(
11+
[
12+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/VMTests/vmTests/calldatacopyFiller.yml",
13+
],
14+
pr=["https://github.com/ethereum/execution-spec-tests/pull/1056"],
15+
)
1016
@pytest.mark.parametrize(
1117
"code,tx_data,code_address_storage,to_address_storage",
1218
[

frontier/opcodes/test_calldataload.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
from ethereum_test_tools.vm.opcode import Opcodes as Op
99

1010

11+
@pytest.mark.ported_from(
12+
[
13+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/VMTests/vmTests/calldataloadFiller.yml",
14+
],
15+
pr=["https://github.com/ethereum/execution-spec-tests/pull/1236"],
16+
)
1117
@pytest.mark.parametrize(
1218
"calldata,calldata_offset,expected_storage",
1319
[

frontier/opcodes/test_calldatasize.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
from ethereum_test_tools.vm.opcode import Opcodes as Op
99

1010

11+
@pytest.mark.ported_from(
12+
[
13+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/VMTests/vmTests/calldatasizeFiller.yml",
14+
],
15+
pr=["https://github.com/ethereum/execution-spec-tests/pull/1236"],
16+
)
1117
@pytest.mark.parametrize(
1218
"args_size",
1319
[0, 2, 16, 33, 257],

frontier/opcodes/test_push.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ def get_input_for_push_opcode(opcode: Op) -> bytes:
2121
return ethereum_state_machine[0:input_size]
2222

2323

24+
@pytest.mark.ported_from(
25+
[
26+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/VMTests/vmTests/pushFiller.yml",
27+
],
28+
pr=["https://github.com/ethereum/execution-spec-tests/pull/975"],
29+
)
2430
@pytest.mark.parametrize(
2531
"push_opcode",
2632
[getattr(Op, f"PUSH{i}") for i in range(1, 33)], # Dynamically parametrize PUSH opcodes
@@ -67,6 +73,12 @@ def test_push(state_test: StateTestFiller, fork: Fork, pre: Alloc, push_opcode:
6773
state_test(env=env, pre=pre, post=post, tx=tx)
6874

6975

76+
@pytest.mark.ported_from(
77+
[
78+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/VMTests/vmTests/pushFiller.yml",
79+
],
80+
pr=["https://github.com/ethereum/execution-spec-tests/pull/975"],
81+
)
7082
@pytest.mark.parametrize(
7183
"push_opcode",
7284
[getattr(Op, f"PUSH{i}") for i in range(1, 33)],

0 commit comments

Comments
 (0)