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

Commit fade19e

Browse files
authored
fix: await account removal (#280)
1 parent 4b672f8 commit fade19e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/KeyringController.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,11 @@ class KeyringController extends EventEmitter {
301301
if (!keyring.removeAccount) {
302302
throw new Error(KeyringControllerError.UnsupportedRemoveAccount);
303303
}
304-
keyring.removeAccount(address);
304+
305+
// The `removeAccount` method of snaps keyring is async. We have to update
306+
// the interface of the other keyrings to be async as well.
307+
// eslint-disable-next-line @typescript-eslint/await-thenable
308+
await keyring.removeAccount(address);
305309
this.emit('removedAccount', address);
306310

307311
const accounts = await keyring.getAccounts();

0 commit comments

Comments
 (0)