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

contract.on(event, ...) returns event happened prior ? #3264

Closed
garyng2000 opened this issue Aug 12, 2022 · 4 comments
Closed

contract.on(event, ...) returns event happened prior ? #3264

garyng2000 opened this issue Aug 12, 2022 · 4 comments
Assignees
Labels
duplicate Duplicate of another issue.

Comments

@garyng2000
Copy link

Ethers Version

5.6.9

Search Terms

event listening

Describe the Problem

I am trying to use the contract.on(event,...) to watch event happening and is expecting it to be only future events. But it seems that somehow it returns the event since contract deployment.

Is my understanding wrong about this ?

Code Snippet

No response

Contract ABI

No response

Errors

No response

Environment

No response

Environment (Other)

No response

@garyng2000 garyng2000 added the investigate Under investigation and may be a bug. label Aug 12, 2022
@zemse
Copy link
Collaborator

zemse commented Aug 13, 2022

This should not happen generally. Can you provide which environment are you using? e.g. ganache, hardhat, geth and on which network mainnet, testnet.

Edit: just noticed that its a known issue #3094 (comment)

@osis
Copy link

osis commented Aug 15, 2022

Related to #3094 ?

@ricmoo
Copy link
Member

ricmoo commented Aug 15, 2022

@osis My guess is yes. The fix will be going out tomorrow; you can try with 5.7 once it is released. :)

@garyng2000
Copy link
Author

thanks for the info, I was running geth node but on a private POA network which creates block on demand, when there is new txn (i.e. basically the same as a dev network but is shared/synced between different machines).

will try out 5.7 when it is out

@ricmoo ricmoo added duplicate Duplicate of another issue. and removed investigate Under investigation and may be a bug. labels Aug 16, 2022
@ricmoo ricmoo closed this as completed Jan 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Duplicate of another issue.
Projects
None yet
Development

No branches or pull requests

4 participants