Skip to content

Commit 2eeee6d

Browse files
Merge branch 'develop' into fix/simulation-hide-totals
2 parents 38f9913 + 67555ba commit 2eeee6d

27 files changed

Lines changed: 567 additions & 251 deletions

File tree

.circleci/config.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@ jobs:
404404
PR_RESPONSE=$(curl -s -H "Authorization: token ${GITHUB_TOKEN}" \
405405
"https://api.github.com/repos/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pulls?state=open&head=${CIRCLE_PROJECT_USERNAME}:${BRANCH}")
406406
echo "https://api.github.com/repos/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pulls?state=open&head=${CIRCLE_PROJECT_USERNAME}:${BRANCH}"
407+
407408
# Check if the response contains valid JSON
408409
if ! echo "$PR_RESPONSE" | jq empty; then
409410
echo "Failed to parse JSON response."
@@ -418,6 +419,16 @@ jobs:
418419
exit 1
419420
fi
420421
422+
# Check if the array of PRs is empty
423+
PR_COUNT=$(echo "$PR_RESPONSE" | jq '. | length')
424+
425+
# If no PRs are found, exit gracefully
426+
if [ "$PR_COUNT" -eq 0 ]; then
427+
echo "No open PRs found. Exiting."
428+
echo "false" > ./RUN_MMI_OPTIONAL
429+
exit 0
430+
fi
431+
421432
# Extract label names from the PR_RESPONSE
422433
LABEL_NAMES=$(echo "$PR_RESPONSE" | jq -r '.[0].labels[].name')
423434

app/_locales/en/messages.json

Lines changed: 7 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import { FirstTimeFlowType } from '../../../shared/constants/onboarding';
2+
import OnboardingController, { OnboardingControllerState } from './onboarding';
3+
4+
describe('OnboardingController', () => {
5+
let onboardingController: OnboardingController;
6+
7+
beforeEach(() => {
8+
onboardingController = new OnboardingController({
9+
initState: {
10+
seedPhraseBackedUp: null,
11+
firstTimeFlowType: null,
12+
completedOnboarding: false,
13+
onboardingTabs: {},
14+
},
15+
});
16+
});
17+
18+
it('should set the seedPhraseBackedUp property', () => {
19+
const newSeedPhraseBackUpState = true;
20+
onboardingController.setSeedPhraseBackedUp(newSeedPhraseBackUpState);
21+
const state: OnboardingControllerState =
22+
onboardingController.store.getState();
23+
expect(state.seedPhraseBackedUp).toBe(newSeedPhraseBackUpState);
24+
});
25+
26+
it('should set the firstTimeFlowType property', () => {
27+
const type: FirstTimeFlowType = FirstTimeFlowType.create;
28+
onboardingController.setFirstTimeFlowType(type);
29+
const state: OnboardingControllerState =
30+
onboardingController.store.getState();
31+
expect(state.firstTimeFlowType).toBe(type);
32+
});
33+
34+
it('should register a site for onboarding', async () => {
35+
const location = 'example.com';
36+
const tabId = '123';
37+
await onboardingController.registerOnboarding(location, tabId);
38+
const state: OnboardingControllerState =
39+
onboardingController.store.getState();
40+
expect(state.onboardingTabs?.[location]).toBe(tabId);
41+
});
42+
43+
it('should skip update state if the location is already onboard', async () => {
44+
const location = 'example.com';
45+
const tabId = '123';
46+
await onboardingController.registerOnboarding(location, tabId);
47+
const state: OnboardingControllerState =
48+
onboardingController.store.getState();
49+
const updateStateSpy = jest.spyOn(
50+
onboardingController.store,
51+
'updateState',
52+
);
53+
54+
expect(state.onboardingTabs?.[location]).toBe(tabId);
55+
expect(updateStateSpy).not.toHaveBeenCalled();
56+
});
57+
});

app/scripts/metamask-controller.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,7 @@ export default class MetamaskController extends EventEmitter {
978978
additionalKeyrings.push(
979979
mmiKeyringBuilderFactory(CUSTODIAN_TYPES[custodianType].keyringClass, {
980980
mmiConfigurationController: this.mmiConfigurationController,
981+
captureException,
981982
}),
982983
);
983984
}

jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ module.exports = {
4545
'<rootDir>/app/scripts/controllers/transactions/etherscan.test.ts',
4646
'<rootDir>/app/scripts/controllers/transactions/EtherscanRemoteTransactionSource.test.ts',
4747
'<rootDir>/app/scripts/controllers/transactions/IncomingTransactionHelper.test.ts',
48+
'<rootDir>/app/scripts/controllers/onboarding.test.ts',
4849
'<rootDir>/app/scripts/controllers/mmi-controller.test.ts',
4950
'<rootDir>/app/scripts/controllers/permissions/**/*.test.js',
5051
'<rootDir>/app/scripts/controllers/preferences.test.js',

lavamoat/browserify/mmi/policy.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,7 @@
718718
},
719719
"@metamask-institutional/custody-keyring": {
720720
"globals": {
721+
"console.error": true,
721722
"console.log": true,
722723
"console.warn": true
723724
},

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -256,14 +256,14 @@
256256
"@lavamoat/lavadome-react": "0.0.17",
257257
"@lavamoat/snow": "^2.0.1",
258258
"@material-ui/core": "^4.11.0",
259-
"@metamask-institutional/custody-controller": "^0.2.23",
260-
"@metamask-institutional/custody-keyring": "^1.0.11",
261-
"@metamask-institutional/extension": "^0.3.19",
262-
"@metamask-institutional/institutional-features": "^1.2.14",
259+
"@metamask-institutional/custody-controller": "^0.2.24",
260+
"@metamask-institutional/custody-keyring": "^1.0.12",
261+
"@metamask-institutional/extension": "^0.3.20",
262+
"@metamask-institutional/institutional-features": "^1.2.15",
263263
"@metamask-institutional/portfolio-dashboard": "^1.4.0",
264264
"@metamask-institutional/rpc-allowlist": "^1.0.2",
265265
"@metamask-institutional/sdk": "^0.1.25",
266-
"@metamask-institutional/transaction-update": "^0.1.37",
266+
"@metamask-institutional/transaction-update": "^0.1.38",
267267
"@metamask/abi-utils": "^2.0.2",
268268
"@metamask/accounts-controller": "^11.0.0",
269269
"@metamask/address-book-controller": "^3.1.7",

shared/constants/metametrics.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,7 @@ export enum MetaMetricsEventName {
610610
TokenImportButtonClicked = 'Import Token Button Clicked',
611611
TokenScreenOpened = 'Token Screen Opened',
612612
TokenAdded = 'Token Added',
613+
NFTRemoved = 'NFT Removed',
613614
TokenDetected = 'Token Detected',
614615
TokenHidden = 'Token Hidden',
615616
TokenImportCanceled = 'Token Import Canceled',

shared/constants/network.test.ts

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { join } from 'path';
33
import {
44
CHAIN_IDS,
55
CHAIN_ID_TO_NETWORK_IMAGE_URL_MAP,
6+
FEATURED_RPCS,
67
NETWORK_TO_NAME_MAP,
78
} from './network';
89

@@ -24,4 +25,70 @@ describe('NetworkConstants', () => {
2425
expect(NETWORK_TO_NAME_MAP[CHAIN_IDS.OPTIMISM]).toBe('OP Mainnet');
2526
expect(NETWORK_TO_NAME_MAP[CHAIN_IDS.POLYGON]).toBe('Polygon');
2627
});
28+
describe('popularNetwork', () => {
29+
it('should have correct chainIds for all popular network', () => {
30+
const expectedChainIds: { [key: string]: string } = {
31+
'Arbitrum One': CHAIN_IDS.ARBITRUM,
32+
'Avalanche Network C-Chain': CHAIN_IDS.AVALANCHE,
33+
'BNB Chain': CHAIN_IDS.BSC,
34+
'OP Mainnet': CHAIN_IDS.OPTIMISM,
35+
'Polygon Mainnet': CHAIN_IDS.POLYGON,
36+
'zkSync Era Mainnet': CHAIN_IDS.ZKSYNC_ERA,
37+
'Base Mainnet': CHAIN_IDS.BASE,
38+
};
39+
40+
FEATURED_RPCS.forEach((rpc) => {
41+
expect(rpc.chainId).toBe(expectedChainIds[rpc.nickname]);
42+
});
43+
});
44+
});
45+
46+
describe('FEATURED_RPCS Infura Usage Tests', () => {
47+
it('arbitrum entry should use Infura', () => {
48+
const arbitrumRpc = FEATURED_RPCS.find(
49+
(rpc) => rpc.chainId === CHAIN_IDS.ARBITRUM,
50+
);
51+
expect(arbitrumRpc?.rpcUrl).toContain('infura.io');
52+
});
53+
54+
it('avalanche entry should use Infura', () => {
55+
const avalancheRpc = FEATURED_RPCS.find(
56+
(rpc) => rpc.chainId === CHAIN_IDS.AVALANCHE,
57+
);
58+
expect(avalancheRpc?.rpcUrl).toContain('infura.io');
59+
});
60+
61+
it('bsc entry should not use Infura', () => {
62+
const bscRpc = FEATURED_RPCS.find((rpc) => rpc.chainId === CHAIN_IDS.BSC);
63+
expect(bscRpc?.rpcUrl).not.toContain('infura.io');
64+
});
65+
66+
it('optimism entry should use Infura', () => {
67+
const optimismRpc = FEATURED_RPCS.find(
68+
(rpc) => rpc.chainId === CHAIN_IDS.OPTIMISM,
69+
);
70+
expect(optimismRpc?.rpcUrl).toContain('infura.io');
71+
});
72+
73+
it('polygon entry should use Infura', () => {
74+
const polygonRpc = FEATURED_RPCS.find(
75+
(rpc) => rpc.chainId === CHAIN_IDS.POLYGON,
76+
);
77+
expect(polygonRpc?.rpcUrl).toContain('infura.io');
78+
});
79+
80+
it('zkSync Era entry should not use Infura', () => {
81+
const zksyncEraRpc = FEATURED_RPCS.find(
82+
(rpc) => rpc.chainId === CHAIN_IDS.ZKSYNC_ERA,
83+
);
84+
expect(zksyncEraRpc?.rpcUrl).not.toContain('infura.io');
85+
});
86+
87+
it('base entry should not use Infura', () => {
88+
const baseRpc = FEATURED_RPCS.find(
89+
(rpc) => rpc.chainId === CHAIN_IDS.BASE,
90+
);
91+
expect(baseRpc?.rpcUrl).not.toContain('infura.io');
92+
});
93+
});
2794
});

