Skip to content

test_invalid_zero_length_g1msm()

Documentation for tests/prague/eip2537_bls_12_381_precompiles/test_bls12_variable_length_input_contracts.py::test_invalid_zero_length_g1msm@343274cc.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/prague/eip2537_bls_12_381_precompiles/test_bls12_variable_length_input_contracts.py::test_invalid_zero_length_g1msm --fork Amsterdam

Test the BLS12_G1MSM precompile by passing an input with zero length.

Source code in tests/prague/eip2537_bls_12_381_precompiles/test_bls12_variable_length_input_contracts.py
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
@pytest.mark.parametrize(
    "precompile_gas_list,precompile_data_length_list",
    [
        pytest.param(
            [G1_GAS(G1_MSM_K_INPUT_LENGTH)],
            [0],
            id="zero_length_input",
        ),
    ],
)
@pytest.mark.parametrize("expected_output", [Spec.INVALID], ids=[""])
@pytest.mark.parametrize("precompile_address", [Spec.G1MSM])
def test_invalid_zero_length_g1msm(
    state_test: StateTestFiller,
    pre: Alloc,
    post: dict,
    tx: Transaction,
) -> None:
    """Test the BLS12_G1MSM precompile by passing an input with zero length."""
    state_test(
        pre=pre,
        tx=tx,
        post=post,
    )

Parametrized Test Cases

This test generates 1 parametrized test case across 3 forks.