Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): bump accounts-controller to ^14.0.0 #24130

Merged
merged 61 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from 58 commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
42acda2
chore(deps): bump accounts-controller to preview
montelaidev Apr 19, 2024
f02df07
chore: dedupe and update policy
montelaidev Apr 19, 2024
7cdd989
chore(deps): bump @metamask/keyring-api and @metamask/eth-snap-keyring
montelaidev Apr 19, 2024
91353aa
fix: use release version of accounts-controller and keyring-controller
montelaidev Apr 23, 2024
577501b
fix: update accounts test
montelaidev Apr 23, 2024
1fa8ffa
fix: add migration
montelaidev Apr 23, 2024
83c4843
fix: lint privacy-snapshot.json
montelaidev Apr 23, 2024
bf600c0
fix: accountCount value in addNewAccount
montelaidev Apr 23, 2024
cf14c3c
fix: update comment
montelaidev Apr 23, 2024
63910ac
bump(deps): user-operation-controller to ^8.0.0
montelaidev Apr 23, 2024
f0c4a7f
fix: lint
montelaidev Apr 23, 2024
4c65bfd
fix: repatch
montelaidev May 7, 2024
4e4eec4
fix: add new migration
montelaidev May 7, 2024
c425461
fix: add 118 migration to index
montelaidev May 7, 2024
1a85821
Update LavaMoat policies
metamaskbot May 7, 2024
0e33684
fix: test eip:155 to eip155 for scope
montelaidev May 7, 2024
dd4fa28
fix: approveOrRejectRequest json
montelaidev May 7, 2024
30c9d12
Merge remote-tracking branch 'origin/develop' into bump-accounts-cont…
montelaidev May 21, 2024
cc72ee2
feat: add migration 120
montelaidev May 21, 2024
cbda222
Merge branch 'develop' into bump-accounts-controller-to-14
montelaidev May 21, 2024
a46bca7
Update LavaMoat policies
metamaskbot May 21, 2024
6b5e187
Merge remote-tracking branch 'origin/develop' into bump-accounts-cont…
montelaidev May 22, 2024
97e541d
fix: migration number
montelaidev May 22, 2024
bb39c64
Merge branch 'develop' into bump-accounts-controller-to-14
legobeat May 23, 2024
8f540c7
Update LavaMoat policies
metamaskbot May 23, 2024
7480986
chore: dedupe deps
mikesposito May 23, 2024
b360c84
Update LavaMoat policies
metamaskbot May 24, 2024
8858dd5
Merge branch 'develop' into bump-accounts-controller-to-14
montelaidev May 24, 2024
ce61148
Merge branch 'develop' into bump-accounts-controller-to-14
legobeat May 27, 2024
88bbe7d
Update app/scripts/migrations/119.test.ts
montelaidev May 28, 2024
4ffc07d
Update app/scripts/migrations/119.test.ts
montelaidev May 28, 2024
19121b3
Update app/scripts/migrations/119.test.ts
montelaidev May 28, 2024
ed51227
test: another delay
montelaidev May 28, 2024
92caf42
chore: downgrade node-gyp to 9.3.0
montelaidev May 28, 2024
c0400ca
fix: revert downgrade and use v10 for all node-gpy
montelaidev May 28, 2024
193a0ee
fix: dedupe
montelaidev May 28, 2024
2e82d2c
Update LavaMoat policies
metamaskbot May 28, 2024
2e5de61
fix: remove 4337 methods from eoa account in test
montelaidev May 28, 2024
7d2ab75
Merge remote-tracking branch 'origin/develop' into bump-accounts-cont…
montelaidev May 29, 2024
b3be53a
fix: use mock time stamp
montelaidev May 29, 2024
94eaccd
test: add additional test to migration
montelaidev May 30, 2024
88a08a3
Merge remote-tracking branch 'origin/develop' into bump-accounts-cont…
montelaidev May 30, 2024
06b3d8b
chore: dedupe
montelaidev May 30, 2024
c3ad11f
Merge branch 'develop' into bump-accounts-controller-to-14
montelaidev May 30, 2024
9f28cb4
Merge branch 'develop' into bump-accounts-controller-to-14
montelaidev May 30, 2024
f1f4a93
fix: keyring-api enum error
montelaidev May 31, 2024
ae76e66
fix: remove entry from privacy-snapshot
montelaidev May 31, 2024
55f5a66
Update LavaMoat policies
metamaskbot May 31, 2024
0c7e31e
fix: EthMethod enum
montelaidev May 31, 2024
4db44ed
Merge branch 'develop' into bump-accounts-controller-to-14
legobeat May 31, 2024
69ab4f3
Merge branch 'develop' into bump-accounts-controller-to-14
montelaidev May 31, 2024
dbbabdc
fix: snaps test where second modal is not being pressed
montelaidev May 31, 2024
1f8a4c4
Merge remote-tracking branch 'origin/develop' into bump-accounts-cont…
montelaidev Jun 3, 2024
5bd1a07
Merge branch 'develop' into bump-accounts-controller-to-14
montelaidev Jun 3, 2024
6b001dd
fix: use version from migration
montelaidev Jun 3, 2024
4329209
chore: remove debug log
montelaidev Jun 3, 2024
e6cb11e
fix: use version from file and update test comparison
montelaidev Jun 3, 2024
517c2bc
fix: update to use const for EOA methods
montelaidev Jun 3, 2024
ad32b7c
fix: use ETH_EOA_METHODS
montelaidev Jun 3, 2024
d1e3544
Merge branch 'develop' into bump-accounts-controller-to-14
montelaidev Jun 3, 2024
98434c9
Merge branch 'develop' into bump-accounts-controller-to-14
legobeat Jun 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
12 changes: 3 additions & 9 deletions app/scripts/lib/backup.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/**
* @jest-environment node
*/
import { EthAccountType, EthMethod } from '@metamask/keyring-api';
import { EthAccountType } from '@metamask/keyring-api';
import { ETH_EOA_METHODS } from '../../../shared/constants/eth-methods';
import Backup from './backup';

