Skip to content

test_bal_empty_block_no_coinbase()

Documentation for tests/amsterdam/eip7928_block_level_access_lists/test_block_access_lists.py::test_bal_empty_block_no_coinbase@5c024cbb.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/amsterdam/eip7928_block_level_access_lists/test_block_access_lists.py::test_bal_empty_block_no_coinbase --fork Amsterdam

Ensure BAL correctly handles empty blocks without including coinbase.

When a block has no transactions and no withdrawals, the coinbase/fee recipient receives no fees and should not be included in the BAL.

Source code in tests/amsterdam/eip7928_block_level_access_lists/test_block_access_lists.py
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
def test_bal_empty_block_no_coinbase(
    pre: Alloc,
    blockchain_test: BlockchainTestFiller,
) -> None:
    """
    Ensure BAL correctly handles empty blocks without including coinbase.

    When a block has no transactions and no withdrawals, the coinbase/fee
    recipient receives no fees and should not be included in the BAL.
    """
    coinbase = pre.fund_eoa(amount=0)

    block = Block(
        txs=[],
        withdrawals=None,
        fee_recipient=coinbase,
        expected_block_access_list=BlockAccessListExpectation(
            account_expectations={
                # Coinbase must NOT be included - receives no fees
                coinbase: None,
            }
        ),
    )

    blockchain_test(pre=pre, blocks=[block], post={})

Parametrized Test Cases

This test generates 1 parametrized test case across 1 fork.