Skip to content

test_short_data_subcontainer()

Documentation for tests/osaka/eip7692_eof_v1/eip7698_eof_creation_tx/test_eof_creation_tx.py::test_short_data_subcontainer@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_short_data_subcontainer --fork Osaka

Deploy a subcontainer where the data is "short" and filled by deployment code.

Source code in tests/osaka/eip7692_eof_v1/eip7698_eof_creation_tx/test_eof_creation_tx.py
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
def test_short_data_subcontainer(
    state_test: StateTestFiller,
    pre: Alloc,
):
    """Deploy a subcontainer where the data is "short" and filled by deployment code."""
    env = Environment()
    sender = pre.fund_eoa()

    tx = Transaction(
        sender=sender,
        to=None,
        gas_limit=100000,
        data=Container(
            name="Runtime Subcontainer with truncated data",
            sections=[
                Section.Code(code=Op.RETURNCODE[0](0, 1)),
                Section.Container(
                    Container(
                        sections=[
                            Section.Code(Op.STOP),
                            Section.Data(data="001122", custom_size=4),
                        ]
                    )
                ),
            ],
        ),
    )

    destination_contract_address = tx.created_contract

    post = {
        destination_contract_address: Account(nonce=1),
    }

    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