@pytest.mark.parametrize(
"input_data, expected_output, precompile_gas_modifier",
[
pytest.param(
b"",
Spec.INVALID,
-1,
id="empty_data_insufficient_gas",
),
pytest.param(
Spec.G1 + Spec.G2,
Spec.INVALID,
-1,
id="one_pair_insufficient_gas",
),
pytest.param(
Spec.G1 + Spec.G2 + PointG1(0x1, Spec.P - 2) + Spec.G2,
Spec.INVALID,
-1,
id="two_point_oog",
),
],
)
@pytest.mark.ported_from(
[
"https://github.com/ethereum/legacytests/tree/master/Cancun/GeneralStateTests/stZeroKnowledge/ecpairing_empty_data_insufficient_gasFiller.json",
"https://github.com/ethereum/legacytests/tree/master/Cancun/GeneralStateTests/stZeroKnowledge/ecpairing_one_point_insufficient_gasFiller.json",
"https://github.com/ethereum/legacytests/tree/master/Cancun/GeneralStateTests/stZeroKnowledge/ecpairing_two_point_oogFiller.json",
],
pr=["https://github.com/ethereum/execution-specs/pull/2422"],
)
def test_gas(
state_test: StateTestFiller,
pre: Alloc,
post: dict,
tx: Transaction,
) -> None:
"""Test gas combinations to the ecpairing precompile."""
state_test(
env=Environment(),
pre=pre,
tx=tx,
post=post,
)