From: Chris Duncan Date: Thu, 3 Jul 2025 23:14:44 +0000 (-0700) Subject: Tweak wallet lock and unlock response handling. X-Git-Tag: v0.10.5~135 X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=1a5bb7d0ac4f24a43c56bcb767244186c61613c9;p=libnemo.git Tweak wallet lock and unlock response handling. --- diff --git a/src/lib/wallets/wallet.ts b/src/lib/wallets/wallet.ts index c69bd9f..df110db 100644 --- a/src/lib/wallets/wallet.ts +++ b/src/lib/wallets/wallet.ts @@ -244,13 +244,13 @@ export abstract class Wallet { if (typeof this.#seed === 'string') { data.seed = this.#seed } - const res = await this.#poolSafe.assign({ + const response = (await this.#poolSafe.assign({ method: 'put', name: this.id, password, data - }) - const success = res[0].result + }))[0] + const success = response.result if (!success) { throw null } @@ -284,12 +284,12 @@ export abstract class Wallet { throw new Error('Failed to unlock wallet') } try { - const res = await this.#poolSafe.assign({ + const response = (await this.#poolSafe.assign({ method: 'get', name: this.id, password - }) - const { id, mnemonic, seed } = res[0].result + }))[0] + const { id, mnemonic, seed } = response.result if (id !== this.id) { throw null }