]> git.codecow.com Git - libnemo.git/commitdiff
Tweak wallet lock and unlock response handling.
authorChris Duncan <chris@zoso.dev>
Thu, 3 Jul 2025 23:14:44 +0000 (16:14 -0700)
committerChris Duncan <chris@zoso.dev>
Thu, 3 Jul 2025 23:14:44 +0000 (16:14 -0700)
src/lib/wallets/wallet.ts

index c69bd9f9835cf08a822cf18dcbd0d639b219a81d..df110dbc04114f5ed4360e296ddef9973f07496d 100644 (file)
@@ -244,13 +244,13 @@ export abstract class Wallet {
                        if (typeof this.#seed === 'string') {\r
                                data.seed = this.#seed\r
                        }\r
-                       const res = await this.#poolSafe.assign({\r
+                       const response = (await this.#poolSafe.assign({\r
                                method: 'put',\r
                                name: this.id,\r
                                password,\r
                                data\r
-                       })\r
-                       const success = res[0].result\r
+                       }))[0]\r
+                       const success = response.result\r
                        if (!success) {\r
                                throw null\r
                        }\r
@@ -284,12 +284,12 @@ export abstract class Wallet {
                        throw new Error('Failed to unlock wallet')\r
                }\r
                try {\r
-                       const res = await this.#poolSafe.assign({\r
+                       const response = (await this.#poolSafe.assign({\r
                                method: 'get',\r
                                name: this.id,\r
                                password\r
-                       })\r
-                       const { id, mnemonic, seed } = res[0].result\r
+                       }))[0]\r
+                       const { id, mnemonic, seed } = response.result\r
                        if (id !== this.id) {\r
                                throw null\r
                        }\r