-
|
Hi! I am in the part of raffle contract and in the unit tests i dont understand the parameters that Patrick passed to fullfill random words. Fullfill random words should receive a subscriptionid and an array, but in the second parameter i think patrick sent an address and i dont understand what is happening under the hood. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
|
Hello @h0leee, I hope this summary helps up. After Calling
txReceipt.events[1].ars.requestIdTo complete the mocking of the actual process, we manually call the Now, Our |
Beta Was this translation helpful? Give feedback.


Hello @h0leee, I hope this summary helps up.
After
upkeepNeededis true, we manually callperformUpkeep.Calling
performUpkeepwill create a transaction, this function makes a contract call torequestRandomWordsof the VRFCoordinatorV2Mock, which after executing its logic will emit an event and return therequestIdto our contract.performUpkeepreceives the id from the Coordinator and emits a second event from which we grab therequestIdwith:To complete the mocking of the actual process, we manually call the
fulfillRandomWordsof the VRFCoordinatorV2Mock and pass the id and the address of the raffle as arguments.Now,
fulfillRandomWordsof the Coordina…