Skip to content

test_opcodes_in_create_tx()

Documentation for tests/osaka/eip7692_eof_v1/eip3540_eof_v1/test_opcodes_in_legacy.py::test_opcodes_in_create_tx@21fb11c8.

Generate fixtures for these test cases for Osaka with:

fill -v tests/osaka/eip7692_eof_v1/eip3540_eof_v1/test_opcodes_in_legacy.py::test_opcodes_in_create_tx --fork Osaka

Test all EOF only opcodes in create tx and expects failure.

Source code in tests/osaka/eip7692_eof_v1/eip3540_eof_v1/test_opcodes_in_legacy.py
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
@pytest.mark.parametrize(
    "code",
    eof_opcode_blocks,
)
def test_opcodes_in_create_tx(state_test: StateTestFiller, pre: Alloc, code: Opcodes):
    """Test all EOF only opcodes in create tx and expects failure."""
    env = Environment()

    sender = pre.fund_eoa()

    tx = Transaction(
        sender=sender,
        to=None,
        gas_limit=5_000_000,
        gas_price=10,
        protected=False,
        data=code,
    )

    post = {
        # Should revert in initcode, which results in no contract created
        tx.created_contract: Account.NONEXISTENT
    }

    state_test(
        env=env,
        pre=pre,
        post=post,
        tx=tx,
    )

Parametrized Test Cases

The interactive table below is also available as a standalone page.

Test ID (Abbreviated) code
...fork_Osaka-state_test-DUPN
...fork_Osaka-state_test-SWAPN
...fork_Osaka-state_test-EXCHANGE
...fork_Osaka-state_test-RJUMP RJUMP_0x0000
...fork_Osaka-state_test-RJUMPI0
...fork_Osaka-state_test-RJUMPI1
...fork_Osaka-state_test-CALLF CALLF_0x0001
...fork_Osaka-state_test-RETF RETF
...fork_Osaka-state_test-JUMPF JUMPF_0x0000
...fork_Osaka-state_test-EXTCALL
...fork_Osaka-state_test-EXTDELEGATECALL
...fork_Osaka-state_test-EXTSTATICCALL
...fork_Osaka-state_test-DATALOAD
...fork_Osaka-state_test-DATALOADN DATALOADN_0x0000
...fork_Osaka-state_test-DATASIZE DATASIZE
...fork_Osaka-state_test-DATACOPY
...fork_Osaka-state_test-EOFCREATE
...fork_Osaka-state_test-RETURNCONTRACT RETURNCONTRACT_0x00
...fork_Osaka-blockchain_test_from_state_test-DUPN
...fork_Osaka-blockchain_test_from_state_test-SWAPN
...fork_Osaka-blockchain_test_from_state_test-EXCHANGE
...fork_Osaka-blockchain_test_from_state_test-RJUMP RJUMP_0x0000
...fork_Osaka-blockchain_test_from_state_test-RJUMPI0
...fork_Osaka-blockchain_test_from_state_test-RJUMPI1
...fork_Osaka-blockchain_test_from_state_test-CALLF CALLF_0x0001
...fork_Osaka-blockchain_test_from_state_test-RETF RETF
...fork_Osaka-blockchain_test_from_state_test-JUMPF JUMPF_0x0000
...fork_Osaka-blockchain_test_from_state_test-EXTCALL
...fork_Osaka-blockchain_test_from_state_test-EXTDELEGATECALL
...fork_Osaka-blockchain_test_from_state_test-EXTSTATICCALL
...fork_Osaka-blockchain_test_from_state_test-DATALOAD
...fork_Osaka-blockchain_test_from_state_test-DATALOADN DATALOADN_0x0000
...fork_Osaka-blockchain_test_from_state_test-DATASIZE DATASIZE
...fork_Osaka-blockchain_test_from_state_test-DATACOPY
...fork_Osaka-blockchain_test_from_state_test-EOFCREATE
...fork_Osaka-blockchain_test_from_state_test-RETURNCONTRACT RETURNCONTRACT_0x00