Skip to content

Commit 4c2e582

Browse files
committed
chore: remove accountId to context mapping since with the removal of accountAdded and accountRemoved handling, it is dead code
1 parent 01096bf commit 4c2e582

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

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

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,6 @@ export class MultichainAccountService {
8383
MultichainAccountWallet<Bip44Account<KeyringAccount>>
8484
>;
8585

86-
readonly #accountIdToContext: Map<
87-
Bip44Account<KeyringAccount>['id'],
88-
AccountContext<Bip44Account<KeyringAccount>>
89-
>;
90-
9186
/**
9287
* The name of the service.
9388
*/
@@ -110,7 +105,6 @@ export class MultichainAccountService {
110105
}: MultichainAccountServiceOptions) {
111106
this.#messenger = messenger;
112107
this.#wallets = new Map();
113-
this.#accountIdToContext = new Map();
114108

115109
// TODO: Rely on keyring capabilities once the keyring API is used by all keyrings.
116110
this.#providers = [
@@ -232,7 +226,6 @@ export class MultichainAccountService {
232226
*/
233227
init(): void {
234228
this.#wallets.clear();
235-
this.#accountIdToContext.clear();
236229

237230
const serviceState = this.#constructServiceState();
238231
for (const entropySource of Object.keys(serviceState)) {
@@ -243,15 +236,6 @@ export class MultichainAccountService {
243236
});
244237
wallet.init(serviceState[entropySource]);
245238
this.#wallets.set(wallet.id, wallet);
246-
247-
for (const group of wallet.getMultichainAccountGroups()) {
248-
for (const accountId of group.getAccountIds()) {
249-
this.#accountIdToContext.set(accountId, {
250-
wallet,
251-
group,
252-
});
253-
}
254-
}
255239
}
256240
}
257241

@@ -276,19 +260,6 @@ export class MultichainAccountService {
276260
return wallet;
277261
}
278262

279-
/**
280-
* Gets the account's context which contains its multichain wallet and
281-
* multichain account group references.
282-
*
283-
* @param id - Account ID.
284-
* @returns The account context if any, undefined otherwise.
285-
*/
286-
getAccountContext(
287-
id: KeyringAccount['id'],
288-
): AccountContext<Bip44Account<KeyringAccount>> | undefined {
289-
return this.#accountIdToContext.get(id);
290-
}
291-
292263
/**
293264
* Gets a reference to the multichain account wallet matching this entropy source.
294265
*

0 commit comments

Comments
 (0)