diff --git a/tests/berlin/eip2930_access_list/test_acl.py b/tests/berlin/eip2930_access_list/test_acl.py index 6b29ef959a..b69a5ada7e 100644 --- a/tests/berlin/eip2930_access_list/test_acl.py +++ b/tests/berlin/eip2930_access_list/test_acl.py @@ -4,7 +4,6 @@ import pytest -from ethereum_test_forks import Fork, London, is_fork from ethereum_test_tools import AccessList, Account, Environment from ethereum_test_tools import Opcodes as Op from ethereum_test_tools import StateTestFiller, Transaction @@ -14,8 +13,7 @@ @pytest.mark.valid_from("Berlin") -@pytest.mark.valid_until("London") -def test_access_list(state_test: StateTestFiller, fork: Fork): +def test_access_list(state_test: StateTestFiller): """ Test type 1 transaction. """ @@ -59,12 +57,9 @@ def test_access_list(state_test: StateTestFiller, fork: Fork): balance=4, nonce=1, ), - "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba": Account( - balance=0x1BC16D674EC80000 if is_fork(fork, London) else 0x1BC16D674ECB26CE, - ), "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b": Account( balance=0x2CD931, nonce=1, ), } - state_test(env=env, pre=pre, post=post, txs=[tx]) + state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/cancun/eip1153_tstore/test_tstorage.py b/tests/cancun/eip1153_tstore/test_tstorage.py index de8efe4c2e..5cf655f425 100644 --- a/tests/cancun/eip1153_tstore/test_tstorage.py +++ b/tests/cancun/eip1153_tstore/test_tstorage.py @@ -42,13 +42,11 @@ def test_transient_storage_unset_values(state_test: StateTestFiller): code_address: Account(code=code, storage={slot: 1 for slot in slots_under_test}), } - txs = [ - Transaction( - to=code_address, - data=b"", - gas_limit=1_000_000, - ) - ] + tx = Transaction( + to=code_address, + data=b"", + gas_limit=1_000_000, + ) post = {code_address: Account(storage={slot: 0 for slot in slots_under_test})} @@ -56,7 +54,7 @@ def test_transient_storage_unset_values(state_test: StateTestFiller): env=env, pre=pre, post=post, - txs=txs, + tx=tx, ) @@ -79,13 +77,11 @@ def test_tload_after_tstore(state_test: StateTestFiller): code_address: Account(code=code, storage={slot: 0 for slot in slots_under_test}), } - txs = [ - Transaction( - to=code_address, - data=b"", - gas_limit=1_000_000, - ) - ] + tx = Transaction( + to=code_address, + data=b"", + gas_limit=1_000_000, + ) post = {code_address: Account(storage={slot: slot for slot in slots_under_test})} @@ -93,7 +89,7 @@ def test_tload_after_tstore(state_test: StateTestFiller): env=env, pre=pre, post=post, - txs=txs, + tx=tx, ) @@ -119,13 +115,11 @@ def test_tload_after_sstore(state_test: StateTestFiller): code_address: Account(code=code, storage={slot: 1 for slot in slots_under_test}), } - txs = [ - Transaction( - to=code_address, - data=b"", - gas_limit=1_000_000, - ) - ] + tx = Transaction( + to=code_address, + data=b"", + gas_limit=1_000_000, + ) post = { code_address: Account( @@ -139,7 +133,7 @@ def test_tload_after_sstore(state_test: StateTestFiller): env=env, pre=pre, post=post, - txs=txs, + tx=tx, ) @@ -166,13 +160,11 @@ def test_tload_after_tstore_is_zero(state_test: StateTestFiller): ), } - txs = [ - Transaction( - to=code_address, - data=b"", - gas_limit=1_000_000, - ) - ] + tx = Transaction( + to=code_address, + data=b"", + gas_limit=1_000_000, + ) post = { code_address: Account( @@ -184,7 +176,7 @@ def test_tload_after_tstore_is_zero(state_test: StateTestFiller): env=env, pre=pre, post=post, - txs=txs, + tx=tx, ) @@ -244,15 +236,13 @@ def test_gas_usage( TestAddress: Account(balance=10_000_000, nonce=0), code_address: Account(code=gas_measure_bytecode), } - txs = [ - Transaction( - to=code_address, - data=b"", - gas_limit=1_000_000, - ) - ] + tx = Transaction( + to=code_address, + data=b"", + gas_limit=1_000_000, + ) post = { code_address: Account(code=gas_measure_bytecode, storage={0: expected_gas}), TestAddress: Account(nonce=1), } - state_test(env=env, pre=pre, txs=txs, post=post) + state_test(env=env, pre=pre, tx=tx, post=post) diff --git a/tests/cancun/eip1153_tstore/test_tstorage_create_contexts.py b/tests/cancun/eip1153_tstore/test_tstorage_create_contexts.py index 32d6ca3174..d2d033ef1c 100644 --- a/tests/cancun/eip1153_tstore/test_tstorage_create_contexts.py +++ b/tests/cancun/eip1153_tstore/test_tstorage_create_contexts.py @@ -237,5 +237,5 @@ def test_contract_creation( env=Environment(), pre=pre, post=post, - txs=[tx], + tx=tx, ) diff --git a/tests/cancun/eip1153_tstore/test_tstorage_execution_contexts.py b/tests/cancun/eip1153_tstore/test_tstorage_execution_contexts.py index 5f22bb8dc2..a3173095a8 100644 --- a/tests/cancun/eip1153_tstore/test_tstorage_execution_contexts.py +++ b/tests/cancun/eip1153_tstore/test_tstorage_execution_contexts.py @@ -5,7 +5,7 @@ """ # noqa: E501 from enum import EnumMeta, unique -from typing import List, Mapping +from typing import Mapping import pytest @@ -314,12 +314,10 @@ def __init__(self, value): caller_address: Account(code=value["caller_bytecode"]), callee_address: Account(code=value["callee_bytecode"]), }, - "txs": [ - Transaction( - to=caller_address, - gas_limit=1_000_000, - ) - ], + "tx": Transaction( + to=caller_address, + gas_limit=1_000_000, + ), "post": { caller_address: Account(storage=value["expected_caller_storage"]), callee_address: Account(storage=value["expected_callee_storage"]), @@ -333,7 +331,7 @@ def test_subcall( state_test: StateTestFiller, env: Environment, pre: Mapping, - txs: List[Transaction], + tx: Transaction, post: Mapping, ): """ @@ -344,4 +342,4 @@ def test_subcall( - `DELEGATECALL` - `STATICCALL` """ - state_test(env=env, pre=pre, post=post, txs=txs) + state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/cancun/eip1153_tstore/test_tstorage_reentrancy_contexts.py b/tests/cancun/eip1153_tstore/test_tstorage_reentrancy_contexts.py index 5ad4c3c244..0e26304b86 100644 --- a/tests/cancun/eip1153_tstore/test_tstorage_reentrancy_contexts.py +++ b/tests/cancun/eip1153_tstore/test_tstorage_reentrancy_contexts.py @@ -279,4 +279,4 @@ def test_reentrant_call(state_test: StateTestFiller, bytecode, expected_storage) post = {callee_address: Account(code=bytecode, storage=expected_storage)} - state_test(env=env, pre=pre, post=post, txs=[tx]) + state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/cancun/eip1153_tstore/test_tstorage_selfdestruct.py b/tests/cancun/eip1153_tstore/test_tstorage_selfdestruct.py index 8225c67f0e..73a8074d97 100644 --- a/tests/cancun/eip1153_tstore/test_tstorage_selfdestruct.py +++ b/tests/cancun/eip1153_tstore/test_tstorage_selfdestruct.py @@ -249,4 +249,4 @@ def test_reentrant_selfdestructing_call( else: post[callee_address] = Account.NONEXISTENT - state_test(env=env, pre=pre, post=post, txs=[tx]) + state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/cancun/eip4788_beacon_root/test_beacon_root_contract.py b/tests/cancun/eip4788_beacon_root/test_beacon_root_contract.py index 02aa434500..1b5ef3e800 100644 --- a/tests/cancun/eip4788_beacon_root/test_beacon_root_contract.py +++ b/tests/cancun/eip4788_beacon_root/test_beacon_root_contract.py @@ -92,7 +92,7 @@ def test_beacon_root_contract_calls( state_test( env=env, pre=pre, - txs=[tx], + tx=tx, post=post, ) @@ -138,7 +138,7 @@ def test_beacon_root_contract_timestamps( state_test( env=env, pre=pre, - txs=[tx], + tx=tx, post=post, ) @@ -169,7 +169,7 @@ def test_calldata_lengths( state_test( env=env, pre=pre, - txs=[tx], + tx=tx, post=post, ) @@ -202,7 +202,7 @@ def test_beacon_root_equal_to_timestamp( state_test( env=env, pre=pre, - txs=[tx], + tx=tx, post=post, ) @@ -224,7 +224,7 @@ def test_tx_to_beacon_root_contract( state_test( env=env, pre=pre, - txs=[tx], + tx=tx, post=post, ) @@ -254,7 +254,7 @@ def test_invalid_beacon_root_calldata_value( state_test( env=env, pre=pre, - txs=[tx], + tx=tx, post=post, ) @@ -281,12 +281,14 @@ def test_beacon_root_selfdestruct( code=Op.CALL(100000, Op.PUSH20(to_address(0x1337)), 0, 0, 0, 0, 0) + Op.SSTORE(0, Op.BALANCE(Spec.BEACON_ROOTS_ADDRESS)), ) - post[to_address(0xCC)] = Account( - storage=Storage({0: 0xBA1}), - ) + post = { + to_address(0xCC): Account( + storage=Storage({0: 0xBA1}), + ) + } state_test( env=env, pre=pre, - txs=[tx, Transaction(nonce=1, to=to_address(0xCC), gas_limit=100000, gas_price=10)], + tx=Transaction(nonce=0, to=to_address(0xCC), gas_limit=100000, gas_price=10), post=post, ) diff --git a/tests/cancun/eip5656_mcopy/test_mcopy.py b/tests/cancun/eip5656_mcopy/test_mcopy.py index 52187ccb5d..2d9af99555 100644 --- a/tests/cancun/eip5656_mcopy/test_mcopy.py +++ b/tests/cancun/eip5656_mcopy/test_mcopy.py @@ -197,7 +197,7 @@ def test_valid_mcopy_operations( env=Environment(), pre=pre, post=post, - txs=[tx], + tx=tx, ) @@ -219,5 +219,5 @@ def test_mcopy_on_empty_memory( env=Environment(), pre=pre, post=post, - txs=[tx], + tx=tx, ) diff --git a/tests/cancun/eip5656_mcopy/test_mcopy_contexts.py b/tests/cancun/eip5656_mcopy/test_mcopy_contexts.py index ac69389986..504dfa7840 100644 --- a/tests/cancun/eip5656_mcopy/test_mcopy_contexts.py +++ b/tests/cancun/eip5656_mcopy/test_mcopy_contexts.py @@ -214,5 +214,5 @@ def test_no_memory_corruption_on_upper_call_stack_levels( env=Environment(), pre=pre, post=post, - txs=[tx], + tx=tx, ) diff --git a/tests/cancun/eip5656_mcopy/test_mcopy_memory_expansion.py b/tests/cancun/eip5656_mcopy/test_mcopy_memory_expansion.py index 8de58d9f5d..fd2456d902 100644 --- a/tests/cancun/eip5656_mcopy/test_mcopy_memory_expansion.py +++ b/tests/cancun/eip5656_mcopy/test_mcopy_memory_expansion.py @@ -215,7 +215,7 @@ def test_mcopy_memory_expansion( env=Environment(), pre=pre, post=post, - txs=[tx], + tx=tx, ) @@ -276,5 +276,5 @@ def test_mcopy_huge_memory_expansion( env=Environment(), pre=pre, post=post, - txs=[tx], + tx=tx, ) diff --git a/tests/cancun/eip6780_selfdestruct/test_selfdestruct.py b/tests/cancun/eip6780_selfdestruct/test_selfdestruct.py index bcfa98a505..d0867a0546 100644 --- a/tests/cancun/eip6780_selfdestruct/test_selfdestruct.py +++ b/tests/cancun/eip6780_selfdestruct/test_selfdestruct.py @@ -412,7 +412,7 @@ def test_create_selfdestruct_same_tx( protected=False, ) - state_test(env=env, pre=pre, post=post, txs=[tx]) + state_test(env=env, pre=pre, post=post, tx=tx) @pytest.mark.parametrize("create_opcode", [Op.CREATE, Op.CREATE2]) @@ -540,7 +540,7 @@ def test_self_destructing_initcode( protected=False, ) - state_test(env=env, pre=pre, post=post, txs=[tx]) + state_test(env=env, pre=pre, post=post, tx=tx) @pytest.mark.parametrize("tx_value", [0, 100_000]) @@ -595,7 +595,7 @@ def test_self_destructing_initcode_create_tx( protected=False, ) - state_test(env=env, pre=pre, post=post, txs=[tx]) + state_test(env=env, pre=pre, post=post, tx=tx) @pytest.mark.parametrize("create_opcode", [Op.CREATE2]) # Can only recreate using CREATE2 @@ -872,7 +872,7 @@ def test_selfdestruct_pre_existing( protected=False, ) - state_test(env=env, pre=pre, post=post, txs=[tx]) + state_test(env=env, pre=pre, post=post, tx=tx) @pytest.mark.parametrize("selfdestruct_contract_initial_balance", [0, 1]) @@ -1148,7 +1148,7 @@ def test_delegatecall_from_new_contract_to_pre_existing_contract( protected=False, ) - state_test(env=env, pre=pre, post=post, txs=[tx]) + state_test(env=env, pre=pre, post=post, tx=tx) @pytest.mark.parametrize("create_opcode", [Op.CREATE, Op.CREATE2]) @@ -1305,4 +1305,4 @@ def test_delegatecall_from_pre_existing_contract_to_new_contract( protected=False, ) - state_test(env=env, pre=pre, post=post, txs=[tx]) + state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/cancun/eip6780_selfdestruct/test_selfdestruct_revert.py b/tests/cancun/eip6780_selfdestruct/test_selfdestruct_revert.py index 9ffc218941..47e07abfa6 100644 --- a/tests/cancun/eip6780_selfdestruct/test_selfdestruct_revert.py +++ b/tests/cancun/eip6780_selfdestruct/test_selfdestruct_revert.py @@ -300,7 +300,7 @@ def test_selfdestruct_created_in_same_tx_with_revert( # noqa SC200 protected=False, ) - state_test(env=env, pre=pre, post=post, txs=[tx]) + state_test(env=env, pre=pre, post=post, tx=tx) @pytest.fixture @@ -415,4 +415,4 @@ def test_selfdestruct_not_created_in_same_tx_with_revert( protected=False, ) - state_test(env=env, pre=pre, post=post, txs=[tx]) + state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/cancun/eip7516_blobgasfee/test_blobgasfee_opcode.py b/tests/cancun/eip7516_blobgasfee/test_blobgasfee_opcode.py index ab29b0ca64..41e7965ee9 100644 --- a/tests/cancun/eip7516_blobgasfee/test_blobgasfee_opcode.py +++ b/tests/cancun/eip7516_blobgasfee/test_blobgasfee_opcode.py @@ -114,7 +114,7 @@ def test_blobbasefee_stack_overflow( state_test( env=Environment(), pre=pre, - txs=[tx], + tx=tx, post=post, ) @@ -147,7 +147,7 @@ def test_blobbasefee_out_of_gas( state_test( env=Environment(), pre=pre, - txs=[tx], + tx=tx, post=post, ) diff --git a/tests/frontier/opcodes/test_dup.py b/tests/frontier/opcodes/test_dup.py index e6bd27ef50..4d9c25d9f6 100644 --- a/tests/frontier/opcodes/test_dup.py +++ b/tests/frontier/opcodes/test_dup.py @@ -4,18 +4,41 @@ Test the DUP opcodes. """ +import pytest + from ethereum_test_forks import Frontier, Homestead -from ethereum_test_tools import ( - Account, - Environment, - StateTestFiller, - Storage, - Transaction, - to_address, -) +from ethereum_test_tools import Account, Environment +from ethereum_test_tools import Opcodes as Op +from ethereum_test_tools import StateTestFiller, Storage, Transaction, to_address -def test_dup(state_test: StateTestFiller, fork: str): +@pytest.mark.parametrize( + "dup_opcode", + [ + Op.DUP1, + Op.DUP2, + Op.DUP3, + Op.DUP4, + Op.DUP5, + Op.DUP6, + Op.DUP7, + Op.DUP8, + Op.DUP9, + Op.DUP10, + Op.DUP11, + Op.DUP12, + Op.DUP13, + Op.DUP14, + Op.DUP15, + Op.DUP16, + ], + ids=lambda op: str(op), +) +def test_dup( + state_test: StateTestFiller, + fork: str, + dup_opcode: Op, +): """ Test the DUP1-DUP16 opcodes. @@ -26,83 +49,58 @@ def test_dup(state_test: StateTestFiller, fork: str): """ # noqa: E501 env = Environment() pre = {"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b": Account(balance=1000000000000000000000)} - txs = [] post = {} + account = to_address(0x100) + + # Push 0x00 - 0x10 onto the stack + account_code = b"".join([Op.PUSH1(i) for i in range(0x11)]) + + # Use the DUP opcode + account_code += dup_opcode + + # Save each stack value into different keys in storage + account_code += b"".join([Op.PUSH1(i) + Op.SSTORE for i in range(0x11)]) + + pre[account] = Account(code=account_code) + + tx = Transaction( + ty=0x0, + nonce=0, + to=account, + gas_limit=500000, + gas_price=10, + protected=False if fork in [Frontier, Homestead] else True, + data="", + ) + """ - We are setting up 16 accounts, ranging from 0x100 to 0x10f. - They push values into the stack from 0-16, but each contract uses a - different DUP opcode, and depending on the opcode used, the item copied - into the storage changes. + Storage will be structured as follows: + + 0x00: 0x10-0x01 (Depending on DUP opcode) + 0x01: 0x10 + 0x02: 0x0F + 0x03: 0x0E + 0x04: 0x0D + 0x05: 0x0C + 0x06: 0x0B + 0x07: 0x0A + 0x08: 0x09 + 0x09: 0x08 + 0x0A: 0x07 + 0x0B: 0x06 + 0x0C: 0x05 + 0x0D: 0x04 + 0x0E: 0x03 + 0x0F: 0x02 + 0x10: 0x01 + + DUP1 copies the first element of the stack (0x10). + DUP16 copies the 16th element of the stack (0x01). """ - for i in range(0, 16): - """ - Account 0x100 uses DUP1, - Account 0x10f uses DUP16. - """ - account = to_address(0x100 + i) - dup_opcode = 0x80 + i - - pre[account] = Account( - code=( - # Push 0 - 16 onto the stack - """0x6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 - 600A 600B 600C 600D 600E 600F 6010""" - + - # Use the DUP opcode for this account - hex(dup_opcode)[2:] - + - # Save each stack value into different keys in storage - """6000 55 6001 55 6002 55 6003 55 6004 55 6005 55 - 6006 55 6007 55 6008 55 6009 55 600A 55 600B 55 - 600C 55 600D 55 600E 55 600F 55 6010 55""" - ) - ) - - """ - Also we are sending one transaction to each account. - The storage of each will only change by one item: storage[0] - The value depends on the DUP opcode used. - """ - - tx = Transaction( - ty=0x0, - nonce=i, - to=account, - gas_limit=500000, - gas_price=10, - protected=False if fork in [Frontier, Homestead] else True, - data="", - ) - txs.append(tx) - - """ - Storage will be structured as follows: - - 0x00: 0x10-0x01 (Depending on DUP opcode) - 0x01: 0x10 - 0x02: 0x0F - 0x03: 0x0E - 0x04: 0x0D - 0x05: 0x0C - 0x06: 0x0B - 0x07: 0x0A - 0x08: 0x09 - 0x09: 0x08 - 0x0A: 0x07 - 0x0B: 0x06 - 0x0C: 0x05 - 0x0D: 0x04 - 0x0E: 0x03 - 0x0F: 0x02 - 0x10: 0x01 - - DUP1 copies the first element of the stack (0x10). - DUP16 copies the 16th element of the stack (0x01). - """ - s: Storage.StorageDictType = dict(zip(range(1, 17), range(16, 0, -1))) - s[0] = 16 - i - - post[account] = Account(storage=s) - - state_test(env=env, pre=pre, post=post, txs=txs) + s: Storage.StorageDictType = dict(zip(range(1, 17), range(16, 0, -1))) + s[0] = 16 - (dup_opcode.int() - 0x80) + + post[account] = Account(storage=s) + + state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/homestead/yul/test_yul_example.py b/tests/homestead/yul/test_yul_example.py index b499613944..1e6fad07a2 100644 --- a/tests/homestead/yul/test_yul_example.py +++ b/tests/homestead/yul/test_yul_example.py @@ -59,4 +59,4 @@ def test_yul(state_test: StateTestFiller, yul: YulCompiler, fork: Fork): ), } - state_test(env=env, pre=pre, post=post, txs=[tx]) + state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/istanbul/eip1344_chainid/test_chainid.py b/tests/istanbul/eip1344_chainid/test_chainid.py index 32eaffc327..0218fe0975 100644 --- a/tests/istanbul/eip1344_chainid/test_chainid.py +++ b/tests/istanbul/eip1344_chainid/test_chainid.py @@ -51,4 +51,4 @@ def test_chainid(state_test: StateTestFiller): to_address(0x100): Account(code="0x4660015500", storage={"0x01": "0x01"}), } - state_test(env=env, pre=pre, post=post, txs=[tx]) + state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/shanghai/eip3651_warm_coinbase/test_warm_coinbase.py b/tests/shanghai/eip3651_warm_coinbase/test_warm_coinbase.py index 32324eff19..fe80358b8f 100644 --- a/tests/shanghai/eip3651_warm_coinbase/test_warm_coinbase.py +++ b/tests/shanghai/eip3651_warm_coinbase/test_warm_coinbase.py @@ -138,7 +138,7 @@ def test_warm_coinbase_call_out_of_gas( env=env, pre=pre, post=post, - txs=[tx], + tx=tx, tag="opcode_" + opcode, ) @@ -269,6 +269,6 @@ def test_warm_coinbase_gas_usage(state_test, fork, opcode, code_gas_measure): env=env, pre=pre, post=post, - txs=[tx], + tx=tx, tag="opcode_" + opcode.lower(), ) diff --git a/tests/shanghai/eip3855_push0/test_push0.py b/tests/shanghai/eip3855_push0/test_push0.py index 582bc9e83a..313aa261b9 100644 --- a/tests/shanghai/eip3855_push0/test_push0.py +++ b/tests/shanghai/eip3855_push0/test_push0.py @@ -71,7 +71,7 @@ def test_push0_key_sstore( pre[addr_1] = Account(code=code) post[addr_1] = Account(storage={0x00: 0x01}) - state_test(env=env, pre=pre, post=post, txs=[tx], tag="key_sstore") + state_test(env=env, pre=pre, post=post, tx=tx, tag="key_sstore") def test_push0_fill_stack( @@ -92,7 +92,7 @@ def test_push0_fill_stack( pre[addr_1] = Account(code=code) post[addr_1] = Account(storage={0x00: 0x01}) - state_test(env=env, pre=pre, post=post, txs=[tx], tag="fill_stack") + state_test(env=env, pre=pre, post=post, tx=tx, tag="fill_stack") def test_push0_stack_overflow( @@ -112,7 +112,7 @@ def test_push0_stack_overflow( pre[addr_1] = Account(code=code) post[addr_1] = Account(storage={0x00: 0x00}) - state_test(env=env, pre=pre, post=post, txs=[tx], tag="stack_overflow") + state_test(env=env, pre=pre, post=post, tx=tx, tag="stack_overflow") def test_push0_storage_overwrite( @@ -131,7 +131,7 @@ def test_push0_storage_overwrite( pre[addr_1] = Account(code=code, storage={0x00: 0x0A, 0x01: 0x0A}) post[addr_1] = Account(storage={0x00: 0x02, 0x01: 0x00}) - state_test(env=env, pre=pre, post=post, txs=[tx], tag="storage_overwrite") + state_test(env=env, pre=pre, post=post, tx=tx, tag="storage_overwrite") def test_push0_during_staticcall( @@ -159,7 +159,7 @@ def test_push0_during_staticcall( pre[addr_2] = Account(code=code_2) post[addr_1] = Account(storage={0x00: 0x01, 0x01: 0xFF}) - state_test(env=env, pre=pre, post=post, txs=[tx], tag="during_staticcall") + state_test(env=env, pre=pre, post=post, tx=tx, tag="during_staticcall") def test_push0_before_jumpdest( @@ -178,7 +178,7 @@ def test_push0_before_jumpdest( pre[addr_1] = Account(code=code) post[addr_1] = Account(storage={0x00: 0x01}) - state_test(env=env, pre=pre, post=post, txs=[tx], tag="before_jumpdest") + state_test(env=env, pre=pre, post=post, tx=tx, tag="before_jumpdest") def test_push0_gas_cost( @@ -200,4 +200,4 @@ def test_push0_gas_cost( pre[addr_1] = Account(code=code) post[addr_1] = Account(storage={0x00: 0x02}) - state_test(env=env, pre=pre, post=post, txs=[tx], tag="gas_cost") + state_test(env=env, pre=pre, post=post, tx=tx, tag="gas_cost") diff --git a/tests/shanghai/eip3860_initcode/test_initcode.py b/tests/shanghai/eip3860_initcode/test_initcode.py index 9ac605b032..44d8c53428 100644 --- a/tests/shanghai/eip3860_initcode/test_initcode.py +++ b/tests/shanghai/eip3860_initcode/test_initcode.py @@ -632,6 +632,6 @@ def test_create_opcode_initcode( env=env, pre=pre, post=post, - txs=[tx], + tx=tx, tag=f"{initcode.name}_{opcode}", )