Skip to content

test_call_types()

Documentation for tests/prague/eip2537_bls_12_381_precompiles/test_bls12_g1add.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_g1add.py::test_call_types --fork Prague

Test the BLS12_G1ADD precompile using different call types.

Source code in tests/prague/eip2537_bls_12_381_precompiles/test_bls12_g1add.py
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
@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 + Spec.INF_G1,
            Spec.INF_G1,
            id="inf_plus_inf",
        ),
        pytest.param(
            Spec.INF_G1 + Spec.G1,
            Spec.G1,
            id="inf_plus_generator",
        ),
    ],
)
def test_call_types(
    state_test: StateTestFiller,
    pre: Alloc,
    post: dict,
    tx: Transaction,
):
    """Test the BLS12_G1ADD 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-inf_plus_inf-call_opcode_STATICCALL- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 PointG1(x=0, y=0) STATICCALL 11
...fork_Prague-state_test-inf_plus_inf-call_opcode_DELEGATECALL- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 PointG1(x=0, y=0) DELEGATECALL 11
...fork_Prague-state_test-inf_plus_inf-call_opcode_CALLCODE- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 PointG1(x=0, y=0) CALLCODE 11
...fork_Prague-state_test-inf_plus_generator-call_opcode_STATICCALL- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 17f1d3a73197d7942695638c4fa9ac0f c3688c4f9774b905a14e3a3f171bac58 6c55e83ff97a1aeffb3af00adb22c6bb 00000000000000000000000000000000 08b3f481e3aaa0f1a09e30ed741d8ae4 fcf5e095d5d00af600db18cb2c04b3ed d03cc744a2888ae40caa232946c5e7e1 PointG1(x=3685416753713387016781088315183077757961620795782546409894578378688607592378376318836054947676345821548104185464507, y=1339506544944476473020471379941921221584933875938349620426543736416511423956333506472724655353366534992391756441569) STATICCALL 11
...fork_Prague-state_test-inf_plus_generator-call_opcode_DELEGATECALL- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 17f1d3a73197d7942695638c4fa9ac0f c3688c4f9774b905a14e3a3f171bac58 6c55e83ff97a1aeffb3af00adb22c6bb 00000000000000000000000000000000 08b3f481e3aaa0f1a09e30ed741d8ae4 fcf5e095d5d00af600db18cb2c04b3ed d03cc744a2888ae40caa232946c5e7e1 PointG1(x=3685416753713387016781088315183077757961620795782546409894578378688607592378376318836054947676345821548104185464507, y=1339506544944476473020471379941921221584933875938349620426543736416511423956333506472724655353366534992391756441569) DELEGATECALL 11
...fork_Prague-state_test-inf_plus_generator-call_opcode_CALLCODE- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 17f1d3a73197d7942695638c4fa9ac0f c3688c4f9774b905a14e3a3f171bac58 6c55e83ff97a1aeffb3af00adb22c6bb 00000000000000000000000000000000 08b3f481e3aaa0f1a09e30ed741d8ae4 fcf5e095d5d00af600db18cb2c04b3ed d03cc744a2888ae40caa232946c5e7e1 PointG1(x=3685416753713387016781088315183077757961620795782546409894578378688607592378376318836054947676345821548104185464507, y=1339506544944476473020471379941921221584933875938349620426543736416511423956333506472724655353366534992391756441569) CALLCODE 11
...fork_Prague-blockchain_test_from_state_test-inf_plus_inf-call_opcode_STATICCALL- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 PointG1(x=0, y=0) STATICCALL 11
...fork_Prague-blockchain_test_from_state_test-inf_plus_inf-call_opcode_DELEGATECALL- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 PointG1(x=0, y=0) DELEGATECALL 11
...fork_Prague-blockchain_test_from_state_test-inf_plus_inf-call_opcode_CALLCODE- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 PointG1(x=0, y=0) CALLCODE 11
...fork_Prague-blockchain_test_from_state_test-inf_plus_generator-call_opcode_STATICCALL- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 17f1d3a73197d7942695638c4fa9ac0f c3688c4f9774b905a14e3a3f171bac58 6c55e83ff97a1aeffb3af00adb22c6bb 00000000000000000000000000000000 08b3f481e3aaa0f1a09e30ed741d8ae4 fcf5e095d5d00af600db18cb2c04b3ed d03cc744a2888ae40caa232946c5e7e1 PointG1(x=3685416753713387016781088315183077757961620795782546409894578378688607592378376318836054947676345821548104185464507, y=1339506544944476473020471379941921221584933875938349620426543736416511423956333506472724655353366534992391756441569) STATICCALL 11
...fork_Prague-blockchain_test_from_state_test-inf_plus_generator-call_opcode_DELEGATECALL- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 17f1d3a73197d7942695638c4fa9ac0f c3688c4f9774b905a14e3a3f171bac58 6c55e83ff97a1aeffb3af00adb22c6bb 00000000000000000000000000000000 08b3f481e3aaa0f1a09e30ed741d8ae4 fcf5e095d5d00af600db18cb2c04b3ed d03cc744a2888ae40caa232946c5e7e1 PointG1(x=3685416753713387016781088315183077757961620795782546409894578378688607592378376318836054947676345821548104185464507, y=1339506544944476473020471379941921221584933875938349620426543736416511423956333506472724655353366534992391756441569) DELEGATECALL 11
...fork_Prague-blockchain_test_from_state_test-inf_plus_generator-call_opcode_CALLCODE- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 17f1d3a73197d7942695638c4fa9ac0f c3688c4f9774b905a14e3a3f171bac58 6c55e83ff97a1aeffb3af00adb22c6bb 00000000000000000000000000000000 08b3f481e3aaa0f1a09e30ed741d8ae4 fcf5e095d5d00af600db18cb2c04b3ed d03cc744a2888ae40caa232946c5e7e1 PointG1(x=3685416753713387016781088315183077757961620795782546409894578378688607592378376318836054947676345821548104185464507, y=1339506544944476473020471379941921221584933875938349620426543736416511423956333506472724655353366534992391756441569) CALLCODE 11
...fork_Osaka-state_test-inf_plus_inf-call_opcode_STATICCALL- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 PointG1(x=0, y=0) STATICCALL 11
...fork_Osaka-state_test-inf_plus_inf-call_opcode_DELEGATECALL- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 PointG1(x=0, y=0) DELEGATECALL 11
...fork_Osaka-state_test-inf_plus_inf-call_opcode_CALLCODE- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 PointG1(x=0, y=0) CALLCODE 11
...fork_Osaka-state_test-inf_plus_generator-call_opcode_STATICCALL- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 17f1d3a73197d7942695638c4fa9ac0f c3688c4f9774b905a14e3a3f171bac58 6c55e83ff97a1aeffb3af00adb22c6bb 00000000000000000000000000000000 08b3f481e3aaa0f1a09e30ed741d8ae4 fcf5e095d5d00af600db18cb2c04b3ed d03cc744a2888ae40caa232946c5e7e1 PointG1(x=3685416753713387016781088315183077757961620795782546409894578378688607592378376318836054947676345821548104185464507, y=1339506544944476473020471379941921221584933875938349620426543736416511423956333506472724655353366534992391756441569) STATICCALL 11
...fork_Osaka-state_test-inf_plus_generator-call_opcode_DELEGATECALL- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 17f1d3a73197d7942695638c4fa9ac0f c3688c4f9774b905a14e3a3f171bac58 6c55e83ff97a1aeffb3af00adb22c6bb 00000000000000000000000000000000 08b3f481e3aaa0f1a09e30ed741d8ae4 fcf5e095d5d00af600db18cb2c04b3ed d03cc744a2888ae40caa232946c5e7e1 PointG1(x=3685416753713387016781088315183077757961620795782546409894578378688607592378376318836054947676345821548104185464507, y=1339506544944476473020471379941921221584933875938349620426543736416511423956333506472724655353366534992391756441569) DELEGATECALL 11
...fork_Osaka-state_test-inf_plus_generator-call_opcode_CALLCODE- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 17f1d3a73197d7942695638c4fa9ac0f c3688c4f9774b905a14e3a3f171bac58 6c55e83ff97a1aeffb3af00adb22c6bb 00000000000000000000000000000000 08b3f481e3aaa0f1a09e30ed741d8ae4 fcf5e095d5d00af600db18cb2c04b3ed d03cc744a2888ae40caa232946c5e7e1 PointG1(x=3685416753713387016781088315183077757961620795782546409894578378688607592378376318836054947676345821548104185464507, y=1339506544944476473020471379941921221584933875938349620426543736416511423956333506472724655353366534992391756441569) CALLCODE 11
...fork_Osaka-blockchain_test_from_state_test-inf_plus_inf-call_opcode_STATICCALL- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 PointG1(x=0, y=0) STATICCALL 11
...fork_Osaka-blockchain_test_from_state_test-inf_plus_inf-call_opcode_DELEGATECALL- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 PointG1(x=0, y=0) DELEGATECALL 11
...fork_Osaka-blockchain_test_from_state_test-inf_plus_inf-call_opcode_CALLCODE- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 PointG1(x=0, y=0) CALLCODE 11
...fork_Osaka-blockchain_test_from_state_test-inf_plus_generator-call_opcode_STATICCALL- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 17f1d3a73197d7942695638c4fa9ac0f c3688c4f9774b905a14e3a3f171bac58 6c55e83ff97a1aeffb3af00adb22c6bb 00000000000000000000000000000000 08b3f481e3aaa0f1a09e30ed741d8ae4 fcf5e095d5d00af600db18cb2c04b3ed d03cc744a2888ae40caa232946c5e7e1 PointG1(x=3685416753713387016781088315183077757961620795782546409894578378688607592378376318836054947676345821548104185464507, y=1339506544944476473020471379941921221584933875938349620426543736416511423956333506472724655353366534992391756441569) STATICCALL 11
...fork_Osaka-blockchain_test_from_state_test-inf_plus_generator-call_opcode_DELEGATECALL- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 17f1d3a73197d7942695638c4fa9ac0f c3688c4f9774b905a14e3a3f171bac58 6c55e83ff97a1aeffb3af00adb22c6bb 00000000000000000000000000000000 08b3f481e3aaa0f1a09e30ed741d8ae4 fcf5e095d5d00af600db18cb2c04b3ed d03cc744a2888ae40caa232946c5e7e1 PointG1(x=3685416753713387016781088315183077757961620795782546409894578378688607592378376318836054947676345821548104185464507, y=1339506544944476473020471379941921221584933875938349620426543736416511423956333506472724655353366534992391756441569) DELEGATECALL 11
...fork_Osaka-blockchain_test_from_state_test-inf_plus_generator-call_opcode_CALLCODE- 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 17f1d3a73197d7942695638c4fa9ac0f c3688c4f9774b905a14e3a3f171bac58 6c55e83ff97a1aeffb3af00adb22c6bb 00000000000000000000000000000000 08b3f481e3aaa0f1a09e30ed741d8ae4 fcf5e095d5d00af600db18cb2c04b3ed d03cc744a2888ae40caa232946c5e7e1 PointG1(x=3685416753713387016781088315183077757961620795782546409894578378688607592378376318836054947676345821548104185464507, y=1339506544944476473020471379941921221584933875938349620426543736416511423956333506472724655353366534992391756441569) CALLCODE 11