Skip to content

Commit

Permalink
fix: issue when generating QueryClient with titled QueryMsg variants (#…
Browse files Browse the repository at this point in the history
…94)

* fix: titled query varient client issue

* test: fix test
  • Loading branch information
srdtrk authored Jun 22, 2024
1 parent f4a783d commit cac4d56
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion integration_test/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func (s *MySuite) TestQueryClient() {
s.GenerateQueryClientTest("testdata/cw721-base.json")
s.GenerateQueryClientTest("testdata/cw2981-royalties.json")
s.GenerateQueryClientTest("testdata/ics721.json")
s.GenerateMessageTypesTest("testdata/dao-dao-core.json")
s.GenerateQueryClientTest("testdata/dao-dao-core.json")
s.GenerateQueryClientTest("testdata/axone-objectarium.json")
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/codegen/querier.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ func generateQueryFunc(queryTitle, queryName string, respSchema *schemas.JSONSch
jen.Id("req").Op("*").Id(reqType),
jen.Id("opts").Op("...").Qual("google.golang.org/grpc", "CallOption"),
).Params(jen.Op("*").Id(respType), jen.Error()).Block(
jen.List(jen.Id("rawQueryData"), jen.Err()).Op(":=").Qual("encoding/json", "Marshal").Call(jen.Op("&").Id(queryTitle).Values(jen.Dict{
jen.Id(pascalName): jen.Id("req"),
jen.List(jen.Id("rawQueryData"), jen.Err()).Op(":=").Qual("encoding/json", "Marshal").Call(jen.Map(jen.String()).Any().Values(jen.Dict{
jen.Lit(queryName): jen.Id("req"),
})),
jen.If(jen.Err().Op("!=").Nil()).Block(
jen.Return(jen.Nil(), jen.Err()),
Expand Down

0 comments on commit cac4d56

Please sign in to comment.