Skip to content

Commit 80c5a63

Browse files
authored
chore: update Accounts CO (#27089)
<!-- 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? --> Update Accounts CO ## **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: null ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/MUL-1260 ## **Manual testing steps** Not applicable ## **Screenshots/Recordings** Not applicable ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/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-mobile/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] > **Low Risk** > Low risk because changes are limited to CODEOWNERS updates and import-path adjustments after reorganizing controller init modules, with no functional logic changes. > > **Overview** > Updates `.github/CODEOWNERS` to assign the Accounts team ownership of additional Engine controller directories (e.g., `multichain-account-service`, `snap-keyring`, `keyring-controller`, `storage-service`) and expands multichain account path patterns. > > Adjusts `Engine.ts` and related controller init tests to import `snap-keyring`, `keyring-controller`, and `storage-service` init modules from their new subdirectories. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit e3e1512. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 197bff3 commit 80c5a63

8 files changed

Lines changed: 39 additions & 31 deletions

File tree

.github/CODEOWNERS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ app/util/walletconnect.js @MetaMask/wallet-int
103103
# Accounts Team
104104
app/core/Encryptor/ @MetaMask/accounts-engineers
105105
app/core/Engine/controllers/accounts-controller @MetaMask/accounts-engineers
106+
app/core/Engine/controllers/multichain-account-service @MetaMask/accounts-engineers
107+
app/core/Engine/controllers/snap-keyring @MetaMask/accounts-engineers
108+
app/core/Engine/controllers/keyring-controller @MetaMask/accounts-engineers
109+
app/core/Engine/controllers/storage-service @MetaMask/accounts-engineers
106110
app/core/Engine/messengers/accounts-controller-messenger @MetaMask/accounts-engineers
107111
app/core/SnapKeyring @MetaMask/accounts-engineers
108112
**/Identity/** @MetaMask/accounts-engineers

app/core/Engine/Engine.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ import { multichainAssetsControllerInit } from './controllers/multichain-assets-
9090
import { multichainAssetsRatesControllerInit } from './controllers/multichain-assets-rates-controller/multichain-assets-rates-controller-init';
9191
import { multichainTransactionsControllerInit } from './controllers/multichain-transactions-controller/multichain-transactions-controller-init';
9292
import { multichainAccountServiceInit } from './controllers/multichain-account-service/multichain-account-service-init';
93-
import { snapKeyringBuilderInit } from './controllers/snap-keyring-builder-init';
93+
import { snapKeyringBuilderInit } from './controllers/snap-keyring/snap-keyring-builder-init';
9494
import { SnapKeyring } from '@metamask/eth-snap-keyring';
9595
///: END:ONLY_INCLUDE_IF
9696
///: BEGIN:ONLY_INCLUDE_IF(preinstalled-snaps,external-snaps)
@@ -144,7 +144,7 @@ import { subjectMetadataControllerInit } from './controllers/subject-metadata-co
144144
///: END:ONLY_INCLUDE_IF
145145
import { PreferencesController } from '@metamask/preferences-controller';
146146
import { preferencesControllerInit } from './controllers/preferences-controller-init';
147-
import { keyringControllerInit } from './controllers/keyring-controller-init';
147+
import { keyringControllerInit } from './controllers/keyring-controller/keyring-controller-init';
148148
import { networkControllerInit } from './controllers/network-controller-init';
149149
import { TransactionPayControllerInit } from './controllers/transaction-pay-controller';
150150
import { tokenSearchDiscoveryDataControllerInit } from './controllers/token-search-discovery-data-controller-init';
@@ -165,7 +165,7 @@ import { rewardsDataServiceInit } from './controllers/rewards-data-service-init'
165165
import { swapsControllerInit } from './controllers/swaps-controller-init';
166166
import { remoteFeatureFlagControllerInit } from './controllers/remote-feature-flag-controller-init';
167167
import { errorReportingServiceInit } from './controllers/error-reporting-service-init';
168-
import { storageServiceInit } from './controllers/storage-service-init';
168+
import { storageServiceInit } from './controllers/storage-service/storage-service-init';
169169
import { loggingControllerInit } from './controllers/logging-controller-init';
170170
import { phishingControllerInit } from './controllers/phishing-controller-init';
171171
import { addressBookControllerInit } from './controllers/address-book-controller-init';

app/core/Engine/controllers/keyring-controller-init.test.ts renamed to app/core/Engine/controllers/keyring-controller/keyring-controller-init.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import { buildControllerInitRequestMock } from '../utils/test-utils';
2-
import { ExtendedMessenger } from '../../ExtendedMessenger';
3-
import { getKeyringControllerMessenger } from '../messengers/keyring-controller-messenger';
4-
import { ControllerInitRequest } from '../types';
1+
import { buildControllerInitRequestMock } from '../../utils/test-utils';
2+
import { ExtendedMessenger } from '../../../ExtendedMessenger';
3+
import { getKeyringControllerMessenger } from '../../messengers/keyring-controller-messenger';
4+
import { ControllerInitRequest } from '../../types';
55
import { keyringControllerInit } from './keyring-controller-init';
66
import {
77
KeyringController,
88
KeyringControllerMessenger,
99
} from '@metamask/keyring-controller';
10-
import { Encryptor } from '../../Encryptor';
10+
import { Encryptor } from '../../../Encryptor';
1111
import { MOCK_ANY_NAMESPACE, MockAnyNamespace } from '@metamask/messenger';
1212

1313
jest.mock('@metamask/keyring-controller');

app/core/Engine/controllers/keyring-controller-init.ts renamed to app/core/Engine/controllers/keyring-controller/keyring-controller-init.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ControllerInitFunction } from '../types';
1+
import { ControllerInitFunction } from '../../types';
22
import {
33
KeyringController,
44
KeyringControllerMessenger,
@@ -11,7 +11,11 @@ import {
1111
} from '@metamask/eth-ledger-bridge-keyring';
1212
import { HdKeyring } from '@metamask/eth-hd-keyring';
1313
import { hmacSha512 } from '@metamask/native-utils';
14-
import { Encryptor, LEGACY_DERIVATION_OPTIONS, pbkdf2 } from '../../Encryptor';
14+
import {
15+
Encryptor,
16+
LEGACY_DERIVATION_OPTIONS,
17+
pbkdf2,
18+
} from '../../../Encryptor';
1519

1620
const encryptor = new Encryptor({
1721
keyDerivationOptions: LEGACY_DERIVATION_OPTIONS,

app/core/Engine/controllers/snap-keyring-builder-init.test.ts renamed to app/core/Engine/controllers/snap-keyring/snap-keyring-builder-init.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import { buildControllerInitRequestMock } from '../utils/test-utils';
2-
import { ExtendedMessenger } from '../../ExtendedMessenger';
1+
import { buildControllerInitRequestMock } from '../../utils/test-utils';
2+
import { ExtendedMessenger } from '../../../ExtendedMessenger';
33
import {
44
getSnapKeyringBuilderInitMessenger,
55
getSnapKeyringBuilderMessenger,
66
SnapKeyringBuilderInitMessenger,
7-
} from '../messengers/snap-keyring-builder-messenger';
8-
import { ControllerInitRequest } from '../types';
7+
} from '../../messengers/snap-keyring-builder-messenger';
8+
import { ControllerInitRequest } from '../../types';
99
import { snapKeyringBuilderInit } from './snap-keyring-builder-init';
1010
import { MOCK_ANY_NAMESPACE, MockAnyNamespace } from '@metamask/messenger';
11-
import { SnapKeyringBuilderMessenger } from '../../SnapKeyring/types';
11+
import { SnapKeyringBuilderMessenger } from '../../../SnapKeyring/types';
1212

1313
function getInitRequestMock(): jest.Mocked<
1414
ControllerInitRequest<

app/core/Engine/controllers/snap-keyring-builder-init.ts renamed to app/core/Engine/controllers/snap-keyring/snap-keyring-builder-init.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { ControllerInitFunction } from '../types';
2-
import { SnapKeyringBuilderInitMessenger } from '../messengers/snap-keyring-builder-messenger';
1+
import { ControllerInitFunction } from '../../types';
2+
import { SnapKeyringBuilderInitMessenger } from '../../messengers/snap-keyring-builder-messenger';
33
import {
44
snapKeyringBuilder,
55
SnapKeyringBuilder,
6-
} from '../../SnapKeyring/SnapKeyring';
7-
import { SnapKeyringBuilderMessenger } from '../../SnapKeyring/types';
6+
} from '../../../SnapKeyring/SnapKeyring';
7+
import { SnapKeyringBuilderMessenger } from '../../../SnapKeyring/types';
88

99
/**
1010
* Initialize the Snap keyring builder.

app/core/Engine/controllers/storage-service-init.test.ts renamed to app/core/Engine/controllers/storage-service/storage-service-init.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { buildControllerInitRequestMock } from '../utils/test-utils';
2-
import { ExtendedMessenger } from '../../ExtendedMessenger';
3-
import { getStorageServiceMessenger } from '../messengers/storage-service-messenger';
4-
import { ControllerInitRequest } from '../types';
1+
import { buildControllerInitRequestMock } from '../../utils/test-utils';
2+
import { ExtendedMessenger } from '../../../ExtendedMessenger';
3+
import { getStorageServiceMessenger } from '../../messengers/storage-service-messenger';
4+
import { ControllerInitRequest } from '../../types';
55
import { storageServiceInit } from './storage-service-init';
66
import {
77
StorageService,
@@ -10,13 +10,13 @@ import {
1010
} from '@metamask/storage-service';
1111
import { MOCK_ANY_NAMESPACE, MockAnyNamespace } from '@metamask/messenger';
1212
import FilesystemStorage from 'redux-persist-filesystem-storage';
13-
import Device from '../../../util/device';
14-
import Logger from '../../../util/Logger';
13+
import Device from '../../../../util/device';
14+
import Logger from '../../../../util/Logger';
1515

1616
jest.mock('@metamask/storage-service');
1717
jest.mock('redux-persist-filesystem-storage');
18-
jest.mock('../../../util/device');
19-
jest.mock('../../../util/Logger');
18+
jest.mock('../../../../util/device');
19+
jest.mock('../../../../util/Logger');
2020

2121
const mockFilesystemStorage = jest.mocked(FilesystemStorage);
2222
const mockDevice = jest.mocked(Device);

app/core/Engine/controllers/storage-service-init.ts renamed to app/core/Engine/controllers/storage-service/storage-service-init.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
import type { Json } from '@metamask/utils';
22
import FilesystemStorage from 'redux-persist-filesystem-storage';
33

4-
import { ControllerInitFunction } from '../types';
4+
import { ControllerInitFunction } from '../../types';
55
import {
66
StorageService,
77
StorageServiceMessenger,
88
StorageAdapter,
99
StorageGetResult,
1010
STORAGE_KEY_PREFIX,
1111
} from '@metamask/storage-service';
12-
import Device from '../../../util/device';
13-
import Logger from '../../../util/Logger';
12+
import Device from '../../../../util/device';
13+
import Logger from '../../../../util/Logger';
1414
import {
1515
encodeStorageKey,
1616
decodeStorageKey,
17-
} from '../utils/storage-service-utils';
17+
} from '../../utils/storage-service-utils';
1818

1919
/**
2020
* Mobile-specific storage adapter using FilesystemStorage.

0 commit comments

Comments
 (0)