Skip to content

test_invalid_normal_gas()

Documentation for tests/cancun/eip4844_blobs/test_blob_txs.py::test_invalid_normal_gas@83970623.

Generate fixtures for these test cases for Prague with:

fill -v tests/cancun/eip4844_blobs/test_blob_txs.py::test_invalid_normal_gas --fork Prague

Reject an invalid blob transaction.

  • Sufficient max fee per blob gas, but insufficient max fee per gas
Source code in tests/cancun/eip4844_blobs/test_blob_txs.py
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
@pytest.mark.parametrize(
    "tx_max_fee_per_gas,tx_error",
    [
        # max blob gas is ok, but max fee per gas is less than base fee per gas
        (
            6,
            TransactionException.INSUFFICIENT_MAX_FEE_PER_GAS,
        ),
    ],
    ids=["insufficient_max_fee_per_gas"],
)
@pytest.mark.valid_from("Cancun")
def test_invalid_normal_gas(
    state_test: StateTestFiller,
    state_env: Environment,
    pre: Alloc,
    txs: List[Transaction],
    header_verify: Optional[Header],
    rlp_modifier: Optional[Header],
):
    """
    Reject an invalid blob transaction.

    - Sufficient max fee per blob gas, but insufficient max fee per gas
    """
    assert len(txs) == 1
    state_test(
        pre=pre,
        post={},
        tx=txs[0],
        env=state_env,
        blockchain_test_header_verify=header_verify,
        blockchain_test_rlp_modifier=rlp_modifier,
    )

Parametrized Test Cases

This test case is only parametrized by fork and fixture format.

Test ID (Abbreviated) tx_max_fee_per_gas tx_error
...fork_Cancun-blockchain_test-insufficient_max_fee_per_gas 6 TransactionException.INSUFFICIENT_MAX_FEE_PER_GAS
...fork_Cancun-state_test-insufficient_max_fee_per_gas 6 TransactionException.INSUFFICIENT_MAX_FEE_PER_GAS
...fork_Prague-blockchain_test-insufficient_max_fee_per_gas 6 TransactionException.INSUFFICIENT_MAX_FEE_PER_GAS
...fork_Prague-state_test-insufficient_max_fee_per_gas 6 TransactionException.INSUFFICIENT_MAX_FEE_PER_GAS
...fork_Osaka-blockchain_test-insufficient_max_fee_per_gas 6 TransactionException.INSUFFICIENT_MAX_FEE_PER_GAS
...fork_Osaka-state_test-insufficient_max_fee_per_gas 6 TransactionException.INSUFFICIENT_MAX_FEE_PER_GAS