Fix cns name resolve
(#42)
All checks were successful
Tests / sdk_tests (push) Successful in 3m34s
All checks were successful
Tests / sdk_tests (push) Successful in 3m34s
The `cns name resolve` does not return the result. Obviously it should. Reviewed-on: #42 Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com> Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
This commit is contained in:
parent
145da8c453
commit
fb381c07f3
@ -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,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]';
|
||||
|
||||
@ -20,8 +20,8 @@ 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)
|
||||
let result = await registry.resolveNames([name]);
|
||||
result = result.filter((v: any) => v);
|
||||
|
||||
queryOutput(result, argv.output);
|
||||
}
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user