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
Refactor ENS provider, catch more exceptions from 4byte.direcotry #71
Conversation
kchojn
commented
Oct 17, 2021
•
edited
edited
- Refactored ENS provider, each time a new ens object is taken
- Catch more exceptions from 4byte.directory (looks like the service is not always working properly)
- Added more logging
- Added more exceptions.
ethtx/providers/ens_provider.py
Outdated
def name(self, provider: Callable, address: Any): | ||
... | ||
|
||
@abstractmethod | ||
def address(self, name: Any): | ||
def address(self, provider: Callable, name: Any): | ||
... |
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.
Types should not be Callable
but Web3
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.
Its an abstract base class, all ens resolvers need some provider. Web3Ens got an exact type - Web3
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.
Callable is type that implements call method afaik, Web3 does not have it.
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 talk about this web3 name resolving more, don't reallty now how this will fit in greater scheme of things in what we want to achieve with this.
ethtx/providers/ens_provider.py
Outdated
def name(self, provider: Callable, address: Any): | ||
... | ||
|
||
@abstractmethod | ||
def address(self, name: Any): | ||
def address(self, provider: Callable, name: Any): | ||
... |
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.
Callable is type that implements call method afaik, Web3 does not have it.