Skip to content

Block waiting confusion.. #2109

Answered by othaime-en
TimeKeyRoll asked this question in Q&A
Aug 27, 2022 · 3 comments · 8 replies
Discussion options

You must be logged in to vote

Hey @MasterofBlockchain as we know, the code await FundMe.withdrawal() executes the withdraw function but it also returns a transaction receipt (in the form of a promise). So doing const tx = await FundMe.withdrawal() actually captures the txReceipt if you want to use it. Part of the methods that comes with the transaction receipt is the wait() function/method. The syntax for .wait() is transaction.wait(Number of confirmations)
What the .wait() method does is that we are telling hardhat to wait for whatever confirmations we put inside the bracket to resolve the transaction receipt. So if we put .wait(2) we are saying that we want to wait until our transaction has been confirmed in 2 mined…

Replies: 3 comments 8 replies

Comment options

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

@TimeKeyRoll
Comment options

@othaime-en
Comment options

Comment options

You must be logged in to vote
4 replies
@TimeKeyRoll
Comment options

@othaime-en
Comment options

@TimeKeyRoll
Comment options

@othaime-en
Comment options

Answer selected by TimeKeyRoll
Comment options

You must be logged in to vote
1 reply
@TimeKeyRoll
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
3 participants