Skip to content

Lesson 9: Why we have different balance during the tests? #3079

Answered by alymurtazamemon
zjy-1998 asked this question in Q&A
Discussion options

You must be logged in to vote

@zjy-1998

  1. Your balance is updated in the second test because we deposit the fund using enterRaffle function.
  2. [] & 0x both are ways to pass an empty array.
  3. We are calling the performUpkeep, it will call the checkUpkeep internally and do all the calculations.
  4. In this test we are checking returns false if raffle isn't open whether the raffle is open or not. so after calling performUpkeep we are getting the raffle state and checking here assert.equal(raffleState.toString() == "1", upkeepNeeded == false)
  5. We are calling the checkUpkeep a second time to check whether upkeepNeeded is true or false. Because if raffle is in OPEN state it should return false and we are also checking in the same ass…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@zjy-1998
Comment options

Answer selected by zjy-1998
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