function getMockPreferencesController() {
Expand Down Expand Up @@ -185,14 +186,7 @@ const jsonData = JSON.stringify({
lastSelected: 1693289751176,
},
options: {},
methods: [
EthMethod.PersonalSign,
EthMethod.Sign,
EthMethod.SignTransaction,
EthMethod.SignTypedDataV1,
EthMethod.SignTypedDataV3,
EthMethod.SignTypedDataV4,
],
methods: ETH_EOA_METHODS,
type: EthAccountType.Eoa,
},
},
Expand Down
5 changes: 3 additions & 2 deletions app/scripts/metamask-controller.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
METAMASK_STALELIST_FILE,
METAMASK_HOTLIST_DIFF_FILE,
} from '@metamask/phishing-controller';
import { EthMethod, EthAccountType } from '@metamask/keyring-api';
import { EthAccountType } from '@metamask/keyring-api';
import { NetworkType } from '@metamask/controller-utils';
import { ControllerMessenger } from '@metamask/base-controller';
import { LoggingController, LogType } from '@metamask/logging-controller';
Expand All @@ -28,6 +28,7 @@ import { LOG_EVENT } from '../../shared/constants/logs';
import mockEncryptor from '../../test/lib/mock-encryptor';
import * as tokenUtils from '../../shared/lib/token-util';
import { flushPromises } from '../../test/lib/timer-helpers';
import { ETH_EOA_METHODS } from '../../shared/constants/eth-methods';
import { deferredPromise } from './lib/util';
import MetaMaskController from './metamask-controller';

Expand Down Expand Up @@ -141,7 +142,7 @@ const TEST_INTERNAL_ACCOUNT = {
lastSelected: 0,
},
options: {},
methods: [...Object.values(EthMethod)],
methods: ETH_EOA_METHODS,
type: EthAccountType.Eoa,
};

Expand Down
12 changes: 3 additions & 9 deletions app/scripts/migrations/105.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { v4 as uuid } from 'uuid';
import { sha256FromString } from 'ethereumjs-util';
import { EthMethod, InternalAccount } from '@metamask/keyring-api';
import { InternalAccount } from '@metamask/keyring-api';
import { ETH_EOA_METHODS } from '../../../shared/constants/eth-methods';
import { migrate } from './105';

const MOCK_ADDRESS = '0x0';
Expand Down Expand Up @@ -73,14 +74,7 @@ function expectedInternalAccount(
lastSelected: lastSelected ? expect.any(Number) : undefined,
},
options: {},
methods: [
EthMethod.Sign,
EthMethod.PersonalSign,
EthMethod.SignTransaction,
EthMethod.SignTypedDataV1,
EthMethod.SignTypedDataV3,
EthMethod.SignTypedDataV4,
],
methods: ETH_EOA_METHODS,
type: 'eip155:eoa',
};
}
Expand Down
16 changes: 3 additions & 13 deletions app/scripts/migrations/105.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import {
EthAccountType,
InternalAccount,
EthMethod,
} from '@metamask/keyring-api';
import { EthAccountType, InternalAccount } from '@metamask/keyring-api';
import { sha256FromString } from 'ethereumjs-util';
import { v4 as uuid } from 'uuid';
import { cloneDeep } from 'lodash';
import { ETH_EOA_METHODS } from '../../../shared/constants/eth-methods';

type VersionedData = {
meta: { version: number };
Expand Down Expand Up @@ -107,14 +104,7 @@ function createInternalAccountsForAccountsController(
type: 'HD Key Tree',
},
},
methods: [
EthMethod.Sign,
EthMethod.PersonalSign,
EthMethod.SignTransaction,
EthMethod.SignTypedDataV1,
EthMethod.SignTypedDataV3,
EthMethod.SignTypedDataV4,
],
methods: ETH_EOA_METHODS,
type: EthAccountType.Eoa,
};
});
Expand Down
Loading