Skip to content

test_simple_transfer_emits_log()

Documentation for tests/amsterdam/eip7708_eth_transfer_logs/test_transfer_logs.py::test_simple_transfer_emits_log@2119b382.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/amsterdam/eip7708_eth_transfer_logs/test_transfer_logs.py::test_simple_transfer_emits_log --fork Amsterdam

Test that a simple ETH transfer emits a transfer log.

Source code in tests/amsterdam/eip7708_eth_transfer_logs/test_transfer_logs.py
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
def test_simple_transfer_emits_log(
    state_test: StateTestFiller,
    env: Environment,
    pre: Alloc,
    sender: EOA,
) -> None:
    """Test that a simple ETH transfer emits a transfer log."""
    recipient = pre.nonexistent_account()

    tx = Transaction(
        sender=sender,
        to=recipient,
        value=1,
        expected_receipt=TransactionReceipt(
            logs=[transfer_log(sender, recipient, 1)]
        ),
    )

    post = {recipient: Account(balance=1)}
    state_test(env=env, pre=pre, post=post, tx=tx)

Parametrized Test Cases

This test generates 1 parametrized test case across 1 fork.