Skip to content

Error with Lottery testDontAllowPlayersToEnterWhileRaffleIsCalculating test #3234

Answered by ismaildawoodjee
TheJazzDev asked this question in Q&A
Discussion options

You must be logged in to vote

If you look at the last two lines of your error logs, you will see that it is reverting due to Raffle__UpkeepNotNeeded error, which is within the performUpkeep function:

    function performUpkeep(bytes calldata /* performData */ ) external override {
        // If all conditions are met to perform upkeep, execute this function
        (bool upkeepNeeded,) = checkUpkeep("");
        if (!upkeepNeeded) {
            revert Raffle__UpkeepNotNeeded(address(this).balance, s_listOfPlayers.length, s_raffleState);
        }
        s_raffleState = RaffleState.CALCULATING; // Can also be RaffleState(1), when picking out the winner

This means checkUpkeep function is returning false because the fou…

Replies: 2 comments 2 replies

Comment options

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

Answer selected by TheJazzDev
Comment options

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

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