Skip to content

Commit 1dd7251

Browse files
authored
Merge branch 'main' into feat/multi-srp-import-srp
2 parents f684cab + e8fa02b commit 1dd7251

File tree

146 files changed

+4488
-1191
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+4488
-1191
lines changed

app/_locales/de/messages.json

-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/_locales/el/messages.json

-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/_locales/en/messages.json

+14-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/_locales/en_GB/messages.json

+14-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/_locales/es/messages.json

-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/_locales/fr/messages.json

-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/_locales/hi/messages.json

-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/_locales/id/messages.json

-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/_locales/ja/messages.json

-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/_locales/ko/messages.json

-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/_locales/pt/messages.json

-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/_locales/ru/messages.json

-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/_locales/tl/messages.json

-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/_locales/tr/messages.json

-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/_locales/vi/messages.json

-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/_locales/zh_CN/messages.json

-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/scripts/controllers/app-state-controller.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@ describe('AppStateController', () => {
371371
id: '123',
372372
chainId: '0x1',
373373
timestamp: new Date().getTime(),
374+
origin: 'https://example.com',
374375
};
375376

376377
controller.setLastInteractedConfirmationInfo(

app/scripts/controllers/bridge-status/bridge-status-controller.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const getMessengerMock = ({
2020
} = {}) =>
2121
({
2222
call: jest.fn((method: string) => {
23-
if (method === 'AccountsController:getSelectedAccount') {
23+
if (method === 'AccountsController:getSelectedMultichainAccount') {
2424
return { address: account };
2525
} else if (method === 'NetworkController:findNetworkClientIdByChainId') {
2626
return 'networkClientId';
@@ -216,7 +216,7 @@ describe('BridgeStatusController', () => {
216216
let getSelectedAccountCalledTimes = 0;
217217
const messengerMock = {
218218
call: jest.fn((method: string) => {
219-
if (method === 'AccountsController:getSelectedAccount') {
219+
if (method === 'AccountsController:getSelectedMultichainAccount') {
220220
let account;
221221
if (getSelectedAccountCalledTimes === 0) {
222222
account = '0xaccount1';
@@ -399,7 +399,7 @@ describe('BridgeStatusController', () => {
399399
jest.useFakeTimers();
400400
const messengerMock = {
401401
call: jest.fn((method: string) => {
402-
if (method === 'AccountsController:getSelectedAccount') {
402+
if (method === 'AccountsController:getSelectedMultichainAccount') {
403403
return { address: '0xaccount1' };
404404
} else if (
405405
method === 'NetworkController:findNetworkClientIdByChainId'

app/scripts/controllers/bridge-status/bridge-status-controller.ts

+10-4
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ export default class BridgeStatusController extends StaticIntervalPollingControl
157157
targetContractAddress,
158158
} = startPollingForBridgeTxStatusArgs;
159159
const { bridgeStatusState } = this.state;
160-
const { address: account } = this.#getSelectedAccount();
160+
const accountAddress = this.#getMultichainSelectedAccountAddress();
161161

162162
// Write all non-status fields to state so we can reference the quote in Activity list without the Bridge API
163163
// We know it's in progress but not the exact status yet
@@ -176,7 +176,7 @@ export default class BridgeStatusController extends StaticIntervalPollingControl
176176
},
177177
initialDestAssetBalance,
178178
targetContractAddress,
179-
account,
179+
account: accountAddress,
180180
status: {
181181
// We always have a PENDING status when we start polling for a tx, don't need the Bridge API for that
182182
// Also we know the bare minimum fields for status at this point in time
@@ -210,8 +210,14 @@ export default class BridgeStatusController extends StaticIntervalPollingControl
210210
await this.#fetchBridgeTxStatus(pollingInput);
211211
};
212212

213-
#getSelectedAccount() {
214-
return this.messagingSystem.call('AccountsController:getSelectedAccount');
213+
// Returns an empty string if no account is selected, but this will never happen since
214+
// the multichain selected account defaults to the EVM account
215+
#getMultichainSelectedAccountAddress() {
216+
return (
217+
this.messagingSystem.call(
218+
'AccountsController:getSelectedMultichainAccount',
219+
)?.address ?? ''
220+
);
215221
}
216222

217223
#fetchBridgeTxStatus = async ({

app/scripts/controllers/bridge-status/types.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
NetworkControllerGetNetworkClientByIdAction,
99
NetworkControllerGetStateAction,
1010
} from '@metamask/network-controller';
11-
import { AccountsControllerGetSelectedAccountAction } from '@metamask/accounts-controller';
11+
import { AccountsControllerGetSelectedMultichainAccountAction } from '@metamask/accounts-controller';
1212
import { TransactionControllerGetStateAction } from '@metamask/transaction-controller';
1313
import {
1414
BridgeHistoryItem,
@@ -63,7 +63,7 @@ type AllowedActions =
6363
| NetworkControllerFindNetworkClientIdByChainIdAction
6464
| NetworkControllerGetStateAction
6565
| NetworkControllerGetNetworkClientByIdAction
66-
| AccountsControllerGetSelectedAccountAction
66+
| AccountsControllerGetSelectedMultichainAccountAction
6767
| TransactionControllerGetStateAction;
6868

6969
/**

0 commit comments

Comments
 (0)