-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Replace eth_abi.abi.process_type with eth_abi.grammar.parse #977
Conversation
Maybe better to replace with a local |
9638b8c
to
6898014
Compare
web3/utils/abi.py
Outdated
collapse_type, | ||
) | ||
|
||
|
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.
@carver Something like this?
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.
Yup, although I think it should be >= v1 in the if
test. It highlights the breaking change at the major version. (Also, 0.5.0 is already released, and we could theoretically release an 0.6.0 on the v0/stable branch).
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.
Let's add a core test in tox with eth-abi constrained <1 to catch these things.
web3/utils/abi.py
Outdated
collapse_type, | ||
) | ||
|
||
|
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.
Yup, although I think it should be >= v1 in the if
test. It highlights the breaking change at the major version. (Also, 0.5.0 is already released, and we could theoretically release an 0.6.0 on the v0/stable branch).
web3/utils/abi.py
Outdated
from eth_abi.abi import ( | ||
collapse_type, | ||
process_type, | ||
from eth_abi.grammar 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 would have to move into the if
test.
45277e1
to
67de2c7
Compare
.circleci/config.yml
Outdated
@@ -356,7 +385,8 @@ workflows: | |||
- py35-integration-parity-ws | |||
- py35-integration-ethtester-pyethereum | |||
- py35-integration-ethtester-pyevm | |||
- py36-core | |||
- py36-core-eth_abi0 | |||
- py36-core-eth_abi1 |
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.
Can we start testing against eth-abi v2 yet, or is the alpha broken?
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.
Yep, I started to add it, but then needed to take a minute to figure out how to get pre-releases installed. Im still hitting a snag getting it working correctly for v0 and v1. The eth_abi0 env is still installing v1.1.1. Will have a look tomorrow.
@carver eth_abi < v1 is failing due to incompatibility with the other dependencies. Because the latest web3 is incompatible with eth_abi < 1, should I remove the conditional import of the collapse_type and process_type functions? |
e4a711e
to
10a9dd8
Compare
Actually, I can't see why we'd test <1 at all. The web3.py requirement is >1.1.1: https://github.com/ethereum/web3.py/blob/master/setup.py#L22 But we still need to conditionally import, because they won't be there anymore by the time v2 leaves alpha. |
f509617
to
2b6d7de
Compare
@carver Because eth-abi 2.0.0a1 has some failing tests I will put it in a separate pull request, where the failing tests can be sorted out. EDIT: And I suppose that PR will need to be merged first, since we need to see that the import conditional isn't broken w/ eth-abi 2. |
2b6d7de
to
644a0bd
Compare
Will need to rebase once #974 is merged |
Both core tests are running against eth ABI 1.1.1 - it probably makes sense to release the next eth abi v2 alpha with process_type removed, and then pin one of these tests to >= that v2 version. |
03d6d5a
to
14313ae
Compare
Got a error with the caching middleware:
|
14313ae
to
1faa393
Compare
Was this resolved and then rebased? I don't see any failing CI run. |
I restarted the tests, and they passed. Maybe the test execution had a 1 second delay causing the cache middleware to refresh. |
I would like to hold off on merging this until an eth-abi alpha is released with process_type removed. |
1faa393
to
9016832
Compare
web3/utils/abi.py
Outdated
type_str_repr = '{} (normalized to {})'.format( | ||
type_str_repr, | ||
repr(normalized_type_str), | ||
) |
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.
Looks like all this type_str work can go inside the TupleType
check.
94d35b5
to
03d16af
Compare
03d16af
to
0a5ffb8
Compare
eth-abi v2 drops support for types formatted as tuples. e.g.: eth_abi.is_encodable(('address', '', []), '0x1111111111111111111111111111111111111111')
3547ed0
to
be9c4c5
Compare
What was wrong?
Related to Issue ethereum/eth-abi#85
How was it fixed?
Replace process_type with grammar.parse
Cute Animal Picture