Skip to content

Lesson 9: Quick question about performUpKeep test #1897

Answered by krakxn
emmanuelf37 asked this question in Q&A
Discussion options

You must be logged in to vote

No worries, see:

const tx = await raffle.performUpkeep([])

When the above gets called, the performUpkeep function of the Raffle contract is executed. And on further inspection, you will see that we further call checkUpkeep inside that function. Then, we use the conditionals you mentioned (for logic).

Put simply, performUpkeep is already using the upkeepNeeded = (isOpen && timePassed && hasPlayers && hasBalance); inside checkUpkeep.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by emmanuelf37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants