From: Chris Duncan Date: Thu, 3 Jul 2025 20:27:17 +0000 (-0700) Subject: Destroy accounts in safe asynchronously too. X-Git-Tag: v0.10.5~136^2~10 X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=46baa2937337ba251785a438befaae750bdc13b6;p=libnemo.git Destroy accounts in safe asynchronously too. --- diff --git a/src/lib/account.ts b/src/lib/account.ts index 315a8b8..2bc5c1d 100644 --- a/src/lib/account.ts +++ b/src/lib/account.ts @@ -72,8 +72,8 @@ export class Account { * Removes encrypted secrets in storage and releases variable references to * allow garbage collection. */ - destroy (): void { - Account.#poolSafe.assign({ + async destroy (): Promise { + await Account.#poolSafe.assign({ method: 'destroy', name: this.#pub }) diff --git a/src/lib/wallets/wallet.ts b/src/lib/wallets/wallet.ts index 726d20a..a883563 100644 --- a/src/lib/wallets/wallet.ts +++ b/src/lib/wallets/wallet.ts @@ -68,7 +68,7 @@ export abstract class Wallet { async destroy (): Promise { let i = 0 for (const a in this.#accounts) { - this.#accounts[a].destroy() + await this.#accounts[a].destroy() delete this.#accounts[a] i++ }