Skip to content

Commit

Permalink
fix query function
Browse files Browse the repository at this point in the history
  • Loading branch information
Zetazzz committed Oct 23, 2024
1 parent a16d666 commit 199b65c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/ast/src/clients/helper-funcs/query-funcs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,29 @@ export function createQueryHelperCreator(
methodKey?: string,
helperCreatorName?: string
) {
const pkgImportName = context.ref.proto.package + '.' + service.name

context.addUtil("RpcResolver");
context.addUtil("buildQuery");
const callExpression = ast.callExpression(ast.identifier("buildQuery"), [
ast.objectExpression([
ast.objectProperty(
ast.identifier("encoder"),
ast.identifier("encode"),
ast.memberExpression(
ast.identifier(service.requestType),
ast.identifier("encode")
)
),
ast.objectProperty(
ast.identifier("decoder"),
ast.identifier("decode"),
ast.memberExpression(
ast.identifier(service.responseType),
ast.identifier("decode")
)
),
ast.objectProperty(
ast.identifier("service"),
// Does this value needs to change?
ast.stringLiteral("cosmos.bank.v1beta1.Query")
ast.stringLiteral(pkgImportName)
),
ast.objectProperty(
ast.identifier("method"),
Expand Down

0 comments on commit 199b65c

Please sign in to comment.