From 3939b311f79d8a71094ec0351caa311a12ebb44c Mon Sep 17 00:00:00 2001 From: Thomas E Lackey Date: Wed, 29 Nov 2023 22:52:27 -0600 Subject: [PATCH 1/3] Fix cns name resolve --- src/cmds/cns-cmds/name-cmds/resolve.ts | 6 ++---- src/cmds/cns-cmds/record-cmds/list.ts | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/cmds/cns-cmds/name-cmds/resolve.ts b/src/cmds/cns-cmds/name-cmds/resolve.ts index d125f9f..e0711b4 100644 --- a/src/cmds/cns-cmds/name-cmds/resolve.ts +++ b/src/cmds/cns-cmds/name-cmds/resolve.ts @@ -2,7 +2,7 @@ import { Arguments } from 'yargs'; import assert from 'assert'; import { Registry } from '@cerc-io/laconic-sdk'; -import { getConfig, getConnectionInfo,txOutput } from '../../../util'; +import { getConfig, getConnectionInfo, queryOutput } from '../../../util'; export const command = 'resolve [name]'; @@ -21,7 +21,5 @@ export const handler = async (argv: Arguments) => { const registry = new Registry(gqlEndpoint, restEndpoint, chainId); const result = await registry.resolveNames([name]); - const success = `{"success":${result.code==0}}` - txOutput(result,success,argv.output,argv.verbose) - + queryOutput(result, argv.output); } diff --git a/src/cmds/cns-cmds/record-cmds/list.ts b/src/cmds/cns-cmds/record-cmds/list.ts index c887455..d20133c 100644 --- a/src/cmds/cns-cmds/record-cmds/list.ts +++ b/src/cmds/cns-cmds/record-cmds/list.ts @@ -48,11 +48,11 @@ export const handler = async (argv: Arguments) => { // Apply ex post filters. if (bondId) { - result = result.filter(v => v.bondId === bondId); + result = result.filter((v: any) => v.bondId === bondId); } if (owner) { - result = result.filter(v => v.owners?.find((e: string) => e === owner)); + result = result.filter((v: any) => v.owners?.find((e: string) => e === owner)); } queryOutput(result, argv.output) -- 2.45.2 From 97165d08a94a477b58376895a6bda1ab1599226a Mon Sep 17 00:00:00 2001 From: Thomas E Lackey Date: Wed, 29 Nov 2023 22:57:48 -0600 Subject: [PATCH 2/3] Filter null result --- src/cmds/cns-cmds/name-cmds/resolve.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cmds/cns-cmds/name-cmds/resolve.ts b/src/cmds/cns-cmds/name-cmds/resolve.ts index e0711b4..d4388c2 100644 --- a/src/cmds/cns-cmds/name-cmds/resolve.ts +++ b/src/cmds/cns-cmds/name-cmds/resolve.ts @@ -20,6 +20,8 @@ export const handler = async (argv: Arguments) => { const registry = new Registry(gqlEndpoint, restEndpoint, chainId); - const result = await registry.resolveNames([name]); + let result = await registry.resolveNames([name]); + result = result.filter((v: any) => v); + queryOutput(result, argv.output); } -- 2.45.2 From cc200b3509bb1a6b07606f2f991768b9f229f733 Mon Sep 17 00:00:00 2001 From: Thomas E Lackey Date: Wed, 29 Nov 2023 22:59:58 -0600 Subject: [PATCH 3/3] v0.1.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 23bb3e6..8e29830 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@cerc-io/laconic-registry-cli", - "version": "0.1.2", + "version": "0.1.3", "main": "index.js", "repository": "git@github.com:cerc-io/laconic-registry-cli.git", "author": "", -- 2.45.2