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 events does not support fromBlock property #5201

Closed
1 task done
nazarhussain opened this issue Jul 5, 2022 · 2 comments
Closed
1 task done

Contract events does not support fromBlock property #5201

nazarhussain opened this issue Jul 5, 2022 · 2 comments
Assignees
Labels
4.x 4.0 related Bug Addressing a bug

Comments

@nazarhussain
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Following two code snippets behaves exactly the same:

myContract.events.MyEvent({fromBlock: 0})
myContract.events.MyEvent()

Expected Behavior

If one subscribe for the events with fromBlock it should get the past logs with getPastEvents and emit those.

myContract.events.MyEvent({fromBlock: 0})

Steps to Reproduce

Following snippet should emit the two events which were triggered in the past.

myContract.methods.fireStrintEvent('event1'); 
myContract.methods.fireStrintEvent('event2'); 

(await myContract.events.MyEvent({fromBlock: 0})).on('data', console.log));

Web3.js Version

4.x

Environment

  • Operating System:
  • Browser:
  • Node.js Version:
  • NPM Version:

Anything Else?

This behavior can be implemented with combination of getPastEvents inside the event subscriber.

@nazarhussain nazarhussain added the Bug Addressing a bug label Jul 5, 2022
@Anassabguerbeh
Copy link

Hey

@jdevcs jdevcs added the 4.x 4.0 related label Jul 5, 2022
@github-actions
Copy link

github-actions bot commented Sep 4, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment.

@github-actions github-actions bot added the Stale Has not received enough activity label Sep 4, 2022
@mconnelly8 mconnelly8 removed the Stale Has not received enough activity label Sep 13, 2022
@Muhammad-Altabba Muhammad-Altabba self-assigned this Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x 4.0 related Bug Addressing a bug
Projects
None yet
Development

No branches or pull requests

5 participants