Skip to content

Commit

Permalink
Merge branch 'develop' into jl/reset-streams-on-bfcache-pageshow
Browse files Browse the repository at this point in the history
  • Loading branch information
jiexi authored Jun 3, 2024
2 parents 851c995 + 895d1f1 commit dec9f77
Show file tree
Hide file tree
Showing 86 changed files with 1,242 additions and 734 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1189,7 +1189,7 @@ jobs:
command: |
if .circleci/scripts/test-run-e2e.sh
then
timeout 20m yarn test:e2e:chrome --retries 1
timeout 20m yarn test:e2e:chrome:confirmation-redesign --retries 1
fi
no_output_timeout: 5m
environment:
Expand Down
15 changes: 15 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,18 @@ ui/selectors/institutional @MetaMask/mmi
# Design System to own code for the component-library folder
# Slack handle: @metamask-design-system-team | Slack channel: #metamask-design-system
ui/components/component-library @MetaMask/design-system-engineers

# The Notifications team is responsible for code related to notifications,
# authentication, and profile syncing inside the Extension.

# Controllers
**/controllers/authentication/** @MetaMask/notifications
**/controllers/metamask-notifications/** @MetaMask/notifications
**/controllers/push-platform-notifications/** @MetaMask/notifications
**/controllers/user-storage/** @MetaMask/notifications

# UI
**/metamask-notifications/** @MetaMask/notifications
**/multichain/notification*/** @MetaMask/notifications
**/pages/notification*/** @MetaMask/notifications
**/utils/notification.util.ts @MetaMask/notifications
6 changes: 6 additions & 0 deletions .github/workflows/add-release-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ jobs:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'

- run: corepack enable
- name: Checkout repository
uses: actions/checkout@v4
with:
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/check-pr-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@ jobs:
pull-requests: read

steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- run: corepack enable

- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1 # This retrieves only the latest commit.

- run: corepack enable

- name: Set up Node.js
uses: actions/setup-node@v4
with:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/check-template-and-add-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ jobs:
check-template-and-add-labels:
runs-on: ubuntu-latest
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- run: corepack enable

- name: Checkout repository
uses: actions/checkout@v4
with:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/close-bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ jobs:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'Version-v')
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- run: corepack enable

- name: Checkout repository
uses: actions/checkout@v4
with:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/codespaces.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ jobs:
name: Generate cache image
runs-on: ubuntu-latest
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- run: corepack enable

- name: Checkout repository
uses: actions/checkout@v4
with:
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/fitness-functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- run: corepack enable

- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- run: corepack enable

- name: Use Node.js
uses: actions/setup-node@v4
with:
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/update-lavamoat-policies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ jobs:
outputs:
COMMIT_SHA: ${{ steps.commit-sha.outputs.COMMIT_SHA }}
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- run: corepack enable
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout pull request
Expand All @@ -75,6 +80,11 @@ jobs:
needs:
- prepare
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- run: corepack enable
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout pull request
Expand Down Expand Up @@ -109,6 +119,11 @@ jobs:
- prepare
- update-lavamoat-build-policy
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- run: corepack enable
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout pull request
Expand Down
29 changes: 16 additions & 13 deletions .storybook/test-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ import { draftTransactionInitialState } from '../ui/ducks/send';
import { KeyringType } from '../shared/constants/keyring';
import { NetworkType } from '@metamask/controller-utils';
import { NetworkStatus } from '@metamask/network-controller';
import { EthAccountType, EthMethod } from '@metamask/keyring-api';
import { EthAccountType } from '@metamask/keyring-api';
import { CHAIN_IDS } from '../shared/constants/network';
import { copyable, divider, heading, panel, text } from '@metamask/snaps-sdk';
import { getJsxElementFromComponent } from '@metamask/snaps-utils';
import { FirstTimeFlowType } from '../shared/constants/onboarding';
import { ETH_EOA_METHODS } from '../shared/constants/eth-methods';

const state = {
invalidCustomNetwork: {
Expand Down Expand Up @@ -282,13 +283,15 @@ const state = {
},
interfaces: {
'test-interface': {
content: getJsxElementFromComponent(panel([
heading('Foo bar'),
text('Description'),
divider(),
text('More text'),
copyable('Text you can copy'),
])),
content: getJsxElementFromComponent(
panel([
heading('Foo bar'),
text('Description'),
divider(),
text('More text'),
copyable('Text you can copy'),
]),
),
state: {},
snapId: 'local:http://localhost:8080/',
},
Expand Down Expand Up @@ -324,7 +327,7 @@ const state = {
},
},
options: {},
methods: [...Object.values(EthMethod)],
methods: ETH_EOA_METHODS,
type: EthAccountType.Eoa,
},
'07c2cfec-36c9-46c4-8115-3836d3ac9047': {
Expand All @@ -337,7 +340,7 @@ const state = {
},
},
options: {},
methods: [...Object.values(EthMethod)],
methods: ETH_EOA_METHODS,
type: EthAccountType.Eoa,
},
'15e69915-2a1a-4019-93b3-916e11fd432f': {
Expand All @@ -350,7 +353,7 @@ const state = {
},
},
options: {},
methods: [...Object.values(EthMethod)],
methods: ETH_EOA_METHODS,
type: EthAccountType.Eoa,
},
'784225f4-d30b-4e77-a900-c8bbce735b88': {
Expand All @@ -363,7 +366,7 @@ const state = {
},
},
options: {},
methods: [...Object.values(EthMethod)],
methods: ETH_EOA_METHODS,
type: EthAccountType.Eoa,
},
'b990b846-b384-4508-93d9-587461f1123e': {
Expand All @@ -376,7 +379,7 @@ const state = {
},
},
options: {},
methods: [...Object.values(EthMethod)],
methods: ETH_EOA_METHODS,
type: EthAccountType.Eoa,
},
},
Expand Down
15 changes: 10 additions & 5 deletions app/scripts/controllers/mmi-controller.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { SignatureController } from '@metamask/signature-controller';

