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@b47f0253.

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
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
@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.