Lesson 9: ReferenceError: startingBalance is not defined #5990
Answered
by
Melisepoon
Melisepoon
asked this question in
Q&A
-
Hi all! below is my code, for Raffle.test.js in lesson9. Hope someone will be able to assist me to resolve this. Thanks!
|
Beta Was this translation helpful? Give feedback.
Answered by
Melisepoon
Aug 10, 2023
Replies: 1 comment 1 reply
-
Try to take out this line const startingBalance = await accounts[2].getBalance()
try {
const tx = await raffle.performUpkeep("0x")
const txReceipt = await tx.wait(1)
await vrfCoordinatorV2Mock.fulfillRandomWords(
txReceipt.events[1].args.requestId,
raffle.address,
)
}catch (e) {
reject(e)
} I'm not sure if this perfect solution or not, but it will work fine. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: