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

Event Listening Bug when filter as no address [ethers-v5] #741

Closed
pldespaigne opened this issue Feb 27, 2020 · 4 comments
Closed

Event Listening Bug when filter as no address [ethers-v5] #741

pldespaigne opened this issue Feb 27, 2020 · 4 comments
Labels
bug Verified to be an issue. fixed/complete This Bug is fixed or Enhancement is complete and published.

Comments

@pldespaigne
Copy link

pldespaigne commented Feb 27, 2020

Hello @ricmoo !
I was experimenting on private networks and I found a bug on the v5 version of ethers.

When listening on events via filters without any address I got an unexpected error network does not support ENS. I try to reproduce on v4.0.45 but everything works as intended.

Error

After some investigation I found that the error was caused by the filter serialization.

  1. This line convert the empty address field into a '*'
  2. When polling, this line is meant to remove empty address field, but it's never executed since empty addresses are always '*' instead of ''.
  3. This result in the resolveProperties function trying to resolve '*' as an ENS name.

You can see that in ethers v4.0.45 the line of step 1) convert empty addresses in '' instead of '*'.
That is why there is no error in v4.

Proposed fix

Simply replace the line at step 1) of v5 by the one of v4.

Anyway thanks a lot for your work and your time!

@ricmoo ricmoo added investigate Under investigation and may be a bug. on-deck This Enhancement or Bug is currently being worked on. labels Feb 27, 2020
@ricmoo
Copy link
Member

ricmoo commented Feb 27, 2020

Ack! Good catch. I'll fix this right away. Also thanks for investigating. :)

@ricmoo ricmoo added bug Verified to be an issue. and removed investigate Under investigation and may be a bug. labels Feb 27, 2020
@ricmoo
Copy link
Member

ricmoo commented Feb 27, 2020

The changes are made and the tests are running.

Once they complete I'll publish to NPM.

@ricmoo
Copy link
Member

ricmoo commented Feb 27, 2020

Published to 5.0.0-beta.175. Try it out and let me know if you have any problems. :)

@pldespaigne
Copy link
Author

Thanks @ricmoo you are the real MVP !

@ricmoo ricmoo removed the on-deck This Enhancement or Bug is currently being worked on. label Mar 13, 2020
@ricmoo ricmoo added the fixed/complete This Bug is fixed or Enhancement is complete and published. label Mar 30, 2020
michaeltout pushed a commit to michaeltout/ethers.js that referenced this issue Aug 23, 2020
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