Skip to content

test_section_after_end_of_container()

Documentation for tests/osaka/eip7692_eof_v1/eip3540_eof_v1/test_container_size.py::test_section_after_end_of_container@008e492e.

Generate fixtures for these test cases for Osaka with:

fill -v tests/osaka/eip7692_eof_v1/eip3540_eof_v1/test_container_size.py::test_section_after_end_of_container --fork Osaka

Verify EOF container is invalid if any of sections declares above container size.

Source code in tests/osaka/eip7692_eof_v1/eip3540_eof_v1/test_container_size.py
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
@pytest.mark.parametrize(
    "code",
    [
        pytest.param(
            Container(sections=[Section.Code(code=Op.STOP, custom_size=MAX_INITCODE_SIZE)]),
            id="1st_code_section",
        ),
        pytest.param(
            Container(
                sections=[
                    Section.Code(code=Op.STOP),
                    Section.Code(code=Op.STOP, custom_size=MAX_INITCODE_SIZE),
                ]
            ),
            id="2nd_code_section",
        ),
        pytest.param(
            Container(
                sections=[
                    Section.Code(code=Op.STOP),
                    Section.Container(container=Op.STOP, custom_size=MAX_INITCODE_SIZE),
                ]
            ),
            id="1st_container_section",
        ),
        pytest.param(
            Container(
                sections=[
                    Section.Code(code=Op.STOP),
                    Section.Container(container=Op.STOP),
                    Section.Container(container=Op.STOP, custom_size=MAX_INITCODE_SIZE),
                ]
            ),
            id="2nd_container_section",
        ),
    ],
)
def test_section_after_end_of_container(
    eof_test: EOFTestFiller,
    code: Container,
):
    """Verify EOF container is invalid if any of sections declares above container size."""
    eof_test(
        container=bytes(code),
        expect_exception=EOFException.INVALID_SECTION_BODIES_SIZE,
    )

Parametrized Test Cases

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

Test ID (Abbreviated) code
...fork_Osaka-eof_test-1st_code_section b'\xef\x00\x01\x01\x00\x04\x02\x00\x01\xc0\x00\x04\x00\x00\x00\x00\x80\x00\x00\x00'
...fork_Osaka-eof_test-2nd_code_section b'\xef\x00\x01\x01\x00\x08\x02\x00\x02\x00\x01\xc0\x00\x04\x00\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x00'
...fork_Osaka-eof_test-1st_container_section b'\xef\x00\x01\x01\x00\x04\x02\x00\x01\x00\x01\x03\x00\x01\xc0\x00\x04\x00\x00\x00\x00\x80\x00\x00\x00\x00'
...fork_Osaka-eof_test-2nd_container_section b'\xef\x00\x01\x01\x00\x04\x02\x00\x01\x00\x01\x03\x00\x02\x00\x01\xc0\x00\x04\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00'