lesson-14 randomNft
function
#2945
-
In the Video Patrick has not shown/Written this function.However this is Updated in
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
@othaime-en Probably You will have the good explanation on this? |
Beta Was this translation helpful? Give feedback.
-
@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 |
Beta Was this translation helpful? Give feedback.
@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…