Skip to content

Commit

Permalink
add detailed error message on failure to persist verifyingKey
Browse files Browse the repository at this point in the history
  • Loading branch information
mixmix committed Sep 26, 2024
1 parent cc63c72 commit 4c86915
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/account/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4c86915

Please sign in to comment.