-
Notifications
You must be signed in to change notification settings - Fork 265
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
Add txOverrides
option for overriding transaction parameters
#852
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
4a4ede3
allow for optional tx override parameters
passabilities 5e7ad58
only add tx overrides if it is defined
passabilities cc25421
Move txOverrides to Hardhat/Truffle specific options
ericglau 6868acf
Remove .idea folder
ericglau 9caeab3
Fix undefined check
ericglau 2b5a531
Add overrides for upgradeProxy
ericglau ae4e27b
Add override to upgradeBeacon
ericglau d0e3103
Adding Hardhat tests
ericglau eecde28
Add overrides for admin functions
ericglau fa280ba
Add overrides for admin functions in Truffle
ericglau d1001f4
Add Truffle tests
ericglau 1e9f895
Change back to import type
ericglau 67b7b7f
Add Truffle options type
ericglau 44d292e
Update changelogs
ericglau 9b37380
Remove txOverrides for platform.deployContract
ericglau 60178dd
Update docs
ericglau 254f029
Merge branch 'master' into master
ericglau e34da20
Relax type
ericglau c7f1b6d
Simplify types using txOverrides
ericglau bd85399
Clarify comment
ericglau File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
Oops, something went wrong.
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.
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.
What happens if you just write
upgradeTo(nextImpl, overrides)
?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.
That would cause an error because then
overrides
appears as an array and Ethers tries to use it as part of the actual function arguments.We need to spread the array because its element
opts.txOverrides
is the actual overrides object, and if that is not present, then it will be excluded.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.
Sorry my question was actually if we write
upgradeTo(nextImpl, opts.txOverrides)
🙂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.
That doesn't work, but we could use either:
upgradeTo(nextImpl, opts.txOverrides ?? {})
or
upgradeTo(nextImpl, withDefaults(opts).txOverrides)
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.
I'm not sure that these options will work with Truffle, I recall it working weird if you pass an empty object.
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.
Right, these don't work for Truffle. Will leave them as-is for both Hardhat and Truffle, for consistency.