Skip to content

test_container_combos_deeply_nested_invalid()

Documentation for tests/osaka/eip7692_eof_v1/eip7620_eof_create/test_subcontainer_validation.py::test_container_combos_deeply_nested_invalid@49a16fac.

Generate fixtures for these test cases for Osaka with:

fill -v tests/osaka/eip7692_eof_v1/eip7620_eof_create/test_subcontainer_validation.py::test_container_combos_deeply_nested_invalid --fork Osaka

Test invalid subcontainer reference / opcode combos on a deep container nesting level.

Source code in tests/osaka/eip7692_eof_v1/eip7620_eof_create/test_subcontainer_validation.py
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
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
@pytest.mark.parametrize(
    "code_section,first_sub_container",
    [
        pytest.param(
            eofcreate_revert_code_section,
            stop_sub_container,
            id="EOFCREATE_STOP",
        ),
        pytest.param(
            eofcreate_revert_code_section,
            return_sub_container,
            id="EOFCREATE_RETURN",
        ),
        pytest.param(
            returncontract_code_section,
            returncontract_sub_container,
            id="RETURNCONTRACT_RETURNCONTRACT",
        ),
    ],
)
def test_container_combos_deeply_nested_invalid(
    eof_test: EOFTestFiller,
    code_section: Section,
    first_sub_container: Container,
):
    """Test invalid subcontainer reference / opcode combos on a deep container nesting level."""
    invalid_container = Container(
        sections=[
            code_section,
            first_sub_container,
        ],
        kind=ContainerKind.INITCODE,
    )

    container = invalid_container
    while len(container) < MAX_BYTECODE_SIZE:
        container = Container(
            sections=[
                eofcreate_revert_code_section,
                Section.Container(container=container.copy()),
            ],
            kind=ContainerKind.INITCODE,
        )

    eof_test(
        container=container,
        expect_exception=EOFException.INCOMPATIBLE_CONTAINER_KIND,
    )

Parametrized Test Cases

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

Test ID (Abbreviated) code_section first_sub_container
...fork_Osaka-eof_test-EOFCREATE_STOP data=b'`\x00`\x00`\x00`\x00\xec\x00`\x00`\x00\xfd' custom_size=0 kind= force_type_listing=False code_inputs=0 code_outputs=128 max_stack_height=4 auto_max_stack_height=False auto_code_inputs_outputs=False skip_header_listing=False skip_body_listing=False skip_types_body_listing=False skip_types_header_listing=False data=b'\xef\x00\x01\x01\x00\x04\x02\x00\x01\x00\x01\x04\x00\x00\x00\x00\x80\x00\x00\x00' custom_size=0 kind= force_type_listing=False code_inputs=0 code_outputs=128 max_stack_height=0 auto_max_stack_height=False auto_code_inputs_outputs=False skip_header_listing=False skip_body_listing=False skip_types_body_listing=False skip_types_header_listing=False
...fork_Osaka-eof_test-EOFCREATE_RETURN data=b'`\x00`\x00`\x00`\x00\xec\x00`\x00`\x00\xfd' custom_size=0 kind= force_type_listing=False code_inputs=0 code_outputs=128 max_stack_height=4 auto_max_stack_height=False auto_code_inputs_outputs=False skip_header_listing=False skip_body_listing=False skip_types_body_listing=False skip_types_header_listing=False data=b'\xef\x00\x01\x01\x00\x04\x02\x00\x01\x00\x05\x04\x00\x00\x00\x00\x80\x00\x02`\x00`\x00\xf3' custom_size=0 kind= force_type_listing=False code_inputs=0 code_outputs=128 max_stack_height=0 auto_max_stack_height=False auto_code_inputs_outputs=False skip_header_listing=False skip_body_listing=False skip_types_body_listing=False skip_types_header_listing=False
...fork_Osaka-eof_test-RETURNCONTRACT_RETURNCONTRACT data=b'a \x15`\x01U`\x00`\x00\xee\x00' custom_size=0 kind= force_type_listing=False code_inputs=0 code_outputs=128 max_stack_height=2 auto_max_stack_height=False auto_code_inputs_outputs=False skip_header_listing=False skip_body_listing=False skip_types_body_listing=False skip_types_header_listing=False data=b'\xef\x00\x01\x01\x00\x04\x02\x00\x01\x00\x06\x03\x00\x01\x00\x14\x04\x00\x00\x00\x00\x80\x00\x02`\x00`\x00\xee\x00\xef\x00\x01\x01\x00\x04\x02\x00\x01\x00\x01\x04\x00\x00\x00\x00\x80\x00\x00\x00' custom_size=0 kind= force_type_listing=False code_inputs=0 code_outputs=128 max_stack_height=0 auto_max_stack_height=False auto_code_inputs_outputs=False skip_header_listing=False skip_body_listing=False skip_types_body_listing=False skip_types_header_listing=False