Skip to content

test_initcode_aborts()

Documentation for tests/prague/eip7692_eof_v1/eip7620_eof_create/test_eofcreate_failures.py::test_initcode_aborts@verkle@v0.0.6.

Generate fixtures for these test cases for Pragueeip7692 with:

Pragueeip7692 only:

fill -v tests/prague/eip7692_eof_v1/eip7620_eof_create/test_eofcreate_failures.py::test_initcode_aborts --fork=PragueEIP7692 --evm-bin=/path/to/evm-tool-dev-version

For all forks up to and including Pragueeip7692:

fill -v tests/prague/eip7692_eof_v1/eip7620_eof_create/test_eofcreate_failures.py::test_initcode_aborts --until=PragueEIP7692

Verifies correct handling of a halt in EOF initcode

Source code in tests/prague/eip7692_eof_v1/eip7620_eof_create/test_eofcreate_failures.py
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
139
140
141
142
143
144
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)