Skip to content

test_wide_container()

Documentation for tests/prague/eip7692_eof_v1/eip7620_eof_create/test_subcontainer_validation.py::test_wide_container@verkle@v0.0.6.

Generate fixtures for these test cases for Pragueeip7692 with:

Pragueeip7692 only:

fill -v tests/prague/eip7692_eof_v1/eip7620_eof_create/test_subcontainer_validation.py::test_wide_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/eip7620_eof_create/test_subcontainer_validation.py::test_wide_container --until=PragueEIP7692

Test a container with the maximum number of sub-containers

Source code in tests/prague/eip7692_eof_v1/eip7620_eof_create/test_subcontainer_validation.py
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
@pytest.mark.parametrize(
    ["width", "exception"],
    [
        pytest.param(256, None, id="256"),
        pytest.param(257, EOFException.TOO_MANY_CONTAINERS, id="257"),
        pytest.param(0x8000, EOFException.CONTAINER_SIZE_ABOVE_LIMIT, id="negative_i16"),
        pytest.param(0xFFFF, EOFException.CONTAINER_SIZE_ABOVE_LIMIT, id="max_u16"),
    ],
)
def test_wide_container(eof_test: EOFTestFiller, width: int, exception: EOFException):
    """Test a container with the maximum number of sub-containers"""
    create_code: Bytecode = Op.STOP
    for x in range(0, 256):
        create_code = Op.EOFCREATE[x](0, 0, 0, 0) + create_code
    eof_test(
        data=Container(
            sections=[
                Section.Code(
                    code=create_code,
                ),
                *(
                    [
                        Section.Container(
                            container=Container(
                                sections=[
                                    Section.Code(
                                        code=Op.PUSH0 + Op.PUSH0 + Op.RETURNCONTRACT[0],
                                    ),
                                    stop_sub_container,
                                ]
                            )
                        )
                    ]
                    * width
                ),
            ]
        ),
        expect_exception=exception,
    )

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 width exception
256 256 None
257 257 EOFException.TOO_MANY_CONTAINERS
negative_i16 32768 EOFException.CONTAINER_SIZE_ABOVE_LIMIT
max_u16 65535 EOFException.CONTAINER_SIZE_ABOVE_LIMIT