shared/constants/network.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,26 +1006,6 @@ export const FEATURED_RPCS: RPCDefinition[] = [
10061006
imageUrl: MATIC_TOKEN_IMAGE_URL,
10071007
},
10081008
},
1009-
{
1010-
chainId: CHAIN_IDS.CELO,
1011-
nickname: CELO_DISPLAY_NAME,
1012-
rpcUrl: `https://celo-mainnet.infura.io/v3/${infuraProjectId}`,
1013-
ticker: CURRENCY_SYMBOLS.CELO,
1014-
rpcPrefs: {
1015-
blockExplorerUrl: 'https://celoscan.io',
1016-
imageUrl: CELO_TOKEN_IMAGE_URL,
1017-
},
1018-
},
1019-
{
1020-
chainId: CHAIN_IDS.GNOSIS,
1021-
nickname: GNOSIS_DISPLAY_NAME,
1022-
rpcUrl: `https://rpc.gnosischain.com`,
1023-
ticker: CURRENCY_SYMBOLS.GNOSIS,
1024-
rpcPrefs: {
1025-
blockExplorerUrl: 'https://gnosisscan.io',
1026-
imageUrl: GNOSIS_TOKEN_IMAGE_URL,
1027-
},
1028-
},
10291009
{
10301010
chainId: CHAIN_IDS.ZKSYNC_ERA,
10311011
nickname: ZK_SYNC_ERA_DISPLAY_NAME,

0 commit comments

Comments
 (0)