-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Async name to address new approach #3012
Async name to address new approach #3012
Conversation
- Support asynchronous ENS name-to-address conversion via a new bit of logic since async does not play well with functools.
- Update some of the testing for sync name_to_address_middleware as well since these tests can lead to false positives sometimes. Look for an actual result, not a mocked one.
- ENS supports many chains now. We should remove the mainnet check.
- Add tests for sequence arg types for methods as well as dict arg type
9364d72
to
bf396f9
Compare
- Look for ENS names in address lists (abi type ``address[]``) and convert to address
bf396f9
to
82383bc
Compare
- There wasn't too much code copying in the end with this approach so this seems better. This provides proper recursion for nested address list types (address[][][], address[2][1], etc) and gives async and sync the same treatment as they basically follow the same approach.
82383bc
to
c4bcdb7
Compare
ce5b2ae
to
90da562
Compare
90da562
to
79b04ae
Compare
79b04ae
to
3d8cd36
Compare
5ff970a
to
3ee4d17
Compare
3ee4d17
to
90fcf86
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.
Lgtm
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 looks good to me! I left one nit and a comment around error backwards compatibility.
As a side note, when I was testing this out, I would see multiple warnings about ensip15_normalization, and it wasn't immediately clear how I could turn this off. I tried doing a w3.ens.ensip15_normalization = True
, but that didn't work. It doesn't have to be in this PR, but it would be nice to add how to turn off that warning into the error message. I think it's confusing UX because when I was running w3.eth.get_balance('ethereum.eth')
, I get a warning about normalize_name()
which I know is being called under the hood, but it's not super clear how or why IMHO. Here's a screenshot since my comment is sort of confusing:
@kclowes regarding the ENSIP-15 warnings, I think we talked about this the other day and these are the changes I mentioned might be best in a separate PR. We're going to have to pass around a |
1f1bd7f
to
eeaba81
Compare
Yeah, a separate PR is fine by me. I just wanted to make sure it got flagged. I'll add an issue too so we can track. |
What was wrong?
ENS name to address needs async support
How was it fixed?
Todo:
Cute Animal Picture