Closed sharifzadesina closed 2 months ago
The eth.getBlock().transactions should either return empty array in case of empty block, or include undefined as part of its return type.
eth.getBlock().transactions
undefined
import { Web3 } from "web3"; const web3 = new Web3('https://sepolia.infura.io/v3/xxxxxx'); const block = await web3.eth.getBlock(6058307, true); console.log(block.transactions); // this is undefined!
web3.eth.getBlock
Doesn't matter.
Hi @sharifzadesina thanks for submitting this, you are right, the taem will work on it soon! thanks
Created a PR for this, thanks
merged. will be available next release
Expected behavior
The
eth.getBlock().transactions
should either return empty array in case of empty block, or includeundefined
as part of its return type.Actual behavior
Steps to reproduce the behavior
web3.eth.getBlock
on an empty block.Logs
Doesn't matter.
Environment
Doesn't matter.