Conversation
requireApproval option to addTransaction method option bagrequireApproval option to addTransaction method option bag
4e872ff to
a33c64c
Compare
mcmire
reviewed
Aug 14, 2023
packages/transaction-controller/src/TransactionController.test.ts
Outdated
Show resolved
Hide resolved
8e49362 to
5409a31
Compare
| { | ||
| deviceConfirmedOn, | ||
| origin, | ||
| requireApproval = true, |
Member
There was a problem hiding this comment.
Rather than default here, can we leave it without a default and pass it to processApproval as possibly undefined and then have a single explicit requireApproval !== false before requesting the approval to ensure the only way to disable is with an explicit false.
Currently you could pass anything that is falsy like null or 0 and it would disable the approval.
Member
Author
There was a problem hiding this comment.
Thats a good spot Matthew, committed the suggested way.
packages/transaction-controller/src/TransactionController.test.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Matthew Walsh <matthew.walsh@consensys.net>
Co-authored-by: Matthew Walsh <matthew.walsh@consensys.net>
b18b748 to
f7b006d
Compare
vinistevam
approved these changes
Aug 16, 2023
…oval-in-the-core-transaction-controller
Merged
MajorLift
pushed a commit
that referenced
this pull request
Oct 11, 2023
MajorLift
pushed a commit
that referenced
this pull request
Oct 11, 2023
This file contains hidden or 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
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.
Explanation
This PR aims to add
requireApprovaloption toaddTransactionmethod options in order to either force or skip creating approval for transactions.As seen in the PR
requireApprovaldefault value will betrueto keep the same behavior as before, and set explicitly tofalsein order to skip approval.Changelog
@metamask/transaction-controllerrequireApprovaloption toaddTransactionmethod options.Checklist