Skip to content

Adds support re-create approval requests based on unapprovedTx when client restarts#1575

Merged
vinistevam merged 8 commits intomainfrom
feat/959-support-pending-tx-on-startup
Aug 16, 2023
Merged

Adds support re-create approval requests based on unapprovedTx when client restarts#1575
vinistevam merged 8 commits intomainfrom
feat/959-support-pending-tx-on-startup

Conversation

@vinistevam
Copy link
Contributor

@vinistevam vinistevam commented Aug 3, 2023

Explanation

This PR aims to add initApprovals function to support re-create approval requests based on unapprovedTx when the client restarts. This is an existent function in the extension and it's coming to the core as part of the effort to unify the TransactionController in the core and in the extension.

Changes:

  • Addtional parameter in processApproval and requestApproval to determine if when creates an approval request it should be shown (shouldShowRequest).
  • Created an utility function transactionMatchesNetwork to facilitate the validation of whether a given transaction matches the specified network or chain ID.

resolves: https://github.com/MetaMask/MetaMask-planning/issues/959

Changelog

@metamask/transaction-controller

  • ADDED: Adds initApprovals function to support re-create approval requests based on unapprovedTx when the client restarts

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate

@vinistevam vinistevam marked this pull request as ready for review August 3, 2023 16:26
@vinistevam vinistevam requested a review from a team as a code owner August 3, 2023 16:26
OGPoyraz
OGPoyraz previously approved these changes Aug 4, 2023
Copy link
Member

@OGPoyraz OGPoyraz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vinistevam vinistevam force-pushed the feat/959-support-pending-tx-on-startup branch from f979ae5 to a9a7c6b Compare August 4, 2023 10:58
OGPoyraz
OGPoyraz previously approved these changes Aug 4, 2023
@vinistevam vinistevam merged commit b4bf04a into main Aug 16, 2023
@vinistevam vinistevam deleted the feat/959-support-pending-tx-on-startup branch August 16, 2023 08:30
@matthewwalsh0 matthewwalsh0 mentioned this pull request Aug 24, 2023
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants