Skip to content

Commit 0bf4077

Browse files
committed
build: fix
1 parent 56850a3 commit 0bf4077

5 files changed

Lines changed: 29 additions & 29 deletions

File tree

packages/account-tree-controller/src/AccountTreeController.test.ts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
AccountWalletType,
99
toAccountGroupId,
1010
toAccountWalletId,
11-
toMultichainAccountId,
11+
toMultichainAccountGroupId,
1212
toMultichainAccountWalletId,
1313
type AccountGroupId,
1414
} from '@metamask/account-api';
@@ -383,18 +383,18 @@ describe('AccountTreeController', () => {
383383
const expectedWalletId1 = toMultichainAccountWalletId(
384384
MOCK_HD_KEYRING_1.metadata.id,
385385
);
386-
const expectedWalletId1Group = toMultichainAccountId(
386+
const expectedWalletId1Group = toMultichainAccountGroupId(
387387
expectedWalletId1,
388388
MOCK_HD_ACCOUNT_1.options.entropy.groupIndex,
389389
);
390390
const expectedWalletId2 = toMultichainAccountWalletId(
391391
MOCK_HD_KEYRING_2.metadata.id,
392392
);
393-
const expectedWalletId2Group1 = toMultichainAccountId(
393+
const expectedWalletId2Group1 = toMultichainAccountGroupId(
394394
expectedWalletId2,
395395
MOCK_HD_ACCOUNT_2.options.entropy.groupIndex,
396396
);
397-
const expectedWalletId2Group2 = toMultichainAccountId(
397+
const expectedWalletId2Group2 = toMultichainAccountGroupId(
398398
expectedWalletId2,
399399
MOCK_SNAP_ACCOUNT_1.options.entropy.groupIndex,
400400
);
@@ -563,7 +563,7 @@ describe('AccountTreeController', () => {
563563
const expectedWalletId = toMultichainAccountWalletId(
564564
MOCK_HD_KEYRING_2.metadata.id,
565565
);
566-
const expectedGroupId = toMultichainAccountId(
566+
const expectedGroupId = toMultichainAccountGroupId(
567567
expectedWalletId,
568568
mockSnapAccountWithEntropy.options.entropy.groupIndex,
569569
);
@@ -675,7 +675,7 @@ describe('AccountTreeController', () => {
675675
const walletId1 = toMultichainAccountWalletId(
676676
MOCK_HD_KEYRING_1.metadata.id,
677677
);
678-
const walletId1Group = toMultichainAccountId(
678+
const walletId1Group = toMultichainAccountGroupId(
679679
walletId1,
680680
mockHdAccount1.options.entropy.groupIndex,
681681
);
@@ -752,7 +752,7 @@ describe('AccountTreeController', () => {
752752
const walletId1 = toMultichainAccountWalletId(
753753
MOCK_HD_KEYRING_1.metadata.id,
754754
);
755-
const walletId1Group = toMultichainAccountId(
755+
const walletId1Group = toMultichainAccountGroupId(
756756
walletId1,
757757
mockHdAccount1.options.entropy.groupIndex,
758758
);
@@ -829,14 +829,14 @@ describe('AccountTreeController', () => {
829829
const walletId1 = toMultichainAccountWalletId(
830830
MOCK_HD_KEYRING_1.metadata.id,
831831
);
832-
const walletId1Group = toMultichainAccountId(
832+
const walletId1Group = toMultichainAccountGroupId(
833833
walletId1,
834834
mockHdAccount1.options.entropy.groupIndex,
835835
);
836836
const walletId2 = toMultichainAccountWalletId(
837837
MOCK_HD_KEYRING_2.metadata.id,
838838
);
839-
const walletId2Group = toMultichainAccountId(
839+
const walletId2Group = toMultichainAccountGroupId(
840840
walletId2,
841841
mockHdAccount2.options.entropy.groupIndex,
842842
);
@@ -961,7 +961,7 @@ describe('AccountTreeController', () => {
961961
const groups = wallet.getAccountGroups();
962962
expect(groups).toHaveLength(1);
963963
expect(groups[0].id).toStrictEqual(
964-
toMultichainAccountId(
964+
toMultichainAccountGroupId(
965965
wallet.id as MultichainAccountWalletId,
966966
MOCK_HD_ACCOUNT_1.options.entropy.groupIndex,
967967
),
@@ -979,7 +979,7 @@ describe('AccountTreeController', () => {
979979
expect(wallets).toHaveLength(1);
980980

981981
const wallet = wallets[0];
982-
const groupId = toMultichainAccountId(
982+
const groupId = toMultichainAccountGroupId(
983983
wallet.id as MultichainAccountWalletId,
984984
MOCK_HD_ACCOUNT_1.options.entropy.groupIndex,
985985
);
@@ -1178,7 +1178,7 @@ describe('AccountTreeController', () => {
11781178
const expectedWalletId2 = toMultichainAccountWalletId(
11791179
MOCK_HD_KEYRING_2.metadata.id,
11801180
);
1181-
const expectedGroupId2 = toMultichainAccountId(
1181+
const expectedGroupId2 = toMultichainAccountGroupId(
11821182
expectedWalletId2,
11831183
MOCK_HD_ACCOUNT_2.options.entropy.groupIndex,
11841184
);
@@ -1218,7 +1218,7 @@ describe('AccountTreeController', () => {
12181218
const expectedWalletId2 = toMultichainAccountWalletId(
12191219
MOCK_HD_KEYRING_2.metadata.id,
12201220
);
1221-
const expectedGroupId2 = toMultichainAccountId(
1221+
const expectedGroupId2 = toMultichainAccountGroupId(
12221222
expectedWalletId2,
12231223
nonEvmAccount2.options.entropy.groupIndex,
12241224
);
@@ -1244,7 +1244,7 @@ describe('AccountTreeController', () => {
12441244
const expectedWalletId = toMultichainAccountWalletId(
12451245
MOCK_HD_KEYRING_1.metadata.id,
12461246
);
1247-
const expectedGroupId = toMultichainAccountId(
1247+
const expectedGroupId = toMultichainAccountGroupId(
12481248
expectedWalletId,
12491249
MOCK_HD_ACCOUNT_1.options.entropy.groupIndex,
12501250
);
@@ -1277,7 +1277,7 @@ describe('AccountTreeController', () => {
12771277
const expectedWalletId1 = toMultichainAccountWalletId(
12781278
MOCK_HD_KEYRING_1.metadata.id,
12791279
);
1280-
const expectedGroupId1 = toMultichainAccountId(
1280+
const expectedGroupId1 = toMultichainAccountGroupId(
12811281
expectedWalletId1,
12821282
MOCK_HD_ACCOUNT_1.options.entropy.groupIndex,
12831283
);
@@ -1353,7 +1353,7 @@ describe('AccountTreeController', () => {
13531353
const expectedWalletId1 = toMultichainAccountWalletId(
13541354
MOCK_HD_KEYRING_1.metadata.id,
13551355
);
1356-
const expectedGroupId1 = toMultichainAccountId(
1356+
const expectedGroupId1 = toMultichainAccountGroupId(
13571357
expectedWalletId1,
13581358
MOCK_HD_ACCOUNT_1.options.entropy.groupIndex,
13591359
);
@@ -1387,7 +1387,7 @@ describe('AccountTreeController', () => {
13871387
const expectedWalletId1 = toMultichainAccountWalletId(
13881388
MOCK_HD_KEYRING_1.metadata.id,
13891389
);
1390-
const expectedGroupId1 = toMultichainAccountId(
1390+
const expectedGroupId1 = toMultichainAccountGroupId(
13911391
expectedWalletId1,
13921392
MOCK_HD_ACCOUNT_1.options.entropy.groupIndex,
13931393
);
@@ -1430,7 +1430,7 @@ describe('AccountTreeController', () => {
14301430
const expectedWalletId1 = toMultichainAccountWalletId(
14311431
MOCK_HD_KEYRING_1.metadata.id,
14321432
);
1433-
const expectedGroupId1 = toMultichainAccountId(
1433+
const expectedGroupId1 = toMultichainAccountGroupId(
14341434
expectedWalletId1,
14351435
MOCK_HD_ACCOUNT_1.options.entropy.groupIndex,
14361436
);
@@ -1467,7 +1467,7 @@ describe('AccountTreeController', () => {
14671467
const expectedWalletId1 = toMultichainAccountWalletId(
14681468
MOCK_HD_KEYRING_1.metadata.id,
14691469
);
1470-
const expectedGroupId1 = toMultichainAccountId(
1470+
const expectedGroupId1 = toMultichainAccountGroupId(
14711471
expectedWalletId1,
14721472
MOCK_HD_ACCOUNT_1.options.entropy.groupIndex,
14731473
);
@@ -1476,7 +1476,7 @@ describe('AccountTreeController', () => {
14761476
const expectedWalletId2 = toMultichainAccountWalletId(
14771477
MOCK_HD_KEYRING_2.metadata.id,
14781478
);
1479-
const expectedGroupId2 = toMultichainAccountId(
1479+
const expectedGroupId2 = toMultichainAccountGroupId(
14801480
expectedWalletId2,
14811481
MOCK_HD_ACCOUNT_2.options.entropy.groupIndex,
14821482
);
@@ -1557,7 +1557,7 @@ describe('AccountTreeController', () => {
15571557
);
15581558

15591559
const group: AccountGroupObject = {
1560-
id: toMultichainAccountId(
1560+
id: toMultichainAccountGroupId(
15611561
toMultichainAccountWalletId('test'),
15621562
MOCK_HD_ACCOUNT_1.options.entropy.groupIndex,
15631563
),

packages/account-tree-controller/src/group.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type {
22
AccountGroupType,
3-
MultichainAccountId,
3+
MultichainAccountGroupId,
44
} from '@metamask/account-api';
55
import type { AccountGroup, AccountGroupId } from '@metamask/account-api';
66
import type { AccountId } from '@metamask/accounts-controller';
@@ -32,7 +32,7 @@ type IsAccountGroupObject<
3232
*/
3333
export type AccountGroupMultichainAccountObject = {
3434
type: AccountGroupType.MultichainAccount;
35-
id: MultichainAccountId;
35+
id: MultichainAccountGroupId;
3636
// Blockchain Accounts (at least 1 account per multichain-accounts):
3737
accounts: [AccountId, ...AccountId[]];
3838
metadata: {

packages/account-tree-controller/src/rules/entropy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {
22
AccountGroupType,
33
AccountWalletType,
44
isBip44Account,
5-
toMultichainAccountId,
5+
toMultichainAccountGroupId,
66
toMultichainAccountWalletId,
77
} from '@metamask/account-api';
88
import { isEvmAccountType } from '@metamask/keyring-api';
@@ -48,7 +48,7 @@ export class EntropyRule
4848
}
4949

5050
const walletId = toMultichainAccountWalletId(entropySource);
51-
const groupId = toMultichainAccountId(
51+
const groupId = toMultichainAccountGroupId(
5252
walletId,
5353
account.options.entropy.groupIndex,
5454
);

packages/account-tree-controller/src/wallet.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ export type AccountWalletEntropyObject = {
4242
type: AccountWalletType.Entropy;
4343
id: MultichainAccountWalletId;
4444
groups: {
45-
// NOTE: Using `MultichainAccountId` instead of `AccountGroupId` would introduce
45+
// NOTE: Using `MultichainAccountGroupId` instead of `AccountGroupId` would introduce
4646
// some type problems when using a group ID as an `AccountGroupId` directly. This
47-
// would require some up-cast to a `MultichainAccountId` which could be considered
47+
// would require some up-cast to a `MultichainAccountGroupId` which could be considered
4848
// unsafe... So we keep it as a `AccountGroupId` for now.
4949
[groupId: AccountGroupId]: AccountGroupMultichainAccountObject;
5050
};

packages/multichain-account-service/src/MultichainAccountWallet.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type {
66
import type { AccountGroupId } from '@metamask/account-api';
77
import type { AccountProvider } from '@metamask/account-api';
88
import {
9-
getGroupIndexFromMultichainAccountId,
9+
getGroupIndexFromMultichainAccountId as getGroupIndexFromMultichainAccountGroupId,
1010
isMultichainAccountGroupId,
1111
} from '@metamask/account-api';
1212
import { toDefaultAccountGroupId } from '@metamask/account-api';
@@ -139,7 +139,7 @@ export class MultichainAccountWallet<
139139
return undefined;
140140
}
141141

142-
const groupIndex = getGroupIndexFromMultichainAccountId(id);
142+
const groupIndex = getGroupIndexFromMultichainAccountGroupId(id);
143143
return this.#accounts.get(groupIndex);
144144
}
145145

0 commit comments

Comments
 (0)