Skip to content

test_call_types()

Documentation for tests/prague/eip2537_bls_12_381_precompiles/test_bls12_g1mul.py::test_call_types@bc691d13.

Generate fixtures for these test cases for Prague with:

fill -v tests/prague/eip2537_bls_12_381_precompiles/test_bls12_g1mul.py::test_call_types --fork Prague

Test the BLS12_G1MUL precompile using different call types.

Source code in tests/prague/eip2537_bls_12_381_precompiles/test_bls12_g1mul.py
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
@pytest.mark.parametrize(
    "call_opcode",  # Note `Op.CALL` is used for all the `test_valid` cases.
    [
        Op.STATICCALL,
        Op.DELEGATECALL,
        Op.CALLCODE,
    ],
)
@pytest.mark.parametrize(
    "input_data,expected_output",
    [
        pytest.param(
            Spec.INF_G1 + Scalar(0),
            Spec.INF_G1,
            id="zero_times_inf",
        ),
        pytest.param(
            Spec.INF_G1 + Scalar(2),
            Spec.INF_G1,
            id="two_times_inf",
        ),
    ],
)
def test_call_types(
    state_test: StateTestFiller,
    pre: Alloc,
    post: dict,
    tx: Transaction,
):
    """Test the BLS12_G1MUL precompile using different call types."""
    state_test(
        env=Environment(),
        pre=pre,
        tx=tx,
        post=post,
    )

Parametrized Test Cases

The interactive table below is also available as a standalone page.

Test ID (Abbreviated) input_data expected_output call_opcode precompile_address
...fork_Prague-state_test-zero_times_inf-call_opcode_STATICCALL- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 PointG1(x=0, y=0) STATICCALL 12
...fork_Prague-state_test-zero_times_inf-call_opcode_DELEGATECALL- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 PointG1(x=0, y=0) DELEGATECALL 12
...fork_Prague-state_test-zero_times_inf-call_opcode_CALLCODE- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 PointG1(x=0, y=0) CALLCODE 12
...fork_Prague-state_test-two_times_inf-call_opcode_STATICCALL- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000002 PointG1(x=0, y=0) STATICCALL 12
...fork_Prague-state_test-two_times_inf-call_opcode_DELEGATECALL- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000002 PointG1(x=0, y=0) DELEGATECALL 12
...fork_Prague-state_test-two_times_inf-call_opcode_CALLCODE- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000002 PointG1(x=0, y=0) CALLCODE 12
...fork_Prague-blockchain_test_from_state_test-zero_times_inf-call_opcode_STATICCALL- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 PointG1(x=0, y=0) STATICCALL 12
...fork_Prague-blockchain_test_from_state_test-zero_times_inf-call_opcode_DELEGATECALL- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 PointG1(x=0, y=0) DELEGATECALL 12
...fork_Prague-blockchain_test_from_state_test-zero_times_inf-call_opcode_CALLCODE- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 PointG1(x=0, y=0) CALLCODE 12
...fork_Prague-blockchain_test_from_state_test-two_times_inf-call_opcode_STATICCALL- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000002 PointG1(x=0, y=0) STATICCALL 12
...fork_Prague-blockchain_test_from_state_test-two_times_inf-call_opcode_DELEGATECALL- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000002 PointG1(x=0, y=0) DELEGATECALL 12
...fork_Prague-blockchain_test_from_state_test-two_times_inf-call_opcode_CALLCODE- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000002 PointG1(x=0, y=0) CALLCODE 12
...fork_Osaka-state_test-zero_times_inf-call_opcode_STATICCALL- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 PointG1(x=0, y=0) STATICCALL 12
...fork_Osaka-state_test-zero_times_inf-call_opcode_DELEGATECALL- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 PointG1(x=0, y=0) DELEGATECALL 12
...fork_Osaka-state_test-zero_times_inf-call_opcode_CALLCODE- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 PointG1(x=0, y=0) CALLCODE 12
...fork_Osaka-state_test-two_times_inf-call_opcode_STATICCALL- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000002 PointG1(x=0, y=0) STATICCALL 12
...fork_Osaka-state_test-two_times_inf-call_opcode_DELEGATECALL- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000002 PointG1(x=0, y=0) DELEGATECALL 12
...fork_Osaka-state_test-two_times_inf-call_opcode_CALLCODE- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000002 PointG1(x=0, y=0) CALLCODE 12
...fork_Osaka-blockchain_test_from_state_test-zero_times_inf-call_opcode_STATICCALL- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 PointG1(x=0, y=0) STATICCALL 12
...fork_Osaka-blockchain_test_from_state_test-zero_times_inf-call_opcode_DELEGATECALL- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 PointG1(x=0, y=0) DELEGATECALL 12
...fork_Osaka-blockchain_test_from_state_test-zero_times_inf-call_opcode_CALLCODE- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 PointG1(x=0, y=0) CALLCODE 12
...fork_Osaka-blockchain_test_from_state_test-two_times_inf-call_opcode_STATICCALL- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000002 PointG1(x=0, y=0) STATICCALL 12
...fork_Osaka-blockchain_test_from_state_test-two_times_inf-call_opcode_DELEGATECALL- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000002 PointG1(x=0, y=0) DELEGATECALL 12
...fork_Osaka-blockchain_test_from_state_test-two_times_inf-call_opcode_CALLCODE- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000002 PointG1(x=0, y=0) CALLCODE 12