-
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.requestId To 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
upkeepNeeded
is true, we manually callperformUpkeep
.Calling
performUpkeep
will create a transaction, this function makes a contract call torequestRandomWords
of the VRFCoordinatorV2Mock, which after executing its logic will emit an event and return therequestId
to our contract.performUpkeep
receives the id from the Coordinator and emits a second event from which we grab therequestId
with:To complete the mocking of the actual process, we manually call the
fulfillRandomWords
of the VRFCoordinatorV2Mock and pass the id and the address of the raffle as arguments.Now,
fulfillRandomWords
of the Coordina…