Skip to content

lesson-14 randomNft function #2945

Discussion options

You must be logged in to vote

@TimeKeyRoll Patrick created this function for the test use case, through this function Patrick wanted to check whether the contract is initialized properly or not. He had called this function inside the constructor of the contract and because this function is private, it cannot be called outside of the contract, which means it gets only called once the contract initializes the first time.

This function has a bool variable that is initially false but once this function gets called it turns this bool variable to true s_initialized, and Patrick had created a getter function for it so we can call this function in our tests to check whether it is true or not. If it is not true, it means the c…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by TimeKeyRoll
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