-
-
Notifications
You must be signed in to change notification settings - Fork 231
feat: Re-simulate active transactions every 3000 ms #5189
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: Re-simulate active transactions every 3000 ms #5189
Conversation
@metamaskbot publish-preview |
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions.
|
@metamaskbot publish-preview |
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions.
|
@metamaskbot publish-preview |
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions.
|
f159aea
to
ea69888
Compare
@metamaskbot publish-preview |
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions.
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions.
|
@metamaskbot publish-preview |
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions.
|
packages/transaction-controller/src/helpers/ResimulateHelper.ts
Outdated
Show resolved
Hide resolved
packages/transaction-controller/src/helpers/ResimulateHelper.ts
Outdated
Show resolved
Hide resolved
packages/transaction-controller/src/helpers/ResimulateHelper.ts
Outdated
Show resolved
Hide resolved
packages/transaction-controller/src/helpers/ResimulateHelper.ts
Outdated
Show resolved
Hide resolved
packages/transaction-controller/src/helpers/ResimulateHelper.ts
Outdated
Show resolved
Hide resolved
packages/transaction-controller/src/helpers/ResimulateHelper.ts
Outdated
Show resolved
Hide resolved
packages/transaction-controller/src/helpers/ResimulateHelper.ts
Outdated
Show resolved
Hide resolved
#29878) <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** This PR aims to implement re-simulation (updating `simulationData` on `transactionMeta`) of transaction type of confirmations on every 3 seconds if notification window is focused. Core PR that updates simulation data on `active` transactions: MetaMask/core#5189 <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> [](https://codespaces.new/MetaMask/metamask-extension/pull/29878?quickstart=1) ## **Related issues** Fixes: MetaMask/MetaMask-planning#3922 ## **Manual testing steps** See original task description. ## **Screenshots/Recordings** https://github.com/user-attachments/assets/2799fb7c-5e51-48e4-956a-0cf33b5150a4 ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [X] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [X] I've completed the PR template to the best of my ability - [X] I’ve included tests if applicable - [X] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [X] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
Explanation
This PR adds
ResimulateHelper
, which focuses ontransactionMeta.isActive
property and re-simulates transaction depending on that value.In order to capsulate re-simulation logic, this PR also relocates other utility functions under the new created
ResimulationHelper.ts
file.References
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/3922
Extension PR: MetaMask/metamask-extension#29878
Changelog
@metamask/transaction-controller
isActive
property ontransactionMeta
isActive
property is expected to set by client.isActive
istrue
.setTransactionActive
function to update theisActive
property ontransactionMeta
.Checklist