Skip to content

lesson-9 testing Question #2363

Answered by othaime-en
TimeKeyRoll asked this question in Q&A
Discussion options

You must be logged in to vote

@MasterofBlockchain on line 37, playerFromContract is assigned to lottery.GetPlayer(0) If you look at the contract code, the function GetPlayer(0) returns the player that joined the lottery (at index 0). In this case, on line 35, you joined the lottery with the deployer account. Which means that the s_players array already contrains one player: The deployer. So calling the getPlayer(0) function should return the deployer account assigned to playerFromContract. Therefore that is why we check if playerFromContract is similar to deployer to make sure that indeed the right account got stored in the players array

Replies: 2 comments 14 replies

Comment options

You must be logged in to vote
13 replies
@TimeKeyRoll
Comment options

@othaime-en
Comment options

@TimeKeyRoll
Comment options

@othaime-en
Comment options

@TimeKeyRoll
Comment options

Answer selected by TimeKeyRoll
Comment options

You must be logged in to vote
1 reply
@TimeKeyRoll
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