Skip to content

test_invalid_zero_length_g2msm()

Documentation for tests/prague/eip2537_bls_12_381_precompiles/test_bls12_variable_length_input_contracts.py::test_invalid_zero_length_g2msm@88e9fb8f.

Generate fixtures for these test cases for Osaka with:

fill -v tests/prague/eip2537_bls_12_381_precompiles/test_bls12_variable_length_input_contracts.py::test_invalid_zero_length_g2msm --fork Osaka

Test the BLS12_G2MSM 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
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
@pytest.mark.parametrize(
    "precompile_gas_list,precompile_data_length_list",
    [
        pytest.param(
            [G2_GAS(G2_MSM_K_INPUT_LENGTH)],
            [0],
            id="zero_length_input",
        ),
    ],
)
@pytest.mark.parametrize("expected_output", [Spec.INVALID], ids=[""])
@pytest.mark.parametrize("precompile_address", [Spec.G2MSM])
def test_invalid_zero_length_g2msm(
    state_test: StateTestFiller,
    env: Environment,
    pre: Alloc,
    post: dict,
    tx: Transaction,
) -> None:
    """Test the BLS12_G2MSM precompile by passing an input with zero length."""
    state_test(
        env=env,
        pre=pre,
        tx=tx,
        post=post,
    )

Parametrized Test Cases

This test case is only parametrized by fork and fixture format.

Test ID (Abbreviated) precompile_address expected_output precompile_gas_list precompile_data_length_list
...fork_Prague-state_test-precompile_address_14--zero_length_input 14 [22500] [0]
...fork_Prague-blockchain_test_from_state_test-precompile_address_14--zero_length_input 14 [22500] [0]
...fork_Osaka-state_test-precompile_address_14--zero_length_input 14 [22500] [0]
...fork_Osaka-blockchain_test_from_state_test-precompile_address_14--zero_length_input 14 [22500] [0]