AssertionError: Expected transaction to be reverted with "nonexistant request" #5413
Replies: 1 comment
-
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.
-
Hi got this error whan i tested my fulfillRandomWords
AssertionError: Expected transaction to be reverted with "nonexistant request", but other reason was found: "nonexistent request"
test code :
`const { getNamedAccounts, deployments, ethers, network } = require("hardhat")
const { developmentChains } = require("../../helper-hardhat-config.js")
const { assert, expect } = require("chai")
const { networkConfig } = require("../../helper-hardhat-config")
const { FunctionFragment } = require("ethers/lib/utils")
!developmentChains.includes(network.name)
? describe.skip
: describe("Raffle Unit tests", function () {
let raffle, vrfCoordinatorV2Mock, raffleEntranceFee, deployer, interval
const chainId = network.config.chainId
beforeEach(async function () {
deployer = (await getNamedAccounts()).deployer
await deployments.fixture(["all"])
raffle = await ethers.getContract("Raffle", deployer)
vrfCoordinatorV2Mock = await ethers.getContract("VRFCoordinatorV2Mock", deployer)
raffleEntranceFee = await raffle.getEntranceFee()
interval = await raffle.getInterval()
})
`
solidity code:
`// SPDX-License-Identifier: MIT
// Pragma
pragma solidity ^0.8.7;
import "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol";
import "@chainlink/contracts/src/v0.8/interfaces/KeeperCompatibleInterface.sol";
error Raffle_NOTENOUGHETHTOENTERRAFFLE();
error Raffle_TRANSFERfailed();
error Raffle__LotteryNotOPEN();
error Raffle__NotUpKeepNeedeed(uint256 currentBalance, uint256 numPlayers, uint256 raffleState);
/**@title A sample of Raffle Contract
*/
contract Raffle is VRFConsumerBaseV2, KeeperCompatibleInterface {
/Type declaration/
enum RaffleState {
OPEN,
CALCULATING
}
}
`
Beta Was this translation helpful? Give feedback.
All reactions