Replies: 2 comments
-
|
I am facing the same issue, were you able to fix it? |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Change your line from: Then you'll likely run into another error: Error: VM Exception while processing transaction: reverted with custom error 'InvalidConsumer()' |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Here is my Raffle.test.js which has the error in "await network.provider.send("evm_increaseTime", [Number(interval) + 1]);" and I am not able to solve it.
const { network, deployments, ethers, getNamedAccounts, getChainId } = require("hardhat"); const { developementChains, networkConfig } = require("../../helper-hardhat-config"); const { assert, expect } = require("chai"); !developementChains.includes(network.name) ? describe.skip : describe("Raffle Unit Test", async function () { let raffle, VRFCoordinatorV2Mock, raffleEntranceFee, deployer, interval; beforeEach(async function () { deployer = (await getNamedAccounts()).deployer; await deployments.fixture(["all"]); const raffleAddress = (await deployments.get("Raffle")).address; const vrfCoordinatorV2Address = (await deployments.get("VRFCoordinatorV2Mock")).address; raffle = await ethers.getContract("Raffle", deployer); VRFCoordinatorV2Mock = await ethers.getContract("VRFCoordinatorV2Mock", deployer); raffleEntranceFee = await networkConfig[await getChainId()]["entranceFee"]; interval = await raffle.getInterval(); }); describe("constructor", function () { it("Initializes Raffle Correctly", async function () { const raffleState = await raffle.getRaffleState(); assert.equal(raffleState.toString(), "0"); assert.equal(interval.toString(), networkConfig[await getChainId()]["interval"]); }); }); describe("Enter Raffle", function () { it("Reverts if you don't have enough ETH", async function () { await expect(raffle.enterRaffle()).to.be.revertedWithCustomError( raffle, "Raffle__EntranceFeeNotEnough()" ); }); it("Records player when it enters the Raffle", async function () { await raffle.enterRaffle({ value: raffleEntranceFee }); const player_zero = await raffle.getPlayer(0); assert.equal(player_zero, deployer); }); it("Doesn't allow entrance if Raffle State is close", async function () { await raffle.enterRaffle({ value: raffleEntranceFee }); await network.provider.send("evm_increaseTime", [Number(interval) + 1]); await network.provider.send("evm_mine", []); // Perform upkeep by pretending as a Chainlink keeper await raffle.performUpkeep([]); await expect( raffle.enterRaffle({ value: raffleEntranceFee }) ).to.be.revertedWithCustomError(raffle, Raffle__NotOpen); }); it("Emits an event on entering the raffle", async function () { await expect(await raffle.enterRaffle({ value: raffleEntranceFee })).to.emit( raffle, "RaffleEnter" ); }); }); });Can anyone please help me on how to solve this one.
Beta Was this translation helpful? Give feedback.
All reactions