From d7eac8651e6b8f13266afc912d2113e5b772f8d3 Mon Sep 17 00:00:00 2001 From: Mario Vega Date: Wed, 3 Apr 2024 19:33:38 +0000 Subject: [PATCH] fix(tests): exception lists --- tests/cancun/eip4844_blobs/test_blob_txs.py | 8 +++++--- tests/cancun/eip4844_blobs/test_blob_txs_full.py | 7 ++++--- tests/cancun/eip4844_blobs/test_excess_blob_gas.py | 10 ++++++---- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/tests/cancun/eip4844_blobs/test_blob_txs.py b/tests/cancun/eip4844_blobs/test_blob_txs.py index cc69698057..a5d4edb62d 100644 --- a/tests/cancun/eip4844_blobs/test_blob_txs.py +++ b/tests/cancun/eip4844_blobs/test_blob_txs.py @@ -1153,8 +1153,10 @@ def test_invalid_blob_tx_contract_creation( blocks=[ Block( txs=txs, - exception=TransactionException.TYPE_3_TX_CONTRACT_CREATION - | BlockException.RLP_STRUCTURES_ENCODING, + exception=[ + BlockException.RLP_STRUCTURES_ENCODING, + TransactionException.TYPE_3_TX_CONTRACT_CREATION, + ], header_verify=header_verify, ) ], @@ -1392,7 +1394,7 @@ def test_blob_tx_attribute_gasprice_opcode( [0], None, 1, - TransactionException.TYPE_3_TX_PRE_FORK | TransactionException.TYPE_3_TX_ZERO_BLOBS, + [TransactionException.TYPE_3_TX_PRE_FORK, TransactionException.TYPE_3_TX_ZERO_BLOBS], ), ([1], None, 1, TransactionException.TYPE_3_TX_PRE_FORK), ], diff --git a/tests/cancun/eip4844_blobs/test_blob_txs_full.py b/tests/cancun/eip4844_blobs/test_blob_txs_full.py index faae360da9..88d9965571 100644 --- a/tests/cancun/eip4844_blobs/test_blob_txs_full.py +++ b/tests/cancun/eip4844_blobs/test_blob_txs_full.py @@ -257,9 +257,10 @@ def blocks( if any(txs_wrapped_blobs): # This is a block exception because the invalid block is only created in the RLP version, # not in the transition tool. - block_error = ( - TransactionException.TYPE_3_TX_WITH_FULL_BLOBS | BlockException.RLP_STRUCTURES_ENCODING - ) + block_error = [ + BlockException.RLP_STRUCTURES_ENCODING, + TransactionException.TYPE_3_TX_WITH_FULL_BLOBS, + ] if len(txs) > 0: header_blob_gas_used = ( sum( diff --git a/tests/cancun/eip4844_blobs/test_excess_blob_gas.py b/tests/cancun/eip4844_blobs/test_excess_blob_gas.py index ca0669b068..0f61e4ec32 100644 --- a/tests/cancun/eip4844_blobs/test_excess_blob_gas.py +++ b/tests/cancun/eip4844_blobs/test_excess_blob_gas.py @@ -33,7 +33,6 @@ BlockchainTestFiller, BlockException, Environment, - ExceptionType, Hash, Header, ) @@ -268,7 +267,8 @@ def blocks( # noqa: D103 ) def add_block( - header_modifier: Optional[Dict] = None, exception_message: Optional[ExceptionType] = None + header_modifier: Optional[Dict] = None, + exception_message: Optional[BlockException | List[BlockException]] = None, ): """ Utility function to add a block to the blocks list. @@ -294,8 +294,10 @@ def add_block( if header_blob_gas_used > Spec.MAX_BLOB_GAS_PER_BLOCK: add_block( header_modifier={"blob_gas_used": header_blob_gas_used}, - exception_message=BlockException.BLOB_GAS_USED_ABOVE_LIMIT - | BlockException.INCORRECT_BLOB_GAS_USED, + exception_message=[ + BlockException.BLOB_GAS_USED_ABOVE_LIMIT, + BlockException.INCORRECT_BLOB_GAS_USED, + ], ) else: add_block(