Skip to content

test_call_types()

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

Test the BLS12_MAP_FP_TO_G2 precompile using different call types.

Source code in tests/prague/eip2537_bls_12_381_precompiles/test_bls12_map_fp2_to_g2.py
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
@pytest.mark.parametrize(
    "call_opcode",
    [
        Op.STATICCALL,
        Op.DELEGATECALL,
        Op.CALLCODE,
    ],
)
@pytest.mark.parametrize(
    "input_data,expected_output",
    [
        pytest.param(
            FP2((0, 0)),
            G2_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_G2 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- FP2(x=(0, 0)) PointG2(x=(232751224930677745396095561951152042576424604713130436843934548678666406429167866909490329228404544352148194115534, 1601558386896345240320690342453673501793035385728549575803514192020355846653238172333813953555511850549100476205202), y=(366072527324011932385571544496195798415567032250142018360048479110276041591259208603171511238009482094790662379841, 735055000775559535481906131992536480072884649650286758007297964611137923289749918348543505818551800823925955026780)) STATICCALL 17
...fork_Prague-state_test-fp_0-call_opcode_DELEGATECALL- FP2(x=(0, 0)) PointG2(x=(232751224930677745396095561951152042576424604713130436843934548678666406429167866909490329228404544352148194115534, 1601558386896345240320690342453673501793035385728549575803514192020355846653238172333813953555511850549100476205202), y=(366072527324011932385571544496195798415567032250142018360048479110276041591259208603171511238009482094790662379841, 735055000775559535481906131992536480072884649650286758007297964611137923289749918348543505818551800823925955026780)) DELEGATECALL 17
...fork_Prague-state_test-fp_0-call_opcode_CALLCODE- FP2(x=(0, 0)) PointG2(x=(232751224930677745396095561951152042576424604713130436843934548678666406429167866909490329228404544352148194115534, 1601558386896345240320690342453673501793035385728549575803514192020355846653238172333813953555511850549100476205202), y=(366072527324011932385571544496195798415567032250142018360048479110276041591259208603171511238009482094790662379841, 735055000775559535481906131992536480072884649650286758007297964611137923289749918348543505818551800823925955026780)) CALLCODE 17
...fork_Prague-blockchain_test_from_state_test-fp_0-call_opcode_STATICCALL- FP2(x=(0, 0)) PointG2(x=(232751224930677745396095561951152042576424604713130436843934548678666406429167866909490329228404544352148194115534, 1601558386896345240320690342453673501793035385728549575803514192020355846653238172333813953555511850549100476205202), y=(366072527324011932385571544496195798415567032250142018360048479110276041591259208603171511238009482094790662379841, 735055000775559535481906131992536480072884649650286758007297964611137923289749918348543505818551800823925955026780)) STATICCALL 17
...fork_Prague-blockchain_test_from_state_test-fp_0-call_opcode_DELEGATECALL- FP2(x=(0, 0)) PointG2(x=(232751224930677745396095561951152042576424604713130436843934548678666406429167866909490329228404544352148194115534, 1601558386896345240320690342453673501793035385728549575803514192020355846653238172333813953555511850549100476205202), y=(366072527324011932385571544496195798415567032250142018360048479110276041591259208603171511238009482094790662379841, 735055000775559535481906131992536480072884649650286758007297964611137923289749918348543505818551800823925955026780)) DELEGATECALL 17
...fork_Prague-blockchain_test_from_state_test-fp_0-call_opcode_CALLCODE- FP2(x=(0, 0)) PointG2(x=(232751224930677745396095561951152042576424604713130436843934548678666406429167866909490329228404544352148194115534, 1601558386896345240320690342453673501793035385728549575803514192020355846653238172333813953555511850549100476205202), y=(366072527324011932385571544496195798415567032250142018360048479110276041591259208603171511238009482094790662379841, 735055000775559535481906131992536480072884649650286758007297964611137923289749918348543505818551800823925955026780)) CALLCODE 17
...fork_Osaka-state_test-fp_0-call_opcode_STATICCALL- FP2(x=(0, 0)) PointG2(x=(232751224930677745396095561951152042576424604713130436843934548678666406429167866909490329228404544352148194115534, 1601558386896345240320690342453673501793035385728549575803514192020355846653238172333813953555511850549100476205202), y=(366072527324011932385571544496195798415567032250142018360048479110276041591259208603171511238009482094790662379841, 735055000775559535481906131992536480072884649650286758007297964611137923289749918348543505818551800823925955026780)) STATICCALL 17
...fork_Osaka-state_test-fp_0-call_opcode_DELEGATECALL- FP2(x=(0, 0)) PointG2(x=(232751224930677745396095561951152042576424604713130436843934548678666406429167866909490329228404544352148194115534, 1601558386896345240320690342453673501793035385728549575803514192020355846653238172333813953555511850549100476205202), y=(366072527324011932385571544496195798415567032250142018360048479110276041591259208603171511238009482094790662379841, 735055000775559535481906131992536480072884649650286758007297964611137923289749918348543505818551800823925955026780)) DELEGATECALL 17
...fork_Osaka-state_test-fp_0-call_opcode_CALLCODE- FP2(x=(0, 0)) PointG2(x=(232751224930677745396095561951152042576424604713130436843934548678666406429167866909490329228404544352148194115534, 1601558386896345240320690342453673501793035385728549575803514192020355846653238172333813953555511850549100476205202), y=(366072527324011932385571544496195798415567032250142018360048479110276041591259208603171511238009482094790662379841, 735055000775559535481906131992536480072884649650286758007297964611137923289749918348543505818551800823925955026780)) CALLCODE 17
...fork_Osaka-blockchain_test_from_state_test-fp_0-call_opcode_STATICCALL- FP2(x=(0, 0)) PointG2(x=(232751224930677745396095561951152042576424604713130436843934548678666406429167866909490329228404544352148194115534, 1601558386896345240320690342453673501793035385728549575803514192020355846653238172333813953555511850549100476205202), y=(366072527324011932385571544496195798415567032250142018360048479110276041591259208603171511238009482094790662379841, 735055000775559535481906131992536480072884649650286758007297964611137923289749918348543505818551800823925955026780)) STATICCALL 17
...fork_Osaka-blockchain_test_from_state_test-fp_0-call_opcode_DELEGATECALL- FP2(x=(0, 0)) PointG2(x=(232751224930677745396095561951152042576424604713130436843934548678666406429167866909490329228404544352148194115534, 1601558386896345240320690342453673501793035385728549575803514192020355846653238172333813953555511850549100476205202), y=(366072527324011932385571544496195798415567032250142018360048479110276041591259208603171511238009482094790662379841, 735055000775559535481906131992536480072884649650286758007297964611137923289749918348543505818551800823925955026780)) DELEGATECALL 17
...fork_Osaka-blockchain_test_from_state_test-fp_0-call_opcode_CALLCODE- FP2(x=(0, 0)) PointG2(x=(232751224930677745396095561951152042576424604713130436843934548678666406429167866909490329228404544352148194115534, 1601558386896345240320690342453673501793035385728549575803514192020355846653238172333813953555511850549100476205202), y=(366072527324011932385571544496195798415567032250142018360048479110276041591259208603171511238009482094790662379841, 735055000775559535481906131992536480072884649650286758007297964611137923289749918348543505818551800823925955026780)) CALLCODE 17