Skip to content

test_transfer_with_all_tx_types()

Documentation for tests/amsterdam/eip7708_eth_transfer_logs/test_transfer_logs.py::test_transfer_with_all_tx_types@5c024cbb.

Generate fixtures for these test cases for Amsterdam with:

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

Test that ETH transfers emit logs for all transaction types.

Source code in tests/amsterdam/eip7708_eth_transfer_logs/test_transfer_logs.py
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
@pytest.mark.with_all_typed_transactions
def test_transfer_with_all_tx_types(
    state_test: StateTestFiller,
    env: Environment,
    pre: Alloc,
    sender: EOA,
    typed_transaction: Transaction,
) -> None:
    """Test that ETH transfers emit logs for all transaction types."""
    recipient = pre.nonexistent_account()
    transfer_amount = 1000

    tx = typed_transaction.copy(
        to=recipient,
        value=transfer_amount,
        expected_receipt=TransactionReceipt(
            logs=[transfer_log(sender, recipient, transfer_amount)]
        ),
    )

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

Parametrized Test Cases

This test generates 5 parametrized test cases across 1 fork.