@cosmology/ast
Version:
Cosmos TypeScript AST generation
17 lines • 691 B
JavaScript
import { createLCDClient } from './lcd';
import { traverse } from '@cosmology/proto-parser';
import { getNestedProto } from '@cosmology/utils';
import { GenericParseContext } from '../../../encoding';
import { getTestProtoStore, expectCode } from '../../../../test-utils';
const store = getTestProtoStore({
classesUseArrowFunctions: true
});
store.traverseAll();
it('cosmos/group/v1/query.proto', () => {
const ref = store.findProto('cosmos/group/v1/query.proto');
const res = traverse(store, ref);
const service = getNestedProto(res).Query;
const context = new GenericParseContext(ref, store, store.options);
const ast = createLCDClient(context, service);
expectCode(ast);
});