Skip to content
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

refactor: approve and reject transactions using approval controller #6641

Merged

Conversation

matthewwalsh0
Copy link
Member

@matthewwalsh0 matthewwalsh0 commented Jun 19, 2023

Description

Add a patch to the TransactionController to await the approval request being approved or rejected, before automatically performing the result logic, either signing and submitting the transaction, or cancelling it.

In addition, update all direct usage of the approveTransaction and cancelTransaction methods to instead use the ApprovalController to accept or reject the related approval request.

Checklist

  • There is a related GitHub issue
  • Tests are included if applicable
  • Any added code is fully documented

Approve and reject transactions via the approval controller.
Hide modal on error.
@github-actions
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@matthewwalsh0 matthewwalsh0 marked this pull request as ready for review June 19, 2023 16:27
@matthewwalsh0 matthewwalsh0 requested a review from a team as a code owner June 19, 2023 16:27
@socket-security
Copy link

socket-security bot commented Jun 19, 2023

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring: micro-ftch@0.3.1, react-native-vector-icons@6.4.2, @jridgewell/set-array@1.1.1, kleur@3.0.3, cheerio@1.0.0-rc.10

Next steps

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of package-name@version specifiers. e.g. @SocketSecurity ignore foo@1.0.0 bar@* or ignore all packages with @SocketSecurity ignore-all

@socket-security
Copy link

socket-security bot commented Jun 19, 2023

New and updated dependency changes detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives1 Size Publisher
@metamask/approval-controller ⬆️ 2.1.0...3.1.0 network +12/-0 3.71 MB metamaskbot

Footnotes

  1. https://docs.socket.dev

@matthewwalsh0
Copy link
Member Author

@SocketSecurity ignore-all

vinistevam
vinistevam previously approved these changes Jun 22, 2023
OGPoyraz
OGPoyraz previously approved these changes Jun 23, 2023
@matthewwalsh0 matthewwalsh0 dismissed stale reviews from OGPoyraz and vinistevam via ad95946 June 27, 2023 10:33
@sonarcloud
Copy link

sonarcloud bot commented Jun 27, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

3.7% 3.7% Coverage
0.0% 0.0% Duplication

@matthewwalsh0 matthewwalsh0 merged commit e1d5724 into main Jun 27, 2023
11 checks passed
@matthewwalsh0 matthewwalsh0 deleted the refactor/transaction-controller-await-approval-promise branch June 27, 2023 13:22
@github-actions github-actions bot locked and limited conversation to collaborators Jun 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants