Skip to content

test_invalid_code_section_index()

Documentation for tests/osaka/eip7692_eof_v1/eip4750_functions/test_code_validation.py::test_invalid_code_section_index@bc691d13.

Generate fixtures for these test cases for Osaka with:

fill -v tests/osaka/eip7692_eof_v1/eip4750_functions/test_code_validation.py::test_invalid_code_section_index --fork Osaka

Test cases for CALLF instructions with invalid target code section index.

Source code in tests/osaka/eip7692_eof_v1/eip4750_functions/test_code_validation.py
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
@pytest.mark.parametrize(
    "container",
    [
        Container(
            name="callf1",  # EOF1I4750_0010
            sections=[
                Section.Code(
                    Op.CALLF[1] + Op.STOP,
                )
            ],
        ),
        Container(
            name="callf2",  # EOF1I0011
            sections=[
                Section.Code(
                    Op.CALLF[2] + Op.STOP,
                ),
                Section.Code(
                    Op.RETF,
                    code_outputs=0,
                ),
            ],
        ),
        Container(
            name="callf1_callf2",
            sections=[
                Section.Code(
                    Op.CALLF[1] + Op.STOP,
                ),
                Section.Code(
                    Op.CALLF[2] + Op.RETF,
                    code_outputs=0,
                ),
            ],
        ),
    ],
    ids=container_name,
)
def test_invalid_code_section_index(
    eof_test: EOFTestFiller,
    container: Container,
):
    """Test cases for CALLF instructions with invalid target code section index."""
    eof_test(container=container, expect_exception=EOFException.INVALID_CODE_SECTION_INDEX)

Parametrized Test Cases

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

Test ID (Abbreviated) container
...fork_Osaka-eof_test-callf1 callf1
...fork_Osaka-eof_test-callf2 callf2
...fork_Osaka-eof_test-callf1_callf2 callf1_callf2
...fork_Osaka-state_test_from_eof_test-callf1 callf1
...fork_Osaka-state_test_from_eof_test-callf2 callf2
...fork_Osaka-state_test_from_eof_test-callf1_callf2 callf1_callf2
...fork_Osaka-blockchain_test_from_eof_test-callf1 callf1
...fork_Osaka-blockchain_test_from_eof_test-callf2 callf2
...fork_Osaka-blockchain_test_from_eof_test-callf1_callf2 callf1_callf2