import { NetworkController } from '@metamask/network-controller';
import { AccountsController } from '@metamask/accounts-controller';
import { EthAccountType, EthMethod } from '@metamask/keyring-api';
import { EthAccountType } from '@metamask/keyring-api';

import { CustodyController } from '@metamask-institutional/custody-controller';
import {
Expand All @@ -30,6 +30,7 @@ jest.mock('@metamask-institutional/portfolio-dashboard', () => ({
}));

import * as PortfolioDashboard from '@metamask-institutional/portfolio-dashboard';
import { ETH_EOA_METHODS } from '../../../shared/constants/eth-methods';

jest.mock('./permissions', () => ({
getPermissionBackgroundApiMethods: jest.fn().mockImplementation(() => {
Expand All @@ -49,7 +50,7 @@ const mockAccount = {
},
},
options: {},
methods: [...Object.values(EthMethod)],
methods: ETH_EOA_METHODS,
type: EthAccountType.Eoa,
};
const mockAccount2 = {
Expand All @@ -62,7 +63,7 @@ const mockAccount2 = {
},
},
options: {},
methods: [...Object.values(EthMethod)],
methods: ETH_EOA_METHODS,
type: EthAccountType.Eoa,
};

Expand Down Expand Up @@ -349,7 +350,7 @@ describe('MMIController', function () {
});

describe('getAllCustodianAccountsWithToken', () => {
it('should return custodian accounts with tokens', async () => { });
it('should return custodian accounts with tokens', async () => {});
});

describe('handleMmiDashboardData', () => {
Expand Down Expand Up @@ -438,7 +439,11 @@ describe('MMIController', function () {
getCustodianAccounts: mockCustodialKeyring,
});

await mmiController.getCustodianAccounts('token', 'neptune-custody', 'ECA3');
await mmiController.getCustodianAccounts(
'token',
'neptune-custody',
'ECA3',
);

expect(selectedAccountSpy).toHaveBeenCalledTimes(0);

Expand Down
23 changes: 12 additions & 11 deletions app/scripts/controllers/permissions/specifications.test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { EthMethod, EthAccountType } from '@metamask/keyring-api';
import { EthAccountType } from '@metamask/keyring-api';
import { SnapCaveatType } from '@metamask/snaps-rpc-methods';
import {
CaveatTypes,
RestrictedMethods,
} from '../../../../shared/constants/permissions';
import { ETH_EOA_METHODS } from '../../../../shared/constants/eth-methods';
import {
getCaveatSpecifications,
getPermissionSpecifications,
Expand Down Expand Up @@ -149,7 +150,7 @@ describe('PermissionController specifications', () => {
},
},
options: {},
methods: [...Object.values(EthMethod)],
methods: ETH_EOA_METHODS,
type: EthAccountType.Eoa,
},
{
Expand All @@ -163,7 +164,7 @@ describe('PermissionController specifications', () => {
},
},
options: {},
methods: [...Object.values(EthMethod)],
methods: ETH_EOA_METHODS,
type: EthAccountType.Eoa,
},
];
Expand Down Expand Up @@ -290,7 +291,7 @@ describe('PermissionController specifications', () => {
},
},
options: {},
methods: [...Object.values(EthMethod)],
methods: ETH_EOA_METHODS,
type: EthAccountType.Eoa,
},
{
Expand All @@ -303,7 +304,7 @@ describe('PermissionController specifications', () => {
},
},
options: {},
methods: [...Object.values(EthMethod)],
methods: ETH_EOA_METHODS,
type: EthAccountType.Eoa,
},
{
Expand All @@ -317,7 +318,7 @@ describe('PermissionController specifications', () => {
lastSelected: 3,
},
options: {},
methods: [...Object.values(EthMethod)],
methods: ETH_EOA_METHODS,
type: EthAccountType.Eoa,
},
{
Expand All @@ -331,7 +332,7 @@ describe('PermissionController specifications', () => {
},
},
options: {},
methods: [...Object.values(EthMethod)],
methods: ETH_EOA_METHODS,
type: EthAccountType.Eoa,
},
];
Expand Down Expand Up @@ -367,7 +368,7 @@ describe('PermissionController specifications', () => {
},
},
options: {},
methods: [...Object.values(EthMethod)],
methods: ETH_EOA_METHODS,
type: EthAccountType.Eoa,
},
{
Expand All @@ -381,7 +382,7 @@ describe('PermissionController specifications', () => {
},
},
options: {},
methods: [...Object.values(EthMethod)],
methods: ETH_EOA_METHODS,
type: EthAccountType.Eoa,
},
];
Expand Down Expand Up @@ -415,7 +416,7 @@ describe('PermissionController specifications', () => {
},
},
options: {},
methods: [...Object.values(EthMethod)],
methods: ETH_EOA_METHODS,
type: EthAccountType.Eoa,
},
{
Expand All @@ -429,7 +430,7 @@ describe('PermissionController specifications', () => {
},
},
options: {},
methods: [...Object.values(EthMethod)],
methods: ETH_EOA_METHODS,
type: EthAccountType.Eoa,
},
];
Expand Down
Loading

0 comments on commit dec9f77

Please sign in to comment.