Skip to content

Commit

Permalink
Hoist RLP exceptions under EthereumException
Browse files Browse the repository at this point in the history
  • Loading branch information
SamWilsn committed Oct 30, 2024
1 parent 420f7a8 commit 292048f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/ethereum/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class InvalidTransaction(EthereumException):
"""


class RLPDecodingError(InvalidBlock):
class RLPDecodingError(EthereumException):
"""
Indicates that RLP decoding failed.
"""
Expand Down
4 changes: 2 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, InvalidTransaction
from ethereum.exceptions import EthereumException
from ethereum.utils.hexadecimal import hex_to_bytes
from ethereum_spec_tools.evm_tools.loaders.fixture_loader import Load

Expand Down Expand Up @@ -72,7 +72,7 @@ def run_blockchain_st_test(test_case: Dict, load: Load) -> None:
# 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)):
with pytest.raises(EthereumException):
add_block_to_chain(chain, json_block, load, mock_pow)
return
else:
Expand Down

0 comments on commit 292048f

Please sign in to comment.