Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Commit

Permalink
fix: remove removeAccountsBySnapId
Browse files Browse the repository at this point in the history
Accounts shouldn't be removed by directly calling the keyring because
they also need to be removed from other controllers, which is done by
the `removeAccount` method from `metamask-controller.js`.
  • Loading branch information
danroc committed Sep 27, 2023
1 parent 15c42ef commit 7793ca0
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions src/SnapKeyring.ts
Original file line number Diff line number Diff line change
Expand Up @@ -624,20 +624,6 @@ export class SnapKeyring extends EventEmitter {
: undefined;
}

/**
* Remove all accounts associated with a given Snap ID.
*
* @param snapId - The Snap ID to remove accounts for.
* @returns A Promise that resolves when all accounts have been removed.
*/
async removeAccountsBySnapId(snapId: string): Promise<void> {
for (const entry of this.#accounts.values()) {
if (entry.snapId === snapId) {
await this.removeAccount(entry.account.address.toLowerCase());
}
}
}

/**
* List all snap keyring accounts.
*
Expand Down

0 comments on commit 7793ca0

Please sign in to comment.