lesson-9 testing questions! #2520
-
Hi! I am not sure where is this
How this line of code is written?
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Hey @MasterofBlockchain remember when I told you if we want to interact with the events from a contract we use a transaction receipt? Well this is how we interact with an event. So here in the line |
Beta Was this translation helpful? Give feedback.
Hey @MasterofBlockchain remember when I told you if we want to interact with the events from a contract we use a transaction receipt? Well this is how we interact with an event. So here in the line
txReceipt.events[1].args.requestId
we are accessing the events from the transaction receipt,1
represents the index of the event (the second event), andargs
is the arguments that are carried in the event. If you look at our events from the contract, specifically the one being emitted byperformUpkeep
you'll findemit RequestedRaffleWinner(requestId);
it has an argumentrequestId
. So that's why we are usingargs
because we want to access the arguments contained in these emitted events.