Skip to content

test_call_opcode_types()

Documentation for tests/cancun/eip4844_blobs/test_point_evaluation_precompile.py::test_call_opcode_types@21507778.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/cancun/eip4844_blobs/test_point_evaluation_precompile.py::test_call_opcode_types --fork Amsterdam

Test calling the Point Evaluation Precompile with different call types, gas and parameter configuration.

  • Using CALL, DELEGATECALL, CALLCODE and STATICCALL.
  • Using correct and incorrect proofs
  • Using barely insufficient gas
Source code in tests/cancun/eip4844_blobs/test_point_evaluation_precompile.py
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
@pytest.mark.parametrize(
    "call_gas,y,result",
    [
        (Spec.POINT_EVALUATION_PRECOMPILE_GAS, 0, Result.SUCCESS),
        (Spec.POINT_EVALUATION_PRECOMPILE_GAS, 1, Result.FAILURE),
        (Spec.POINT_EVALUATION_PRECOMPILE_GAS - 1, 0, Result.OUT_OF_GAS),
    ],
    ids=["correct", "incorrect", "insufficient_gas"],
)
@pytest.mark.with_all_call_opcodes
@pytest.mark.parametrize(
    "z,kzg_commitment,kzg_proof,versioned_hash",
    [[Z, INF_POINT, INF_POINT, None]],
    ids=[""],
)
@pytest.mark.valid_from("Cancun")
def test_call_opcode_types(
    state_test: StateTestFiller,
    pre: Alloc,
    tx: Transaction,
    post: Dict,
) -> None:
    """
    Test calling the Point Evaluation Precompile with different call types, gas
    and parameter configuration.

    - Using CALL, DELEGATECALL, CALLCODE and STATICCALL.
    - Using correct and incorrect proofs
    - Using barely insufficient gas
    """
    state_test(
        env=Environment(),
        pre=pre,
        post=post,
        tx=tx,
    )

Parametrized Test Cases

This test generates 12 parametrized test cases across 4 forks.