-
|
The method we're using from the As far as I understood, this is a callback function, so it will run only when the ChainLink server has returned a random number we have been waiting for. The example source code in the lecture checks if the delivered number is strictly positive. This reads If this callback runs only once when the random number is returned, such |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Hello @fordicus how a interesting question
The callback could also fail (really not likely, but not imposible) may be the transaction get reverted on the blockchain, so this require is just to verify the actual random number was gotten and also (read bellow)
Yes, the fulfill randomness is an asynchronous call so you must continue with that function just once the callback was successfully made. Otherwise you will spend a lot of gas on a transaction which isn't already completed. |
Beta Was this translation helpful? Give feedback.
Hello @fordicus how a interesting question
The callback could also fail (really not likely, but not imposible) may be the transaction get reverted on the blockchain, so this require is just to verify the actual random number was gotten and also (read bellow)
Yes, the fulfill randomness is an asynchronous call so you must continue with that function just once the callback was successfully made. Otherwise you will spend a lot of gas on a transaction which isn't already completed.