Skip to content

Lesson 9: error running tests - await raffle.performUpkeep("0x") #835

Answered by ghost
DorianDaSilva asked this question in Q&A
Discussion options

You must be logged in to vote

Assuming you’re happy to import VRFCoordinatorV2Mock from the @chainlink/contracts package, the following changes fix your code:

Step 1

Run yarn add @chainlink/contracts --dev

Step 2

Replace your VRFCoordinatorV2Mock.sol file content with:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@chainlink/contracts/src/v0.8/mocks/VRFCoordinatorV2Mock.sol";

Step 3

Delete your artifacts and cache directories.

Step 4

Fix typo on line 29 in 01-deploy-raffle.js (subscritpionId -> subscriptionId.)

Step 5

On line 78 in raffle.test.js, change interval.toNumber() + 1 to interval.toNumber() - 1.


If you insist on writing the VRFCoordinatorV2Mock code (rather than importing it from the @cha…

Replies: 3 comments 7 replies

Comment options

You must be logged in to vote
1 reply
@DorianDaSilva
Comment options

Comment options

You must be logged in to vote
3 replies
@DorianDaSilva
Comment options

@krakxn
Comment options

@DorianDaSilva
Comment options

Comment options

You must be logged in to vote
3 replies
@DorianDaSilva
Comment options

@ghost
Comment options

@DorianDaSilva
Comment options

Answer selected by DorianDaSilva
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants