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",
|
"name": "@cerc-io/laconic-registry-cli",
|
||||||
"version": "0.1.2",
|
"version": "0.1.3",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"repository": "git@github.com:cerc-io/laconic-registry-cli.git",
|
"repository": "git@github.com:cerc-io/laconic-registry-cli.git",
|
||||||
"author": "",
|
"author": "",
|
||||||
|
@ -2,7 +2,7 @@ import { Arguments } from 'yargs';
|
|||||||
import assert from 'assert';
|
import assert from 'assert';
|
||||||
import { Registry } from '@cerc-io/laconic-sdk';
|
import { Registry } from '@cerc-io/laconic-sdk';
|
||||||
|
|
||||||
import { getConfig, getConnectionInfo,txOutput } from '../../../util';
|
import { getConfig, getConnectionInfo, queryOutput } from '../../../util';
|
||||||
|
|
||||||
export const command = 'resolve [name]';
|
export const command = 'resolve [name]';
|
||||||
|
|
||||||
@ -20,8 +20,8 @@ export const handler = async (argv: Arguments) => {
|
|||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
|
|
||||||
const result = await registry.resolveNames([name]);
|
let result = await registry.resolveNames([name]);
|
||||||
const success = `{"success":${result.code==0}}`
|
result = result.filter((v: any) => v);
|
||||||
txOutput(result,success,argv.output,argv.verbose)
|
|
||||||
|
|
||||||
|
queryOutput(result, argv.output);
|
||||||
}
|
}
|
||||||
|
@ -48,11 +48,11 @@ export const handler = async (argv: Arguments) => {
|
|||||||
|
|
||||||
// Apply ex post filters.
|
// Apply ex post filters.
|
||||||
if (bondId) {
|
if (bondId) {
|
||||||
result = result.filter(v => v.bondId === bondId);
|
result = result.filter((v: any) => v.bondId === bondId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (owner) {
|
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)
|
queryOutput(result, argv.output)
|
||||||
|
Loading…
Reference in New Issue
Block a user