Skip to content

test_lecacy_cannot_create_eof()

Documentation for tests/osaka/eip7692_eof_v1/eip7698_eof_creation_tx/test_eof_creation_tx.py::test_lecacy_cannot_create_eof@01f496f4.

Generate fixtures for these test cases for Osaka with:

fill -v tests/osaka/eip7692_eof_v1/eip7698_eof_creation_tx/test_eof_creation_tx.py::test_lecacy_cannot_create_eof --fork Osaka

Test that a legacy contract creation initcode cannot deploy an EOF contract.

Source code in tests/osaka/eip7692_eof_v1/eip7698_eof_creation_tx/test_eof_creation_tx.py
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
def test_lecacy_cannot_create_eof(
    state_test: StateTestFiller,
    pre: Alloc,
):
    """Test that a legacy contract creation initcode cannot deploy an EOF contract."""
    env = Environment()
    sender = pre.fund_eoa()

    initcode = Initcode(deploy_code=smallest_runtime_subcontainer)

    tx = Transaction(sender=sender, to=None, gas_limit=100000, data=initcode)

    destination_contract_address = tx.created_contract

    post = {
        destination_contract_address: Account.NONEXISTENT,
    }

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

Parametrized Test Cases

This test case is only parametrized by fork and fixture format.

Test ID (Abbreviated)
...fork_Osaka-state_test
...fork_Osaka-blockchain_test_from_state_test