Skip to content

test_section_after_end_of_container()

Documentation for tests/prague/eip7692_eof_v1/eip3540_eof_v1/test_container_size.py::test_section_after_end_of_container@verkle@v0.0.6.

Generate fixtures for these test cases for Pragueeip7692 with:

Pragueeip7692 only:

fill -v tests/prague/eip7692_eof_v1/eip3540_eof_v1/test_container_size.py::test_section_after_end_of_container --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/eip3540_eof_v1/test_container_size.py::test_section_after_end_of_container --until=PragueEIP7692

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

Source code in tests/prague/eip7692_eof_v1/eip3540_eof_v1/test_container_size.py
 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
107
108
109
110
111
112
113
114
@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(
        data=bytes(code),
        expect_exception=EOFException.INVALID_SECTION_BODIES_SIZE,
    )

Parametrized Test Cases

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

Skipped Parameters

For more concise readability, the table below does not list the following parameter values: fork, blockchain_test, state_test, state_test_only, eof_test, eof_state_test.

Test ID code
1st_code_section b'\xef\x00\x01\x01\x00\x04\x02\x00\x01\xc0\x00\x04\x00\x00\x00\x00\x80\x00\x00\x00'
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'
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'
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'