Lesson #9 Error: VM Exception while processing transaction: reverted with custom error 'InvalidConsumer()' #5661
-
I have been trying to solve this error by trying the suggestions made in similar discussions around it, but it seems to lead to another error and it's like i'm circling back. First i had this error, after running test :
On the similar discussions, i saw that i had to install a specific version of @chainlinks/contracts : npm i --save-dev @chainlink/contracts@0.4.0 (of which i had the latest version at the time), after the installation, i got this error:
The suggestions for similar discussions is that i had to upgrade back to the latest version of @chainlink/contracts i was using. Here's my Raffle.test.js code : !developmentChains.includes(network.name)
` my hardhat.config.js :
and my package.json:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Did you add Consumer while deploying the contract?, like this: |
Beta Was this translation helpful? Give feedback.
-
In you Raffle contract why are you inheriting from
In your |
Beta Was this translation helpful? Give feedback.
Did you add Consumer while deploying the contract?, like this:
await vrfCoordinatorV2Mock.addConsumer(subscriptionId, raffle.address)
see here https://github.com/PatrickAlphaC/hardhat-smartcontract-lottery-fcc/blob/main/deploy/01-deploy-raffle.js