Skip to content

test_gas()

Documentation for tests/prague/eip2537_bls_12_381_precompiles/test_bls12_map_fp2_to_g2.py::test_gas@892e6d1e.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/prague/eip2537_bls_12_381_precompiles/test_bls12_map_fp2_to_g2.py::test_gas --fork Amsterdam

Test the BLS12_MAP_FP_TO_G2 precompile gas requirements.

Source code in tests/prague/eip2537_bls_12_381_precompiles/test_bls12_map_fp2_to_g2.py
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
@pytest.mark.parametrize(
    "input_data,expected_output,precompile_gas_modifier",
    [
        pytest.param(
            FP2((0, 0)),
            G2_POINT_ZERO_FP,
            1,
            id="extra_gas",
        ),
        pytest.param(
            FP2((0, 0)),
            Spec.INVALID,
            -1,
            id="insufficient_gas",
        ),
    ],
)
def test_gas(
    state_test: StateTestFiller,
    pre: Alloc,
    post: dict,
    tx: Transaction,
) -> None:
    """Test the BLS12_MAP_FP_TO_G2 precompile gas requirements."""
    state_test(
        env=Environment(),
        pre=pre,
        tx=tx,
        post=post,
    )

Parametrized Test Cases

This test generates 2 parametrized test cases across 3 forks.