Skip to content

test_delete_from_genesis_trie()

Documentation for tests/mpt/test_storage_trie_structure.py::test_delete_from_genesis_trie@02aafd78.

Generate fixtures for these test cases for Bogota with:

fill -v tests/mpt/test_storage_trie_structure.py::test_delete_from_genesis_trie --fork Bogota

Zero one slot of a storage trie committed at genesis.

Each DELETE_CASES row gives the path before and after the delete; the rows cover every survivor kind under every parent kind.

Source code in tests/mpt/test_storage_trie_structure.py
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
@pytest.mark.parametrize(
    "group,target,along,pre_shape,post_shape", DELETE_CASES
)
def test_delete_from_genesis_trie(
    state_test: StateTestFiller,
    pre: Alloc,
    group: Sequence[int],
    target: int,
    along: int,
    pre_shape: Shape,
    post_shape: Shape,
) -> None:
    """
    Zero one slot of a storage trie committed at genesis.

    Each `DELETE_CASES` row gives the path before and after the delete;
    the rows cover every survivor kind under every parent kind.
    """
    storage, remaining = _delete_case(
        group, target, along, pre_shape, post_shape
    )
    contract = pre.deploy_contract(
        code=_writer_code([(target, 0)]), storage=storage
    )

    state_test(
        pre=pre,
        tx=Transaction(sender=pre.fund_eoa(), to=contract),
        post={contract: Account(storage=remaining)},
    )

Parametrized Test Cases

This test generates 14 parametrized test cases across 3 forks.