I am trying to run a method and the return is stuck on promise pending, if i have to do await it still stuck waiting for return. I have no idea why this happen, i log the value of localWeb3
and it returns an object without a problem
There is the snippet:
txChecker = async () => {
const localWeb3 = new Web3(
ganache.provider({ fork: "wss://eth-mainnet.ws.alchemyapi.io/v2/apikey" })
)
console.log(localWeb3) // image attached
console.log("latest_block forked 1: ", localWeb3.eth.getBlockNumber()) // promise state pending, value undefined
console.log("latest_block forked 2: ", await localWeb3.eth.getBlockNumber()) // black
}