@@ -262,6 +262,97 @@ def test_case(state_test, system_contract):
262262 None ,
263263 id = "with_all_system_contracts" ,
264264 ),
265+ pytest .param (
266+ """
267+ import pytest
268+ from ethereum_test_tools import Transaction
269+ @pytest.mark.with_all_typed_transactions()
270+ @pytest.mark.valid_from("Berlin")
271+ @pytest.mark.valid_until("Berlin")
272+ @pytest.mark.state_test_only
273+ def test_case(state_test, typed_transaction, pre):
274+ assert isinstance(typed_transaction, Transaction)
275+ assert typed_transaction.ty in [0, 1] # Berlin supports types 0 and 1
276+ """ ,
277+ {"passed" : 2 , "failed" : 0 , "skipped" : 0 , "errors" : 0 },
278+ None ,
279+ id = "with_all_typed_transactions_berlin" ,
280+ ),
281+ pytest .param (
282+ """
283+ import pytest
284+ from ethereum_test_tools import Transaction
285+ @pytest.mark.with_all_typed_transactions()
286+ @pytest.mark.valid_from("London")
287+ @pytest.mark.valid_until("London")
288+ @pytest.mark.state_test_only
289+ def test_case(state_test, typed_transaction, pre):
290+ assert isinstance(typed_transaction, Transaction)
291+ assert typed_transaction.ty in [0, 1, 2] # London supports types 0, 1, 2
292+ """ ,
293+ {"passed" : 3 , "failed" : 0 , "skipped" : 0 , "errors" : 0 },
294+ None ,
295+ id = "with_all_typed_transactions_london" ,
296+ ),
297+ pytest .param (
298+ """
299+ import pytest
300+ from ethereum_test_tools import Transaction
301+ @pytest.mark.with_all_typed_transactions()
302+ @pytest.mark.valid_from("London")
303+ @pytest.mark.valid_until("London")
304+ @pytest.mark.state_test_only
305+ def test_case(state_test, typed_transaction, pre):
306+ assert isinstance(typed_transaction, Transaction)
307+ # Test with marks to skip type 0
308+ if typed_transaction.ty == 0:
309+ pytest.skip("Testing skip functionality")
310+ """ ,
311+ {"passed" : 2 , "failed" : 0 , "skipped" : 1 , "errors" : 0 },
312+ None ,
313+ id = "with_all_typed_transactions_with_skip" ,
314+ ),
315+ pytest .param (
316+ """
317+ import pytest
318+ from ethereum_test_tools import Transaction
319+ from ethereum_test_base_types import AccessList
320+
321+ # Override the type 3 transaction fixture
322+ @pytest.fixture
323+ def type_3_default_transaction(pre):
324+ sender = pre.fund_eoa()
325+
326+ return Transaction(
327+ ty=3,
328+ sender=sender,
329+ max_fee_per_gas=10**10,
330+ max_priority_fee_per_gas=10**9,
331+ max_fee_per_blob_gas=10**8,
332+ gas_limit=300_000,
333+ data=b"\\ xFF" * 50,
334+ access_list=[
335+ AccessList(address=0x1111, storage_keys=[10, 20]),
336+ ],
337+ blob_versioned_hashes=[
338+ 0x0111111111111111111111111111111111111111111111111111111111111111,
339+ ],
340+ )
341+
342+ @pytest.mark.with_all_typed_transactions()
343+ @pytest.mark.valid_at("Cancun")
344+ @pytest.mark.state_test_only
345+ def test_case(state_test, typed_transaction, pre):
346+ assert isinstance(typed_transaction, Transaction)
347+ if typed_transaction.ty == 3:
348+ # Verify our override worked
349+ assert typed_transaction.data == b"\\ xFF" * 50
350+ assert len(typed_transaction.blob_versioned_hashes) == 1
351+ """ ,
352+ {"passed" : 4 , "failed" : 0 , "skipped" : 0 , "errors" : 0 },
353+ None ,
354+ id = "with_all_typed_transactions_with_override" ,
355+ ),
265356 pytest .param (
266357 """
267358 import pytest
0 commit comments