@pytest.mark.parametrize(
"input_data,expected_output,precompile_gas_modifier,call_succeeds",
[
pytest.param(
Spec.H0 + Spec.R0 + Spec.S0 + Spec.X0 + Spec.Y0,
Spec.SUCCESS_RETURN_VALUE,
1,
True,
id="extra_gas",
),
pytest.param(
Spec.H0 + Spec.R0 + Spec.S0 + Spec.X0 + Spec.Y0,
Spec.INVALID_RETURN_VALUE,
-1,
False,
id="insufficient_gas",
),
pytest.param(
Spec.H0 + Spec.R0 + Spec.S0 + Spec.X0 + Spec.Y0,
Spec.INVALID_RETURN_VALUE,
-6900,
False,
id="zero_gas",
),
pytest.param(
Spec.H0 + Spec.R0 + Spec.S0 + Spec.X0 + Spec.Y0,
Spec.INVALID_RETURN_VALUE,
-3450,
False,
id="3450_gas",
),
],
)
@pytest.mark.parametrize("precompile_address", [Spec.P256VERIFY], ids=[""])
@EIPChecklist.Precompile.Test.GasUsage.Constant.Exact()
@EIPChecklist.Precompile.Test.GasUsage.Constant.Oog()
def test_gas(
state_test: StateTestFiller, pre: Alloc, post: dict, tx: Transaction
) -> None:
"""Test P256Verify precompile gas requirements."""
state_test(env=Environment(), pre=pre, post=post, tx=tx)