Skip to content

Commit

Permalink
Expect InvalidTransacton in addition to BlockException
Browse files Browse the repository at this point in the history
  • Loading branch information
SamWilsn committed Oct 21, 2024
1 parent 47863f7 commit 420f7a8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/helpers/load_state_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from ethereum_types.numeric import U64

from ethereum import rlp
from ethereum.exceptions import InvalidBlock
from ethereum.exceptions import InvalidBlock, InvalidTransaction
from ethereum.utils.hexadecimal import hex_to_bytes
from ethereum_spec_tools.evm_tools.loaders.fixture_loader import Load

Expand Down Expand Up @@ -69,7 +69,10 @@ def run_blockchain_st_test(test_case: Dict, load: Load) -> None:
break

if block_exception:
with pytest.raises(InvalidBlock):
# TODO: Once all the specific exception types are thrown,
# only `pytest.raises` the correct exception type instead of
# all of them.
with pytest.raises((InvalidBlock, InvalidTransaction)):
add_block_to_chain(chain, json_block, load, mock_pow)
return
else:
Expand Down

0 comments on commit 420f7a8

Please sign in to comment.