Skip to content

test_touched_empty_account_never_persists()

Documentation for tests/mpt/test_account_trie_structure.py::test_touched_empty_account_never_persists@02aafd78.

Generate fixtures for these test cases for Bogota with:

fill -v tests/mpt/test_account_trie_structure.py::test_touched_empty_account_never_persists --fork Bogota

A zero-value call to a never-seen address creates no leaf.

pre: no leaf for the target post: none; EIP-161 removes the touched empty account

Source code in tests/mpt/test_account_trie_structure.py
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
def test_touched_empty_account_never_persists(
    state_test: StateTestFiller, pre: Alloc
) -> None:
    """
    A zero-value call to a never-seen address creates no leaf.

    pre:  no leaf for the target
    post: none; EIP-161 removes the touched empty account
    """
    target = pre.fund_eoa(amount=0)
    assert target not in pre

    state_test(
        pre=pre,
        tx=Transaction(sender=pre.fund_eoa(), to=target, value=0),
        post={target: Account.NONEXISTENT},
    )

Parametrized Test Cases

This test generates 1 parametrized test case across 3 forks.