Skip to content

test_modexp_boundary()

Documentation for tests/osaka/eip7823_modexp_upper_bounds/test_eip_mainnet.py::test_modexp_boundary@892e6d1e.

Generate fixtures for these test cases for Osaka with:

fill -v tests/osaka/eip7823_modexp_upper_bounds/test_eip_mainnet.py::test_modexp_boundary --fork Osaka

Mainnet test at the 1024-byte boundary.

Tests that the ModExp precompile correctly handles input at the maximum allowed length (1024 bytes) per EIP-7823.

Source code in tests/osaka/eip7823_modexp_upper_bounds/test_eip_mainnet.py
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
@pytest.mark.parametrize(
    "modexp_input,modexp_expected",
    [
        pytest.param(
            ModExpInput(
                base=b"\x01" * Spec.MAX_LENGTH_BYTES,
                exponent=b"\x00",
                modulus=b"\x02",
            ),
            ModExpOutput(
                call_success=True,
                returned_data="0x01",
            ),
            id="base-boundary-1024-bytes",
        ),
    ],
)
def test_modexp_boundary(
    state_test: StateTestFiller,
    pre: Alloc,
    tx: Transaction,
    post: Dict,
) -> None:
    """
    Mainnet test at the 1024-byte boundary.

    Tests that the ModExp precompile correctly handles input at the maximum
    allowed length (1024 bytes) per EIP-7823.
    """
    state_test(pre=pre, tx=tx, post=post)

Parametrized Test Cases

This test generates 1 parametrized test case across 1 fork.