Skip to content

test_initcode_aborts()

Documentation for tests/osaka/eip7692_eof_v1/eip7620_eof_create/test_eofcreate_failures.py::test_initcode_aborts@49a16fac.

Generate fixtures for these test cases for Osaka with:

fill -v tests/osaka/eip7692_eof_v1/eip7620_eof_create/test_eofcreate_failures.py::test_initcode_aborts --fork Osaka

Verifies correct handling of a halt in EOF initcode.

Source code in tests/osaka/eip7692_eof_v1/eip7620_eof_create/test_eofcreate_failures.py
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
def test_initcode_aborts(
    state_test: StateTestFiller,
    pre: Alloc,
):
    """Verifies correct handling of a halt in EOF initcode."""
    env = Environment()
    sender = pre.fund_eoa()
    contract_address = pre.deploy_contract(
        code=Container(
            sections=[
                Section.Code(
                    code=Op.SSTORE(slot_create_address, Op.EOFCREATE[0](0, 0, 0, 0))
                    + Op.SSTORE(slot_code_worked, value_code_worked)
                    + Op.STOP,
                ),
                Section.Container(container=aborting_container),
            ]
        )
    )
    # Storage in slot_create_address should not have the address,
    post = {
        contract_address: Account(
            storage={
                slot_create_address: EOFCREATE_FAILURE,
                slot_code_worked: value_code_worked,
            }
        )
    }
    tx = Transaction(
        to=contract_address,
        gas_limit=10_000_000,
        gas_price=10,
        protected=False,
        sender=sender,
    )

    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-blockchain_test
...fork_Osaka-state_test