Skip to content

Commit f2a2d0b

Browse files
chore: update bridge submitTx interface + location enum (#47426)
<!-- 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** <!-- 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? --> Bumps the bridge controllers and integrates the new `submitTx` function signature ## **Changelog** <!-- 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` 2. 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: chore: update bridge submitTx interface + location enum ## **Related issues** Fixes: N/A ## **Manual testing steps** 1. Go to this page... 2. 3. ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] 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). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] 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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes the bridge transaction submission RPC payload and upgrades bridge-related controllers; misalignment could break swaps/bridges until manually verified. > > **Overview** > Bumps **@metamask/bridge-controller** to `^83.1.3` and **@metamask/bridge-status-controller** to `^78.0.0`, with lockfile churn for related controller/network/Solana deps. Drops the old `bridge-controller@82.0.2` yarn resolution. > > **submitTx** calls from `ui/ducks/bridge-status/actions.ts` now pass a **single options object** to `BridgeStatusController:submitTx` (`quoteResponses`, `isStxEnabled`, `quotesReceivedContext`, `location`, migration phase, etc.) instead of a long positional argument list; the unit test expectation matches that shape. > > LavaMoat policies across MV2/MV3 builds narrow **@metamask/bridge-controller>uuid** globals from blanket `crypto` to `crypto.getRandomValues` and `crypto.randomUUID`. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit f65d53e. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
1 parent 6c864f3 commit f2a2d0b

12 files changed

Lines changed: 192 additions & 99 deletions

File tree

‎lavamoat/webpack/mv2/beta/policy.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7705,7 +7705,8 @@
77057705
},
77067706
"@metamask/bridge-controller>uuid": {
77077707
"globals": {
7708-
"crypto": true
7708+
"crypto.getRandomValues": true,
7709+
"crypto.randomUUID": true
77097710
}
77107711
},
77117712
"@metamask/bridge-status-controller>uuid": {

‎lavamoat/webpack/mv2/experimental/policy.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7705,7 +7705,8 @@
77057705
},
77067706
"@metamask/bridge-controller>uuid": {
77077707
"globals": {
7708-
"crypto": true
7708+
"crypto.getRandomValues": true,
7709+
"crypto.randomUUID": true
77097710
}
77107711
},
77117712
"@metamask/bridge-status-controller>uuid": {

‎lavamoat/webpack/mv2/flask/policy.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7705,7 +7705,8 @@
77057705
},
77067706
"@metamask/bridge-controller>uuid": {
77077707
"globals": {
7708-
"crypto": true
7708+
"crypto.getRandomValues": true,
7709+
"crypto.randomUUID": true
77097710
}
77107711
},
77117712
"@metamask/bridge-status-controller>uuid": {

‎lavamoat/webpack/mv2/main/policy.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7705,7 +7705,8 @@
77057705
},
77067706
"@metamask/bridge-controller>uuid": {
77077707
"globals": {
7708-
"crypto": true
7708+
"crypto.getRandomValues": true,
7709+
"crypto.randomUUID": true
77097710
}
77107711
},
77117712
"@metamask/bridge-status-controller>uuid": {

‎lavamoat/webpack/mv3/beta/policy.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8039,7 +8039,8 @@
80398039
},
80408040
"@metamask/bridge-controller>uuid": {
80418041
"globals": {
8042-
"crypto": true
8042+
"crypto.getRandomValues": true,
8043+
"crypto.randomUUID": true
80438044
}
80448045
},
80458046
"@metamask/bridge-status-controller>uuid": {

‎lavamoat/webpack/mv3/experimental/policy.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8039,7 +8039,8 @@
80398039
},
80408040
"@metamask/bridge-controller>uuid": {
80418041
"globals": {
8042-
"crypto": true
8042+
"crypto.getRandomValues": true,
8043+
"crypto.randomUUID": true
80438044
}
80448045
},
80458046
"@metamask/bridge-status-controller>uuid": {

‎lavamoat/webpack/mv3/flask/policy.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8039,7 +8039,8 @@
80398039
},
80408040
"@metamask/bridge-controller>uuid": {
80418041
"globals": {
8042-
"crypto": true
8042+
"crypto.getRandomValues": true,
8043+
"crypto.randomUUID": true
80438044
}
80448045
},
80458046
"@metamask/bridge-status-controller>uuid": {

‎lavamoat/webpack/mv3/main/policy.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8039,7 +8039,8 @@
80398039
},
80408040
"@metamask/bridge-controller>uuid": {
80418041
"globals": {
8042-
"crypto": true
8042+
"crypto.getRandomValues": true,
8043+
"crypto.randomUUID": true
80438044
}
80448045
},
80458046
"@metamask/bridge-status-controller>uuid": {

‎package.json‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@
180180
"@metamask/eth-sig-util": "^9.0.0",
181181
"@metamask/network-controller": "^38.0.0",
182182
"@metamask/transaction-controller": "72.3.0",
183-
"@metamask/bridge-controller@npm:^82.0.2": "82.0.2",
184183
"reselect@npm:^5.1.1": "5.1.1",
185184
"@humanfs/node@npm:^0.16.6": "^0.16.8",
186185
"follow-redirects": "^1.16.2",
@@ -424,8 +423,8 @@
424423
"@metamask/base-data-service": "^2.1.0",
425424
"@metamask/bitcoin-wallet-snap": "^3.3.0",
426425
"@metamask/bitcoin-wallet-standard": "^1.1.0",
427-
"@metamask/bridge-controller": "^83.1.2",
428-
"@metamask/bridge-status-controller": "^77.0.0",
426+
"@metamask/bridge-controller": "^83.1.3",
427+
"@metamask/bridge-status-controller": "^78.0.0",
429428
"@metamask/browser-passworder": "^6.0.0",
430429
"@metamask/chain-agnostic-permission": "^2.1.0",
431430
"@metamask/chomp-api-service": "^4.0.2",

‎ui/ducks/bridge-status/actions.test.ts‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,17 @@ describe('bridge status background actions', () => {
2929
expect(messengerCall).toHaveBeenCalledWith(
3030
'BridgeStatusController:submitTx',
3131
[
32-
'0x123',
33-
quote,
34-
true,
35-
{},
36-
MetaMetricsSwapsEventSource.MainView,
37-
undefined,
38-
[],
39-
null,
40-
undefined,
41-
'fiat_value',
42-
BRIDGE_QUOTE_RESPONSE_MIGRATION_PHASE,
32+
{
33+
accountAddress: '0x123',
34+
quoteResponses: [quote],
35+
isStxEnabled: true,
36+
quotesReceivedContext: {},
37+
location: MetaMetricsSwapsEventSource.MainView,
38+
activeAbTests: [],
39+
tokenSecurityTypeDestination: null,
40+
inputPrimaryDenomination: 'fiat_value',
41+
migrationPhase: BRIDGE_QUOTE_RESPONSE_MIGRATION_PHASE,
42+
},
4343
],
4444
);
4545
});

0 commit comments

Comments
 (0)