-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Misleading types for EnsProvider.getResolver()
#1850
Comments
What is the difference in those signatures though? (I’m on my phone, so maybe if I cut and paste on a compute it would be more obvious?) |
Or do you mean you want the implementation to include I can add that in the next minor version, but the library in general doesn’t have |
Yes. But I think the const resolver = await provider.getResolver()
That’s great and it would solve the problem! |
I'm adding this locally for the next minor bump now. :) Keep in mind a large portion of the library will still have the same problem if you are. "anticipating" things to not be null. The library is overall designed around the This is changed in v6 (which uses |
The types have been updated in 5.5.0. Thanks! :) |
The
getResolver()
method on theEnsProvider
interface is declared with the following signatureThe implementation of
getResolver()
can returnnull
thoughethers.js/packages/providers/src.ts/base-provider.ts
Lines 1515 to 1524 in 4e93945
This leads to callers of
getResolver()
not anticipatingnull
as the return value which leads to runtime errors even though type-checking passes. I’d expect the following signature.The text was updated successfully, but these errors were encountered: