We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When querying an ENS name, it is possible that a resolver contract is not set (0x0). Web3 throws an unspecific error message when no resolver is set.
const address = await web3.eth.ens.getAddress(ensNameWithoutResolver); expect(address).toEqual('0x0');
There are two options for expected behaviour:
There are pros/cons of both. Personally, I feel it should return 0x0 because the address doesn't exist and it makes the call more intuitive to use.
const address = await web3.eth.ens.getAddress(ensNameWithoutResolver); // throws error
(async () => { const Web3 = require('web3'); const web3 = new Web3('https://mainnet.infura.io/v3/b0444015b0c64183a7dbea5d183661b5'); const address = await web3.eth.ens.getAddress('ipledger.eth'); })();
(node:31248) UnhandledPromiseRejectionWarning: Error: Invalid bytes string given: 0x at AbiCoder.decodeParameters (/home/langers/Source/kauri-io/enslookup/node_modules/web3-eth-abi/dist/web3-eth-abi.cjs.js:64:15) at AbiCoder.decodeParameter (/home/langers/Source/kauri-io/enslookup/node_modules/web3-eth-abi/dist/web3-eth-abi.cjs.js:55:19)
Happy to raise a PR - just let me know what is the preferred expected behaviour.
The text was updated successfully, but these errors were encountered:
This got fixed with beta.52 :)
Sorry, something went wrong.
No branches or pull requests
Description
When querying an ENS name, it is possible that a resolver contract is not set (0x0). Web3 throws an unspecific error message when no resolver is set.
Expected behavior
There are two options for expected behaviour:
There are pros/cons of both. Personally, I feel it should return 0x0 because the address doesn't exist and it makes the call more intuitive to use.
Actual behavior
Steps to reproduce the behavior
Error Logs
Versions
Happy to raise a PR - just let me know what is the preferred expected behaviour.
The text was updated successfully, but these errors were encountered: