Skip to content

A trivial doubt. #2016

Answered by SatamSai
adityabhattad2021 asked this question in Q&A
Aug 24, 2022 · 2 comments · 14 replies
Discussion options

You must be logged in to vote

tx.wait(1) basically means we are waiting for 1 block to be added after our transaction and code doesn't executes further until we get 1 block confirmation
Higher number of block confirmations finalize your transaction and you should wait for at least 6 blocks confirmations as mentioned in the course beginning so we use it to generate tx receipt (which can be useful for events emitted) after some blocks. But during testing we don't have much time to wait so we wait for 1 block.

Code still works if you avoid tx.wait().
But we should wait for some blocks to get mined

Replies: 2 comments 14 replies

Comment options

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

@adityabhattad2021
Comment options

@krakxn
Comment options

@adityabhattad2021
Comment options

Comment options

You must be logged in to vote
10 replies
@krakxn
Comment options

@SatamSai
Comment options

@adityabhattad2021
Comment options

@krakxn
Comment options

@SatamSai
Comment options

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