Skip to content

test_eofcreate_invalid_index()

Documentation for tests/osaka/eip7692_eof_v1/eip7620_eof_create/test_eofcreate.py::test_eofcreate_invalid_index@bc691d13.

Generate fixtures for these test cases for Osaka with:

fill -v tests/osaka/eip7692_eof_v1/eip7620_eof_create/test_eofcreate.py::test_eofcreate_invalid_index --fork Osaka

EOFCREATE referring non-existent container section index.

Source code in tests/osaka/eip7692_eof_v1/eip7620_eof_create/test_eofcreate.py
594
595
596
597
598
599
600
601
602
603
604
605
606
607
@pytest.mark.parametrize("index", [0, 1, 255], ids=lambda x: x)
def test_eofcreate_invalid_index(
    eof_test: EOFTestFiller,
    index: int,
):
    """EOFCREATE referring non-existent container section index."""
    container = Container.Code(code=Op.EOFCREATE[index](0, 0, 0, 0) + Op.STOP)
    if index != 0:
        container.sections.append(Section.Container(container=Container.Code(Op.INVALID)))

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

Parametrized Test Cases

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

Test ID (Abbreviated) index
...fork_Osaka-eof_test-0 0
...fork_Osaka-eof_test-1 1
...fork_Osaka-eof_test-255 255
...fork_Osaka-state_test_from_eof_test-0 0
...fork_Osaka-state_test_from_eof_test-1 1
...fork_Osaka-state_test_from_eof_test-255 255
...fork_Osaka-blockchain_test_from_eof_test-0 0
...fork_Osaka-blockchain_test_from_eof_test-1 1
...fork_Osaka-blockchain_test_from_eof_test-255 255