Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception strings: TYPE_NOT_SUPPORTED #1024

Merged
merged 5 commits into from
Oct 31, 2024

Conversation

SamWilsn
Copy link
Collaborator

What was wrong?

Related to Issue #1021

How was it (partially) fixed?

Adding a new exception type to match TransactionException.TYPE_NOT_SUPPORTED.

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

@SamWilsn SamWilsn changed the title Exception strings Exception strings: TYPE_NOT_SUPPORTED Oct 17, 2024
# 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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if we can make it more specific on our test consumption side as well. Treat InvalidBlock and InvalidTransaction separately based on block_exception. Not urgent right now but some thing to consider going forward.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what I was thinking, and intended to convey with the above TODO. We can't do it yet because I haven't converted all the transaction exceptions yet (just one specific case.)

@codecov-commenter
Copy link

codecov-commenter commented Oct 31, 2024

Codecov Report

Attention: Patch coverage is 72.38095% with 29 lines in your changes missing coverage. Please review.

Project coverage is 83.59%. Comparing base (da1e112) to head (66f2dac).
Report is 51 commits behind head on master.

Files with missing lines Patch % Lines
src/ethereum/arrow_glacier/exceptions.py 75.00% 2 Missing ⚠️
src/ethereum/cancun/exceptions.py 75.00% 2 Missing ⚠️
src/ethereum/gray_glacier/exceptions.py 75.00% 2 Missing ⚠️
src/ethereum/london/exceptions.py 75.00% 2 Missing ⚠️
src/ethereum/paris/exceptions.py 75.00% 2 Missing ⚠️
src/ethereum/shanghai/exceptions.py 75.00% 2 Missing ⚠️
src/ethereum/arrow_glacier/fork.py 50.00% 1 Missing ⚠️
src/ethereum/arrow_glacier/transactions.py 50.00% 1 Missing ⚠️
src/ethereum/byzantium/fork.py 50.00% 1 Missing ⚠️
src/ethereum/cancun/transactions.py 50.00% 1 Missing ⚠️
... and 13 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1024      +/-   ##
==========================================
- Coverage   83.59%   83.59%   -0.01%     
==========================================
  Files         644      650       +6     
  Lines       36123    36157      +34     
==========================================
+ Hits        30198    30226      +28     
- Misses       5925     5931       +6     
Flag Coverage Δ
unittests 83.59% <72.38%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@SamWilsn SamWilsn merged commit 98d6dda into ethereum:master Oct 31, 2024
5 checks passed
@SamWilsn SamWilsn deleted the exception-strings branch October 31, 2024 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants