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@01f496f4.

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
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
@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