Skip to content

test_call_opcode_types()

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

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
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
@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.