i'm getting this error while testing patrick collins smart-contract-lottery project, below is the part where the error coming from.
describe("checkUpkeep", async function () {
it("returns false if no one sends ETH", async function () {
await network.provider.send("evm_increaseTime", [parseInt(interval) + 1]);
await network.provider.send("evm_mine", []);
const { upkeepNeeded } = await raffle.callStatic.checkUpkeep("0x");
assert(!upkeepNeeded);
});
});
the relevant code of function from the contract is down below.
function performUpkeep(bytes calldata /*performData*/) external override {
(bool upkeepNeeded, ) = checkUpkeep("");
if (!upkeepNeeded) {
revert Raffle__upKeepNotNeeded(
address(this).balance,
s_players.length,
uint256(s_raffleState)
);
}
s_raffleState = RaffleState.CALCULATING;
s_requestId = i_vrfcoordinator.requestRandomWords(
i_gasLane,
i_subscriptionId,
REQUEST_CONFIRMATIONS,
i_callbackGasLimit,
NUM_WORDS
);
emit RequestedRaffleWinner(s_requestId);
}
when i remove callStatic it works well, i think the problrm is from callStatic. can anyone help to solve this.