Skip to content

Commit 056a03e

Browse files
committed
fix(account-api)!: rename getGroupIndexFromMultichainAccountId -> getGroupIndexFromMultichainAccountGroupId
1 parent 6adc50f commit 056a03e

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

packages/account-api/src/api/multichain/group.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export function isMultichainAccountGroupId(
9595
* @param id - Multichain account ID.
9696
* @returns The multichain account index if extractable, undefined otherwise.
9797
*/
98-
export function getGroupIndexFromMultichainAccountId(
98+
export function getGroupIndexFromMultichainAccountGroupId(
9999
id: MultichainAccountGroupId,
100100
): number {
101101
const matched = id.match(MULTICHAIN_ACCOUNT_GROUP_ID_REGEX);

packages/account-api/src/index.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
toAccountGroupId,
1616
toAccountWalletId,
1717
toDefaultAccountGroupId,
18-
getGroupIndexFromMultichainAccountId,
18+
getGroupIndexFromMultichainAccountGroupId,
1919
isBip44Account,
2020
toMultichainAccountWalletId,
2121
toMultichainAccountGroupId,
@@ -163,15 +163,17 @@ describe('index', () => {
163163
const walletId = toMultichainAccountWalletId('test');
164164
const groupId = toMultichainAccountGroupId(walletId, groupIndex);
165165

166-
expect(getGroupIndexFromMultichainAccountId(groupId)).toBe(groupIndex);
166+
expect(getGroupIndexFromMultichainAccountGroupId(groupId)).toBe(
167+
groupIndex,
168+
);
167169
});
168170

169171
it('throws if it cannot extract group index', () => {
170172
const walletId = toAccountWalletId(AccountWalletType.Keyring, 'test');
171173
const groupId = toAccountGroupId(walletId, 'test');
172174

173175
expect(() =>
174-
getGroupIndexFromMultichainAccountId(
176+
getGroupIndexFromMultichainAccountGroupId(
175177
// Force the error case even though, type wise, this should not
176178
// be possible!
177179
groupId as unknown as MultichainAccountGroupId,

0 commit comments

Comments
 (0)