-
Notifications
You must be signed in to change notification settings - Fork 554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat tx required confs #593
Merged
iamdefinitelyahuman
merged 22 commits into
eth-brownie:master
from
matnad:feat-tx-required-confs
Jun 3, 2020
Merged
Feat tx required confs #593
iamdefinitelyahuman
merged 22 commits into
eth-brownie:master
from
matnad:feat-tx-required-confs
Jun 3, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
required_confs = 0 will no not wait for confirmation and return a pending tx
iamdefinitelyahuman
requested changes
Jun 3, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good overall, couple minor things and those commented fixtures need removing.
remove required_confs as state, add it as function argument (remove api doc) add whitespace to "Transaction Lost.... "
iamdefinitelyahuman
approved these changes
Jun 3, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What I did
Add
required_confs
as an argument to transactions with a default value of 1 (same as current behaviour).Setting
required_confs = n > 1
will wait for n blocks to be mined before the transaction receipt is processed.If during the confirmation time the transaction is dropped (uncle block), the transaction will wait until it is picked up again and has the required amount of confirmations.
if
required_confs == 0
the transaction will immediately return a pending tx receipt and not wait for a confirmation.Add
tx.wait(n)
to retroactively add required_confs and wait until they are confirmed.TODO: Still needs more documentation
Closes #587
How I did it
Added the argument to all deply, transfer and transact functions.
Refactored the confirmation logic
How to verify it
I added tests for this.
or try
accounts[0].transfer(accounts[1], "1 ether", {'required_confs': 3})
Checklist