Skip to content

test_vectors_from_legacy_tests()

Documentation for tests/osaka/eip7883_modexp_gas_increase/test_modexp_thresholds.py::test_vectors_from_legacy_tests@20373115.

Generate fixtures for these test cases for Amsterdam with:

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

Test ModExp gas cost using the test vectors from legacy tests.

Source code in tests/osaka/eip7883_modexp_gas_increase/test_modexp_thresholds.py
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
@pytest.mark.parametrize(
    "modexp_input,modexp_expected,gas_old,gas_new",
    vectors_from_file("legacy.json"),
    ids=lambda v: v.name,
)
@EIPChecklist.Precompile.Test.Inputs.Invalid()
@pytest.mark.valid_from("Berlin")
def test_vectors_from_legacy_tests(
    state_test: StateTestFiller,
    pre: Alloc,
    tx: Transaction,
    post: Dict,
) -> None:
    """Test ModExp gas cost using the test vectors from legacy tests."""
    state_test(
        pre=pre,
        tx=tx,
        post=post,
    )

Parametrized Test Cases

This test generates 32 parametrized test cases across 8 forks.