From 4c86915d6e35f76200addad67f3c1889cf8ddb4b Mon Sep 17 00:00:00 2001 From: mixmix Date: Thu, 26 Sep 2024 14:05:15 +1200 Subject: [PATCH] add detailed error message on failure to persist verifyingKey --- src/account/utils.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/account/utils.ts b/src/account/utils.ts index 111f132b..cf51603a 100644 --- a/src/account/utils.ts +++ b/src/account/utils.ts @@ -26,6 +26,8 @@ export async function selectAndPersistNewAccount (newAccount: EntropyAccountConf export async function addVerifyingKeyToAccountAndSelect (verifyingKey: string, accountNameOrAddress: string) { const storedConfig = await config.get() const account = findAccountByAddressOrName(storedConfig.accounts, accountNameOrAddress) + if (!account) throw Error(`Unable to persist verifyingKey "${verifyingKey}" to unknown account "${accountNameOrAddress}"`) + account.data.registration.verifyingKeys.push(verifyingKey) // persist to config, set selectedAccount