Skip to content

Unify ValidationError #1194

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

Merged
merged 1 commit into from
Aug 20, 2018
Merged

Conversation

glaksmono
Copy link
Contributor

@glaksmono glaksmono commented Aug 18, 2018

What was wrong?

https://github.com/ethereum/py-evm/pull/1089/files#r206404376

As noted in this comment, there is a valid concern that our duplicate ValidationError exceptions could easily be mixed up, causing us to not be catching the exception we think we are catching.

Issue Reference: #1125

How was it fixed?

Modify the codebase to use that exception class for all ValidationError exceptions to use the one from eth_utils

Cute Animal Picture

put a cute animal picture link inside the parentheses

setup.py Outdated
@@ -10,7 +10,7 @@
"eth-bloom>=1.0.0,<2.0.0",
"eth-keys>=0.2.0b3,<1.0.0",
"eth-typing>=1.1.0,<2.0.0",
"eth-utils>=1.0.1,<2.0.0",
"eth-utils==1.1.1",
Copy link
Contributor

Choose a reason for hiding this comment

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

Why the pin to a specific version here?

@glaksmono glaksmono force-pushed the eth-py-evm-1125 branch 2 times, most recently from c7a51a4 to d862104 Compare August 18, 2018 07:06
@glaksmono glaksmono changed the title [WIP] Unify ValidationError Unify ValidationError Aug 18, 2018
Copy link
Member

@pipermerriam pipermerriam left a comment

Choose a reason for hiding this comment

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

I didn't comment on all of them but can you go and move the eth_utils imports to be above the eth imports. We like to ensure our imports are grouped by namespace.

@@ -10,7 +10,7 @@
ShardDB,
)

from eth.exceptions import (
from eth_utils import (
Copy link
Member

Choose a reason for hiding this comment

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

This import should move up above the previous import so that all of the eth imports remain in the same block.

@@ -19,7 +19,7 @@
from eth.utils.hexadecimal import (
encode_hex,
)
from eth.exceptions import (
from eth_utils import (
Copy link
Member

Choose a reason for hiding this comment

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

Same here, move it up above the eth imports

@@ -3,8 +3,10 @@
)

from eth import constants
from eth.exceptions import (
from eth_utils import (
Copy link
Member

Choose a reason for hiding this comment

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

This should move up above the eth imports

@@ -14,13 +14,16 @@
from eth.chains import AsyncChain
from eth.exceptions import (
HeaderNotFound,
ValidationError as EthValidationError,
)
from eth_utils import ValidationError as EthValidationError
Copy link
Member

Choose a reason for hiding this comment

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

You can drop this rename and just change all of the places where EthValidationError is raised to just be a ValidationError.

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