Skip to content

test_invalid_tx_max_fee_per_blob_gas_state()

Documentation for tests/cancun/eip4844_blobs/test_blob_txs.py::test_invalid_tx_max_fee_per_blob_gas_state@21507778.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/cancun/eip4844_blobs/test_blob_txs.py::test_invalid_tx_max_fee_per_blob_gas_state --fork Amsterdam

Reject an invalid blob transaction.

  • tx max_fee_per_blob_gas is barely not enough
  • tx max_fee_per_blob_gas is zero
Source code in tests/cancun/eip4844_blobs/test_blob_txs.py
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
@pytest.mark.parametrize_by_fork(
    "parent_excess_blobs,parent_blobs,tx_max_fee_per_blob_gas,tx_error",
    generate_invalid_tx_max_fee_per_blob_gas_tests,
)
@pytest.mark.state_test_only
@pytest.mark.valid_from("Cancun")
def test_invalid_tx_max_fee_per_blob_gas_state(
    state_test: StateTestFiller,
    state_env: Environment,
    pre: Alloc,
    txs: List[Transaction],
) -> None:
    """
    Reject an invalid blob transaction.

    - tx max_fee_per_blob_gas is barely not enough
    - tx max_fee_per_blob_gas is zero
    """
    assert len(txs) == 1
    state_test(
        pre=pre,
        post={},
        tx=txs[0],
        env=state_env,
    )

Parametrized Test Cases

This test generates 2 parametrized test cases across 4 forks.