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@bfe359d3.

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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
@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(
            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