Lesson 9 Raffle__UpkeepNotNeeded being (incorrectly!) invoked #5157
-
I am running the following test. When I execute it, the error, Raffle__UpkeepNotNeeded is being thrown
I have extended the error in Raffle.sol to:
The error in the console is: I conclude that balance: 10000000000000000, numPlayers: 1, raffleState: 0 (i.e. OPEN) and interval: 33 (greater than 30) The performUpkeep function is:
The checkUpkeep function is:
I would really appreciate any insight into why this test is failing. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I found the answer here: #359 Add these lines to the end of checkUpkeep: I had previously tried this but when I added the lines, I forgot to re-deploy the contract before running the tests again. |
Beta Was this translation helpful? Give feedback.
I found the answer here: #359
Add these lines to the end of checkUpkeep:
upkeepNeeded = (timePassed && isOpen && hasBalance && hasPlayers);
return (upkeepNeeded, "0x0");
I had previously tried this but when I added the lines, I forgot to re-deploy the contract before running the tests again.