The error that I am getting when running this is:
Error: Invalid RpcBlockWithTransactions or null
I have a contract called PriceConsumerV3
and it makes a view
function call on a contract. I am attempting to use hardhats forking functionality, but whenever I run this script from the forked version, (or even just the regular hardhat runtime environment) I get the error above.
However, when I use the kovan
network as defined in my hardhat.config.js
which uses an RPC_URL
the script deploys and works fine.
async function main() {
const PriceConsumerV3 = await ethers.getContractFactory("PriceConsumerV3")
const priceConsumerV3 = await PriceConsumerV3.deploy()
await priceConsumerV3.deployed()
console.log("priceConsumerV3 deployed to: ", priceConsumerV3.address)
ethPrice = await priceConsumerV3.getLatestPrice()
console.log("Price data for ETH: ", ethPrice.toString())
}
Any thoughts?