Skip to content

test_vectors_from_eip()

Documentation for tests/osaka/eip7883_modexp_gas_increase/test_modexp_thresholds.py::test_vectors_from_eip@892e6d1e.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/osaka/eip7883_modexp_gas_increase/test_modexp_thresholds.py::test_vectors_from_eip --fork Amsterdam

Test ModExp gas cost using the test vectors from EIP-7883.

Source code in tests/osaka/eip7883_modexp_gas_increase/test_modexp_thresholds.py
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
@pytest.mark.parametrize(
    "modexp_input,modexp_expected,gas_old,gas_new",
    vectors_from_file("vectors.json"),
    ids=lambda v: v.name,
)
@EIPChecklist.Precompile.Test.Inputs.Valid()
@EIPChecklist.Precompile.Test.InputLengths.Dynamic.Valid()
@EIPChecklist.GasCostChanges.Test.GasUpdatesMeasurement()
@pytest.mark.valid_from("Berlin")
@pytest.mark.slow()
def test_vectors_from_eip(
    state_test: StateTestFiller,
    pre: Alloc,
    tx: Transaction,
    post: Dict,
) -> None:
    """Test ModExp gas cost using the test vectors from EIP-7883."""
    state_test(
        pre=pre,
        tx=tx,
        post=post,
    )

Parametrized Test Cases

This test generates 46 parametrized test cases across 8 forks.