Events returned by WebSocketProvider inconsistent with getLogs
See original GitHub issueHi @ricmoo ,
When I receive an event via Websockets, the event.blockNumber
appears in hex (but otherwise seems to work fine).
However, when I do provider.getLogs()
(using normal Infura provider), the log.blockNumber
is in decimal format.
My assumption has been that a log (using normal provider) and a Websocket event are the same type of object. Is that correct? Should both be returning decimal blockNumber
?
Thanks!
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
ethers.js Why aren't logs filtering? (query returned more than ...
Yes, I was filtering the logs very wrong. Let's look at this amazing oopsie from the code block above: const logs = await...
Read more >Documentation - Ethers.js
Receive an event when ANY transfer occurs daiContract.on("Transfer", (from, to, amount, ... Returns a new WebSocketProvider connected to url as the network.
Read more >Release Notes — Web3.py 5.31.3 documentation
Doc fix: Pending transaction filter returns a TransactionFilter not a ... Fixed issues with parsing tuples and nested tuples in event logs (#2211) ......
Read more >getPastEvents throws errors with websocket provider but not ...
The websocket provider seems to error out. I know there is a limit of 10000 events returned from a call, I start at...
Read more >Everything You Ever Wanted to Know About Events and Logs ...
Understand Events and Logs in Ethereum, how to make an event scraper, ... Just calling getLogs would return logs from the entire chain, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Both should be returning a decimal. You are right, the subscribed events in the WebSocketProvider is skipping the regular wrapping for block, but logs are still wrapped properly. I’ll fix it shortly. And double check everything else is being normalized correctly. 😃
I can confirm that the block numbers are returned correctly for your code snippets above.
The issue I’m encountering is when listening for events: