Skip to content

Commit d14d866

Browse files
authored
chore: upgrade @metamask/transaction-pay-controller to version 23.7.0 (MetaMask#31733)
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until this PR meets the canonical Definition of Ready For Review in `docs/readme/ready-for-review.md`. In short: the template must be materially complete (not just section titles present), all status checks must be currently passing, and the only expected follow-up commits must be reviewer-driven. --> <!-- mms-check directive vocabulary — read by .github/scripts/shared/pr-template-checks.ts at module load to build the validation plan. Directives are invisible in rendered markdown and must NOT be removed or edited without updating the validator registry. type=text Section must contain non-placeholder prose. type=changelog Section must have a valid CHANGELOG entry: line. type=issue-link Section must have a Fixes:/Closes:/Refs: line with a value. type=manual-testing Section must have real testing steps or an explicit N/A. type=screenshot Section must have evidence (image/URL) or an explicit N/A. type=checklist Section must have all checkboxes consciously checked. required=true|false Whether a missing/invalid section runs the validator at all. blocking=true|false Whether a failure of this check fails the CI workflow. Default: false — failures are shown as warnings in the sticky comment but do not block the PR. Sections without a directive are checked for structural presence only. --> ## **Description** Upgrade transaction-pay-controller to fix perps withdraw into money account ## **Changelog** <!-- mms-check: type=changelog required=true blocking=true --> <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 3. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: ## **Related issues** <!-- mms-check: type=issue-link required=true --> Fixes: https://consensyssoftware.atlassian.net/browse/CONF-1540 ## **Manual testing steps** NA ## **Screenshots/Recordings** NA ## **Pre-merge author checklist** <!-- mms-check: type=checklist required=true --> <!-- Every checklist item must be consciously assessed before marking this PR as "Ready for review". A checked box means you deliberately considered that responsibility, not that you literally performed every action listed. Unchecked boxes are ambiguous: they are not an implicit "N/A" and they are not a silent "skip". See `docs/readme/ready-for-review.md` for the full checklist semantics. --> - [X] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/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-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. #### Performance checks (if applicable) - [X] I've tested on Android - Ideally on a mid-range device; emulator is acceptable - [X] I've tested with a power user scenario - Use these [power-user SRPs](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/edit-v2/401401446401?draftShareId=9d77e1e1-4bdc-4be1-9ebb-ccd916988d93) to import wallets with many accounts and tokens - [X] I've instrumented key operations with Sentry traces for production performance metrics - See [`trace()`](/app/util/trace.ts) for usage and [`addToken`](/app/components/Views/AddAsset/components/AddCustomToken/AddCustomToken.tsx#L274) for an example For performance guidelines and tooling, see the [Performance Guide](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/400085549067/Performance+Guide+for+Engineers). ## **Pre-merge reviewer checklist** <!-- Reviewer checklist items follow the same semantics as the author checklist: an unchecked box is ambiguous, a checked box means the reviewer consciously assessed that responsibility. See `docs/readme/ready-for-review.md`. --> - [ ] 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.
1 parent 2042f90 commit d14d866

4 files changed

Lines changed: 15 additions & 10 deletions

File tree

app/core/Engine/controllers/transaction-controller/event-handlers/money-account-override.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,12 @@ describe('money-account-override', () => {
129129
);
130130

131131
const callback = setTransactionConfigMock.mock.calls[0][1];
132-
const config: { accountOverride?: string } = {};
132+
const config: { accountOverride?: string; isQuoteRequired?: boolean } =
133+
{};
133134
callback(config as never);
134135

135136
expect(config.accountOverride).toBe(EVM_ADDRESS_MOCK);
137+
expect(config.isQuoteRequired).toBe(true);
136138
});
137139

138140
it('sets accountOverride for a moneyAccountWithdraw transaction', () => {
@@ -359,9 +361,11 @@ describe('money-account-override', () => {
359361
);
360362

361363
const callback = setTransactionConfigMock.mock.calls[0][1];
362-
const config: { accountOverride?: string } = {};
364+
const config: { accountOverride?: string; isQuoteRequired?: boolean } =
365+
{};
363366
callback(config as never);
364367
expect(config.accountOverride).toBe(EVM_ADDRESS_MOCK);
368+
expect(config.isQuoteRequired).toBe(true);
365369
});
366370

367371
it('does NOT call replaceAccountInNestedTransactions for the card-link approve (single tx, no nested)', () => {

app/core/Engine/controllers/transaction-controller/event-handlers/money-account-override.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ export function handleUnapprovedTransactionAddedForMoneyAccount(
129129

130130
TransactionPayController.setTransactionConfig(transaction.id, (config) => {
131131
config.accountOverride = selectedAccount.address as Hex;
132+
config.isQuoteRequired = true;
132133
});
133134

134135
refreshOverrideAccountBalances();

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@
347347
"@metamask/superstruct": "^3.2.1",
348348
"@metamask/swappable-obj-proxy": "^2.1.0",
349349
"@metamask/transaction-controller": "^68.0.0",
350-
"@metamask/transaction-pay-controller": "^23.6.0",
350+
"@metamask/transaction-pay-controller": "^23.7.0",
351351
"@metamask/tron-wallet-snap": "^1.25.6",
352352
"@metamask/utils": "^11.11.0",
353353
"@metamask/wallet": "^3.0.0",

yarn.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8011,7 +8011,7 @@ __metadata:
80118011
languageName: node
80128012
linkType: hard
80138013

8014-
"@metamask/assets-controllers@npm:^109.0.0":
8014+
"@metamask/assets-controllers@npm:^109.0.0, @metamask/assets-controllers@npm:^109.1.0":
80158015
version: 109.1.0
80168016
resolution: "@metamask/assets-controllers@npm:109.1.0"
80178017
dependencies:
@@ -10379,15 +10379,15 @@ __metadata:
1037910379
languageName: node
1038010380
linkType: hard
1038110381

10382-
"@metamask/transaction-pay-controller@npm:^23.6.0":
10383-
version: 23.6.0
10384-
resolution: "@metamask/transaction-pay-controller@npm:23.6.0"
10382+
"@metamask/transaction-pay-controller@npm:^23.7.0":
10383+
version: 23.7.0
10384+
resolution: "@metamask/transaction-pay-controller@npm:23.7.0"
1038510385
dependencies:
1038610386
"@ethersproject/abi": "npm:^5.7.0"
1038710387
"@ethersproject/contracts": "npm:^5.7.0"
1038810388
"@ethersproject/providers": "npm:^5.7.0"
1038910389
"@metamask/assets-controller": "npm:^9.0.1"
10390-
"@metamask/assets-controllers": "npm:^109.0.0"
10390+
"@metamask/assets-controllers": "npm:^109.1.0"
1039110391
"@metamask/base-controller": "npm:^9.1.0"
1039210392
"@metamask/bridge-controller": "npm:^75.1.1"
1039310393
"@metamask/bridge-status-controller": "npm:^72.1.0"
@@ -10405,7 +10405,7 @@ __metadata:
1040510405
bn.js: "npm:^5.2.1"
1040610406
immer: "npm:^9.0.6"
1040710407
lodash: "npm:^4.17.21"
10408-
checksum: 10/3e4881d55a4935e09eff7d4e0a93177827f9c4848a5ffa9dbc16186b6c2ffc072c8adee00e4df8c002097979b0575c84d1a73fc2256a1f3c2b1e791967ac4bd7
10408+
checksum: 10/71178b4406853c84d8200d6d3399227d7f9104300c98e431c6a851ef70a6a89d17771d6e4c9c744451f0d7fd77ea2fe7383590d8c8719078bd7bee5bfdfcea4c
1040910409
languageName: node
1041010410
linkType: hard
1041110411

@@ -35417,7 +35417,7 @@ __metadata:
3541735417
"@metamask/test-dapp-multichain": "npm:^0.17.1"
3541835418
"@metamask/test-dapp-solana": "npm:^0.3.0"
3541935419
"@metamask/transaction-controller": "npm:^68.0.0"
35420-
"@metamask/transaction-pay-controller": "npm:^23.6.0"
35420+
"@metamask/transaction-pay-controller": "npm:^23.7.0"
3542135421
"@metamask/tron-wallet-snap": "npm:^1.25.6"
3542235422
"@metamask/utils": "npm:^11.11.0"
3542335423
"@metamask/wallet": "npm:^3.0.0"

0 commit comments

Comments
 (0)