Skip to content

test_bal_2930_account_listed_but_untouched()

Documentation for tests/amsterdam/eip7928_block_level_access_lists/test_block_access_lists.py::test_bal_2930_account_listed_but_untouched@c74f1a67.

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_2930_account_listed_but_untouched --fork Amsterdam

Ensure BAL excludes untouched access list accounts.

Source code in tests/amsterdam/eip7928_block_level_access_lists/test_block_access_lists.py
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
def test_bal_2930_account_listed_but_untouched(
    pre: Alloc,
    blockchain_test: BlockchainTestFiller,
) -> None:
    """Ensure BAL excludes untouched access list accounts."""
    alice = pre.fund_eoa()
    bob = pre.fund_eoa()
    oracle = pre.deploy_contract(code=Op.STOP)

    access_list = AccessList(
        address=oracle,
        storage_keys=[Hash(0x1)],
    )

    tx = Transaction(
        ty=1,
        sender=alice,
        to=bob,
        access_list=[access_list],
    )

    block = Block(
        txs=[tx],
        expected_block_access_list=BlockAccessListExpectation(
            account_expectations={
                alice: BalAccountExpectation(
                    nonce_changes=[
                        BalNonceChange(block_access_index=1, post_nonce=1)
                    ],
                ),
                # The address excluded from BAL since state is not accessed
                oracle: None,
            }
        ),
    )

    blockchain_test(
        pre=pre,
        blocks=[block],
        post={
            alice: Account(nonce=1),
        },
    )

Parametrized Test Cases

This test generates 1 parametrized test case across 1 fork.