Open kds93419 opened 9 months ago
So after adding a try catch to your test file I found that the problem is that the "performUpkeep" function returns a "Raffle_UpkeepNotNeeded(30000000000000000, 3, 0)" error.
The error is caused by the: bool timePassed = ((block.timestamp - s_lastTimeStamp) > i_interval); check inside of the checkUpkeep function - the i_interval set inside of the cunstructor is greater then the actual timestamp - the timestamps set in constructor.
The only way I found to make this code work was to decrease the "keepersUpdateInterval" inside of the helper-hardhat file from 30 seconds to like 2-3 seconds. But I am not sure how is it possible that the code from Patrick works with 30 seconds without increasing the time with evm_increaseTime.
Discussed in https://github.com/smartcontractkit/full-blockchain-solidity-course-js/discussions/6148