Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

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
"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.

)

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.

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


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

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants