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

Calling web3.eth.ens.getAddress(...) 2 times in a row gives error when resolving the second address #2538

Closed
wmitsuda opened this issue Mar 20, 2019 · 2 comments

Comments

@wmitsuda
Copy link

Description

Run the following code:

console.log(await web3.eth.ens.getAddress("ethereum.eth"));
console.log(await web3.eth.ens.getAddress("ensdomains.eth"));

It will give the following error in console:

0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359
web3-eth-abi.umd.js:65 Uncaught (in promise) Error: Invalid bytes string given: 0x
    at AbiCoder.decodeParameters (web3-eth-abi.umd.js:65)
    at AbiCoder.decodeParameter (web3-eth-abi.umd.js:55)
    at CallContractMethod.afterExecution (web3-eth-contract.umd.js:848)
    at CallContractMethod._callee$ (web3-core-method.umd.js:109)
    at tryCatch (runtime.js:62)
    at Generator.invoke [as _invoke] (runtime.js:288)
    at Generator.prototype.(:3000/anonymous function) [as next] (http://localhost:3000/static/js/0.chunk.js:941:21)
    at asyncGeneratorStep (asyncToGenerator.js:3)
    at _next (asyncToGenerator.js:25)
decodeParameters @ web3-eth-abi.umd.js:65
decodeParameter @ web3-eth-abi.umd.js:55
afterExecution @ web3-eth-contract.umd.js:848
_callee$ @ web3-core-method.umd.js:109
tryCatch @ runtime.js:62
invoke @ runtime.js:288
prototype.(anonymous function) @ runtime.js:114
asyncGeneratorStep @ asyncToGenerator.js:3
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
(anonymous) @ asyncToGenerator.js:32
(anonymous) @ asyncToGenerator.js:21
callCallback @ react-dom.development.js:147
invokeGuardedCallbackDev @ react-dom.development.js:196
invokeGuardedCallback @ react-dom.development.js:250
invokeGuardedCallbackAndCatchFirstError @ react-dom.development.js:265
executeDispatch @ react-dom.development.js:571
executeDispatchesInOrder @ react-dom.development.js:596
executeDispatchesAndRelease @ react-dom.development.js:695
executeDispatchesAndReleaseTopLevel @ react-dom.development.js:704
forEachAccumulated @ react-dom.development.js:676
runEventsInBatch @ react-dom.development.js:844
runExtractedEventsInBatch @ react-dom.development.js:852
handleTopLevel @ react-dom.development.js:5030
batchedUpdates$1 @ react-dom.development.js:21425
batchedUpdates @ react-dom.development.js:2247
dispatchEvent @ react-dom.development.js:5110
(anonymous) @ react-dom.development.js:21482
unstable_runWithPriority @ scheduler.development.js:255
interactiveUpdates$1 @ react-dom.development.js:21481
interactiveUpdates @ react-dom.development.js:2268
dispatchInteractiveEvent @ react-dom.development.js:5086

If you comment any of the getAddress calls and run each one separately, it will work as expected. The error appears to only occur when you call getAddress() with different parameters one after another.

Expected behavior

Should log both resolved addresses.

Actual behavior

It will log the first resolved address, then throw exception when the second address is being resolved, see above.

Steps to reproduce the behavior

See above.

Versions

  • web3.js: 1.0.0-beta.49
  • nodejs: 10.15.0
  • browser: Chrome Mac 73
  • ethereum node: Latest Metamask
@nivida
Copy link
Contributor

nivida commented Mar 20, 2019

Thanks for opening this issue but it's a duplication of #2499. I will fix and release it asap.

@nivida nivida closed this as completed Mar 20, 2019
@wmitsuda
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants