Skip to content

test_container_combos_non_first_code_sections_invalid()

Documentation for tests/osaka/eip7692_eof_v1/eip7620_eof_create/test_subcontainer_validation.py::test_container_combos_non_first_code_sections_invalid@21fb11c8.

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_non_first_code_sections_invalid --fork Osaka

Test invalid subcontainer reference / opcode combos in a non-first code section.

Source code in tests/osaka/eip7692_eof_v1/eip7620_eof_create/test_subcontainer_validation.py
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
@pytest.mark.parametrize(
    "code_section,first_sub_container,container_kind",
    [
        pytest.param(
            eofcreate_code_section,
            stop_sub_container,
            ContainerKind.RUNTIME,
            id="EOFCREATE_STOP",
        ),
        pytest.param(
            eofcreate_code_section,
            return_sub_container,
            ContainerKind.RUNTIME,
            id="EOFCREATE_RETURN",
        ),
        pytest.param(
            returncontract_code_section,
            returncontract_sub_container,
            ContainerKind.INITCODE,
            id="RETURNCONTRACT_RETURNCONTRACT",
        ),
    ],
)
def test_container_combos_non_first_code_sections_invalid(
    eof_test: EOFTestFiller,
    code_section: Section,
    first_sub_container: Container,
    container_kind: ContainerKind,
):
    """Test invalid subcontainer reference / opcode combos in a non-first code section."""
    eof_test(
        container=Container(
            sections=[Section.Code(Op.JUMPF[i]) for i in range(1, 1024)]
            + [code_section, first_sub_container],
            kind=container_kind,
        ),
        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 container_kind
...fork_Osaka-eof_test-EOFCREATE_STOP data=b'`\x00`\x00`\x00`\x00\xec\x00a \x15`\x01U\x00' 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 RUNTIME
...fork_Osaka-eof_test-EOFCREATE_RETURN data=b'`\x00`\x00`\x00`\x00\xec\x00a \x15`\x01U\x00' 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 RUNTIME
...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 INITCODE