Skip to content

cant understand what patrick did here #4648

Answered by pacelliv
h0leee asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @h0leee, I hope this summary helps up.

After upkeepNeeded is true, we manually call performUpkeep.

Calling performUpkeep will create a transaction, this function makes a contract call to requestRandomWords of the VRFCoordinatorV2Mock, which after executing its logic will emit an event and return the requestId to our contract.

performUpkeep receives the id from the Coordinator and emits a second event from which we grab the requestId with:

txReceipt.events[1].ars.requestId

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…

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@Ahmedborwin
Comment options

@pacelliv
Comment options

@Ahmedborwin
Comment options

@ugur17
Comment options

@wxy-sudo
Comment options

Answer selected by h0leee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants