Skip to content

Lesson 7: Error in the second test for "withdraw" function #1579

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

You must be logged in to vote

I forgot to add the await keyword to the fundMeConnectedContract.fund({ value: sendValue }) line at the starting of the test "allows us to withdraw with multiple funders". I also changed the for loop constraints from for (let i = 0; i < 6; i++) to for (let i = 1; i < 6; i++).

This is before correction:

for (let i = 0; i < 6; i++) {
                const fundMeConnectedContract = await fundMe.connect(
                    accounts[i]
                )
                fundMeConnectedContract.fund({ value: sendValue })
            }

and this is after correction:

for (let i = 1; i < 6; i++) {
                const fundMeConnectedContract = await fundMe.connect(
                    accounts[i]

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by Varshacs004
Comment options

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

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