Fix cns name resolve
All checks were successful
Tests / sdk_tests (pull_request) Successful in 3m29s

This commit is contained in:
Thomas E Lackey 2023-11-29 22:52:27 -06:00
parent 145da8c453
commit 3939b311f7
2 changed files with 4 additions and 6 deletions

View File

@ -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);
}

View File

@ -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)