From 6055da62c75bbb8602da4ddb2fe6fc573889d57d Mon Sep 17 00:00:00 2001 From: Thomas E Lackey Date: Tue, 20 Aug 2024 19:01:24 +0000 Subject: [PATCH] Fix default 'account get' output. (#77) The current code throws an exception if no address is specified. It is supposed to return the current account info. Reviewed-on: https://git.vdb.to/cerc-io/laconic-registry-cli/pulls/77 Reviewed-by: David Boreham Co-authored-by: Thomas E Lackey Co-committed-by: Thomas E Lackey --- package.json | 2 +- src/cmds/registry-cmds/account-cmds/get.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 63dcf72..0e5d681 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@cerc-io/laconic-registry-cli", - "version": "0.2.5", + "version": "0.2.6", "main": "index.js", "repository": "git@github.com:cerc-io/laconic-registry-cli.git", "author": "", diff --git a/src/cmds/registry-cmds/account-cmds/get.ts b/src/cmds/registry-cmds/account-cmds/get.ts index d86ab82..192505d 100644 --- a/src/cmds/registry-cmds/account-cmds/get.ts +++ b/src/cmds/registry-cmds/account-cmds/get.ts @@ -18,7 +18,9 @@ export const handler = async (argv: Arguments) => { assert(chainId, 'Invalid registry Chain ID.'); if (!address && privateKey) { - address = new Account(Buffer.from(privateKey, 'hex')).address; + const account = new Account(Buffer.from(privateKey, 'hex')); + await account.init(); + address = account.address; } const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);