Feature: add getBlock and getTransaction to event details
See original GitHub issueprovider.getBlock(blockNum)
does not seem to work with newest blocks.
I get this error:
TypeError: Cannot read property 'author' of null
at checkBlock (D:\walda\node_modules\ethers-providers\provider.js:152:14)
at D:\walda\node_modules\ethers-providers\provider.js:738:20
at process._tickCallback (internal/process/next_tick.js:109:7)
There is no problem getting past blocks however. If blockNum
is the newest block’s number, then anything less than provider.getBlock(blockNum-1)
works
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
getBlock
Returns identity and transaction information about a confirmed block in the ledger.
Read more >gettransaction example for DogeCoin (DOGE) - JSON-RPC
Get detailed information about transaction. Parameters. txid - string. Transactiond id for which the info should be returned. Request. curl ...
Read more >web3.eth — web3.js 1.0.0 documentation - Read the Docs
add (request) : To add a request object to the batch call. ... Please see the source file for function details. ... using...
Read more >Provider - ethers
In addition to transaction and filter events, there are several named events. Event Name, Arguments, Description. "block", blockNumber, emitted when a new block ......
Read more >how can i get details of transactions from any block number ...
Using web3, you can use the function getBlock. Then, you can read the value of "transactions" (an array) from the object received to ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
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
Indeed, it helps thank you! (the bug was in my code, I tried to call this.getBlock on an event returned from getLogs 🥇 )
Certain nodes (especially INFURA, where you may be connecting to a different instance on each JSON-RPC call) do not return blocks, receipts or transactions with consistent reads.
Inside a Contract event handler, you can access
this
which, has agetBlock()
method which will wait until the node returns the block.Does that help?