Skip to content

Lesson 9: ReferenceError: startingBalance is not defined #5990

Answered by Melisepoon
Melisepoon asked this question in Q&A
Discussion options

You must be logged in to vote

yep! this works fine! but another solution that i've derived would be to completely remove the try-catch block, as per Patrick's video as so:

                        const tx = await raffle.performUpkeep("0x")
                        const txReceipt = await tx.wait(1)
                        const winnerStartingBalance = await accounts[1].getBalance()
                        await vrfCoordinatorV2Mock.fulfillRandomWords(
                            txReceipt.events[1].args.requestId,
                            raffle.address,
                        )

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Melisepoon
Comment options

Answer selected by Melisepoon
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