Lesson9: Unit tests are failing #5950
Chizitere01
started this conversation in
General
Replies: 1 comment
-
|
1- To solve this issue Add this condition to your if (developmentChains.includes(network.name)) {
const vrfCoordinatorV2Mock = await ethers.getContract("VRFCoordinatorV2Mock")
await vrfCoordinatorV2Mock.addConsumer(subscriptionId, raffle.address)
}after this you going to run into new issue, to solve it by change change const tx = await raffle.performUpkeep([])3- You are going to run into new issue change const requestId = txReceipt.events[1].args.requestedIdand add assert(raffleState.toString() == "1")4- To solve this issue change const tx = await raffle.performUpkeep([])and change await vrfCoordinatorV2Mock.fulfillRandomWords(
txReceipt.events[1].args.requestedId,
raffle.address
) output I hope it helps |
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.
-
In lesson 9 of the course, 5 out of the 14 unit tests are failing. The staging tests are working fine.
here are the errors I get
here is the link to my repo https://github.com/Chizitere01/Hardhat-SmartContract-Lottery-fcc/
Beta Was this translation helpful? Give feedback.
All reactions