Skip to content

Allow updateTransactionGasFees for unapproved or submitted transactions#8042

Open
vinistevam wants to merge 7 commits intomainfrom
vs/add-validation-gas-fee
Open

Allow updateTransactionGasFees for unapproved or submitted transactions#8042
vinistevam wants to merge 7 commits intomainfrom
vs/add-validation-gas-fee

Conversation

@vinistevam
Copy link
Contributor

@vinistevam vinistevam commented Feb 25, 2026

Explanation

  • Add validateIfTransactionUnapprovedOrSubmitted in utils.ts and use it in updateTransactionGasFees so it accepts both TransactionStatus.unapproved and TransactionStatus.submitted.
  • Update and add unit tests in TransactionController.test.ts and utils.test.ts.
  • Changelog: allow updateTransactionGasFees for submitted as well as unapproved.

References

Fixes https://github.com/MetaMask/MetaMask-planning/issues/7051

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 communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Medium Risk
Changes a state-validation guard to permit mutating gas parameters after a tx is already submitted, which could affect transaction lifecycle assumptions and downstream consumers. Scope is limited and covered by targeted unit tests.

Overview
updateTransactionGasFees now permits transactions in TransactionStatus.submitted in addition to unapproved, using a new validateIfTransactionUnapprovedOrSubmitted helper and updated error messaging.

Adds unit coverage for the new validator and for successfully updating gas fields on a submitted transaction, and documents the behavior change in the transaction-controller changelog.

Written by Cursor Bugbot for commit f983bd0. This will update automatically on new commits. Configure here.

@vinistevam vinistevam requested a review from a team as a code owner February 25, 2026 14:51
@vinistevam vinistevam requested a review from a team as a code owner February 25, 2026 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants