-
Notifications
You must be signed in to change notification settings - Fork 690
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
Unify ValidationError
#1194
Conversation
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", |
There was a problem hiding this comment.
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?
c7a51a4
to
d862104
Compare
d862104
to
bdbac0a
Compare
There was a problem hiding this 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.
eth/chains/shard.py
Outdated
@@ -10,7 +10,7 @@ | |||
ShardDB, | |||
) | |||
|
|||
from eth.exceptions import ( | |||
from eth_utils import ( |
There was a problem hiding this comment.
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.
eth/consensus/pow.py
Outdated
@@ -19,7 +19,7 @@ | |||
from eth.utils.hexadecimal import ( | |||
encode_hex, | |||
) | |||
from eth.exceptions import ( | |||
from eth_utils import ( |
There was a problem hiding this comment.
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
eth/precompiles/ecmul.py
Outdated
@@ -3,8 +3,10 @@ | |||
) | |||
|
|||
from eth import constants | |||
from eth.exceptions import ( | |||
from eth_utils import ( |
There was a problem hiding this comment.
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
trinity/sync/common/chain.py
Outdated
@@ -14,13 +14,16 @@ | |||
from eth.chains import AsyncChain | |||
from eth.exceptions import ( | |||
HeaderNotFound, | |||
ValidationError as EthValidationError, | |||
) | |||
from eth_utils import ValidationError as EthValidationError |
There was a problem hiding this comment.
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
.
79e16ef
to
d18b78e
Compare
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 frometh_utils
Cute Animal Picture