From 4fe18f06b682bbc081fd747f645d5c366c64285d Mon Sep 17 00:00:00 2001 From: Daniel Rocha <68558152+danroc@users.noreply.github.com> Date: Tue, 3 Oct 2023 09:06:55 +0200 Subject: [PATCH] fix: await account removal --- src/KeyringController.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/KeyringController.ts b/src/KeyringController.ts index c191edf1..f3476c39 100644 --- a/src/KeyringController.ts +++ b/src/KeyringController.ts @@ -301,7 +301,11 @@ class KeyringController extends EventEmitter { if (!keyring.removeAccount) { throw new Error(KeyringControllerError.UnsupportedRemoveAccount); } - keyring.removeAccount(address); + + // The `removeAccount` method of snaps keyring is async. We have to update + // the interface of the other keyrings to be async as well. + // eslint-disable-next-line @typescript-eslint/await-thenable + await keyring.removeAccount(address); this.emit('removedAccount', address); const accounts = await keyring.getAccounts();