Skip to content
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

Strange error with ENS names #504

Closed
pldespaigne opened this issue May 3, 2019 · 6 comments
Closed

Strange error with ENS names #504

pldespaigne opened this issue May 3, 2019 · 6 comments
Labels
bug Verified to be an issue. fixed/complete This Bug is fixed or Enhancement is complete and published.

Comments

@pldespaigne
Copy link

Hi ! I just noticed a strange behaviour when querying with ENS names :

  • that doesn't exist
  • exist but have not any resolver
  • exist & have a resolver but doesn't have any address set

Ethers v4.0.27 on node
This will trigger the following error :

UnhandledPromiseRejectionWarning: Error: invalid argument 0: json: cannot unmarshal non-string into Go value of type common.Address
    at getResult (C:\Users\Campalo\CASCADE8\blockframes\node_modules\ethers\providers\json-rpc-provider.js:40:21)
    at exports.XMLHttpRequest.request.onreadystatechange (C:\Users\Campalo\CASCADE8\blockframes\node_modules\ethers\utils\web.js:111:30)
    at exports.XMLHttpRequest.dispatchEvent (C:\Users\Campalo\CASCADE8\blockframes\node_modules\xmlhttprequest\lib\XMLHttpRequest.js:591:25)
    at setState (C:\Users\Campalo\CASCADE8\blockframes\node_modules\xmlhttprequest\lib\XMLHttpRequest.js:610:14)
    at IncomingMessage.<anonymous> (C:\Users\Campalo\CASCADE8\blockframes\node_modules\xmlhttprequest\lib\XMLHttpRequest.js:447:13)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickDomainCallback (internal/process/next_tick.js:218:9)

Expected behaviour :
return a more meaningful error, or in case of getBalance() simply 0x0

Minimal step to reproduce (on goerli) :

  • doesntexist.test doesn't exist
  • vitalik.test exist without any resolver
  • blockframes.test exist with a resolver but no address
ethers.getDefaultProvider('goerli').getBalance('vitalik.test');
@ricmoo
Copy link
Member

ricmoo commented May 3, 2019

That’s odd. That looks more like the error when the internet is down (obviously since you can get the balance, that is not the case).

I’ll look into this once I get to Starbucks.

@ricmoo ricmoo added the discussion Questions, feedback and general information. label May 3, 2019
@pldespaigne
Copy link
Author

pldespaigne commented May 3, 2019

yes ! for exemple the domain tokyo.blockframes.test is linked to an address that have some eth and ethers.getDefaultProvider('goerli').getBalance('tokyo.blockframes.test').then(console.log) works perfectly

@ricmoo
Copy link
Member

ricmoo commented May 6, 2019

I have verified this is a bug and will get it fixed soon.

@ricmoo ricmoo added bug Verified to be an issue. on-deck This Enhancement or Bug is currently being worked on. and removed discussion Questions, feedback and general information. labels May 6, 2019
@ricmoo
Copy link
Member

ricmoo commented May 24, 2019

This should be fixed in 4.0.28. Let me know if you still have any problems.

Thanks! :)

@ricmoo ricmoo closed this as completed May 24, 2019
@ricmoo ricmoo removed the on-deck This Enhancement or Bug is currently being worked on. label May 24, 2019
@ricmoo
Copy link
Member

ricmoo commented May 24, 2019

(oh, also getBalance still throws an error, just a more meaningful error, since getting the balance of a non-existent ENS name should still be an error. :))

@pldespaigne
Copy link
Author

Thanks for your work @ricmoo !!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified to be an issue. fixed/complete This Bug is fixed or Enhancement is complete and published.
Projects
None yet
Development

No branches or pull requests

2 participants