From fc19902f36827bf41b27201ed2879ae089072490 Mon Sep 17 00:00:00 2001 From: Dimitry Kh Date: Thu, 16 Jan 2025 11:47:51 +0100 Subject: [PATCH] transaction test failure --- .../transactions/test_transactions.py | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 tests/frontier/transactions/test_transactions.py diff --git a/tests/frontier/transactions/test_transactions.py b/tests/frontier/transactions/test_transactions.py new file mode 100644 index 00000000000..39ea52aeeb7 --- /dev/null +++ b/tests/frontier/transactions/test_transactions.py @@ -0,0 +1,47 @@ +"""Test address field in transaction rlp.""" + +from typing import Optional, Union + +import pytest +from pydantic import Field + +from ethereum_test_base_types import Bytes +from ethereum_test_tools import ( + Address, + Alloc, + Transaction, + TransactionException, + TransactionTestFiller, +) + +REFERENCE_SPEC_GIT_PATH = None +REFERENCE_SPEC_VERSION = None + +pytestmark = pytest.mark.valid_from("Frontier") + + +class TestTransaction(Transaction): + """Test version of the Transaction class where 'to' accepts Bytes.""" + + to: Optional[Union[Bytes, Address, None]] = Field(Bytes(bytes.fromhex("00"))) + + +def test_tx_address_less_than_20( + transaction_test: TransactionTestFiller, + pre: Alloc, +): + """Test sending a transaction with an empty authorization list.""" + tx = TestTransaction( + gas_limit=100_000, + to=bytes.fromhex("0011"), + value=0, + error=TransactionException.TYPE_3_TX_MAX_BLOB_GAS_ALLOWANCE_EXCEEDED, + sender=pre.fund_eoa(), + ) + tx = tx.with_signature_and_sender() + hash = tx.hash + + transaction_test( + pre=pre, + tx=tx, + )