Skip to content

lesson-9 testing questions! #2520

Answered by othaime-en
TimeKeyRoll asked this question in Q&A
Discussion options

You must be logged in to vote

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), and args is the arguments that are carried in the event. If you look at our events from the contract, specifically the one being emitted by performUpkeep you'll find emit RequestedRaffleWinner(requestId); it has an argument requestId. So that's why we are using args because we want to access the arguments contained in these emitted events.

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@othaime-en
Comment options

@TimeKeyRoll
Comment options

@TimeKeyRoll
Comment options

@othaime-en
Comment options

@othaime-en
Comment options

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