Skip to content

test_call_types()

Documentation for tests/prague/eip2537_bls_12_381_precompiles/test_bls12_map_fp_to_g1.py::test_call_types@21fb11c8.

Generate fixtures for these test cases for Prague with:

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

Test the BLS12_MAP_FP_TO_G1 precompile using different call types.

Source code in tests/prague/eip2537_bls_12_381_precompiles/test_bls12_map_fp_to_g1.py
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
@pytest.mark.parametrize(
    "call_opcode",
    [
        Op.STATICCALL,
        Op.DELEGATECALL,
        Op.CALLCODE,
    ],
)
@pytest.mark.parametrize(
    "input_data,expected_output",
    [
        pytest.param(
            FP(0),
            G1_POINT_ZERO_FP,
            id="fp_0",
        ),
    ],
)
def test_call_types(
    state_test: StateTestFiller,
    pre: Alloc,
    post: dict,
    tx: Transaction,
):
    """Test the BLS12_MAP_FP_TO_G1 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-fp_0-call_opcode_STATICCALL- FP(x=0) PointG1(x=2718523093224377422680924513836569955862094615601650617640302534610709548675950121390173489943242206205504662709269, y=1411717398097673129936182529224644864953905593399347218631786464447277645552464825136124091127047943658180991656243) STATICCALL 16
...fork_Prague-state_test-fp_0-call_opcode_DELEGATECALL- FP(x=0) PointG1(x=2718523093224377422680924513836569955862094615601650617640302534610709548675950121390173489943242206205504662709269, y=1411717398097673129936182529224644864953905593399347218631786464447277645552464825136124091127047943658180991656243) DELEGATECALL 16
...fork_Prague-state_test-fp_0-call_opcode_CALLCODE- FP(x=0) PointG1(x=2718523093224377422680924513836569955862094615601650617640302534610709548675950121390173489943242206205504662709269, y=1411717398097673129936182529224644864953905593399347218631786464447277645552464825136124091127047943658180991656243) CALLCODE 16
...fork_Prague-blockchain_test_from_state_test-fp_0-call_opcode_STATICCALL- FP(x=0) PointG1(x=2718523093224377422680924513836569955862094615601650617640302534610709548675950121390173489943242206205504662709269, y=1411717398097673129936182529224644864953905593399347218631786464447277645552464825136124091127047943658180991656243) STATICCALL 16
...fork_Prague-blockchain_test_from_state_test-fp_0-call_opcode_DELEGATECALL- FP(x=0) PointG1(x=2718523093224377422680924513836569955862094615601650617640302534610709548675950121390173489943242206205504662709269, y=1411717398097673129936182529224644864953905593399347218631786464447277645552464825136124091127047943658180991656243) DELEGATECALL 16
...fork_Prague-blockchain_test_from_state_test-fp_0-call_opcode_CALLCODE- FP(x=0) PointG1(x=2718523093224377422680924513836569955862094615601650617640302534610709548675950121390173489943242206205504662709269, y=1411717398097673129936182529224644864953905593399347218631786464447277645552464825136124091127047943658180991656243) CALLCODE 16
...fork_Osaka-state_test-fp_0-call_opcode_STATICCALL- FP(x=0) PointG1(x=2718523093224377422680924513836569955862094615601650617640302534610709548675950121390173489943242206205504662709269, y=1411717398097673129936182529224644864953905593399347218631786464447277645552464825136124091127047943658180991656243) STATICCALL 16
...fork_Osaka-state_test-fp_0-call_opcode_DELEGATECALL- FP(x=0) PointG1(x=2718523093224377422680924513836569955862094615601650617640302534610709548675950121390173489943242206205504662709269, y=1411717398097673129936182529224644864953905593399347218631786464447277645552464825136124091127047943658180991656243) DELEGATECALL 16
...fork_Osaka-state_test-fp_0-call_opcode_CALLCODE- FP(x=0) PointG1(x=2718523093224377422680924513836569955862094615601650617640302534610709548675950121390173489943242206205504662709269, y=1411717398097673129936182529224644864953905593399347218631786464447277645552464825136124091127047943658180991656243) CALLCODE 16
...fork_Osaka-blockchain_test_from_state_test-fp_0-call_opcode_STATICCALL- FP(x=0) PointG1(x=2718523093224377422680924513836569955862094615601650617640302534610709548675950121390173489943242206205504662709269, y=1411717398097673129936182529224644864953905593399347218631786464447277645552464825136124091127047943658180991656243) STATICCALL 16
...fork_Osaka-blockchain_test_from_state_test-fp_0-call_opcode_DELEGATECALL- FP(x=0) PointG1(x=2718523093224377422680924513836569955862094615601650617640302534610709548675950121390173489943242206205504662709269, y=1411717398097673129936182529224644864953905593399347218631786464447277645552464825136124091127047943658180991656243) DELEGATECALL 16
...fork_Osaka-blockchain_test_from_state_test-fp_0-call_opcode_CALLCODE- FP(x=0) PointG1(x=2718523093224377422680924513836569955862094615601650617640302534610709548675950121390173489943242206205504662709269, y=1411717398097673129936182529224644864953905593399347218631786464447277645552464825136124091127047943658180991656243) CALLCODE 16