Skip to content

Commit

Permalink
register ICA query server, fix panics in params query cli (#666)
Browse files Browse the repository at this point in the history
Register the controller and host query servers to a chain.
Returns an error upon cli params query failure instead of panicing.
  • Loading branch information
colin-axner authored Dec 23, 2021
1 parent ffc29d9 commit ce71056
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ func GetCmdParams() *cobra.Command {
}
queryClient := types.NewQueryClient(clientCtx)

res, _ := queryClient.Params(cmd.Context(), &types.QueryParamsRequest{})
res, err := queryClient.Params(cmd.Context(), &types.QueryParamsRequest{})
if err != nil {
return err
}

return clientCtx.PrintProto(res.Params)
},
}
Expand Down
6 changes: 5 additions & 1 deletion modules/apps/27-interchain-accounts/host/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ func GetCmdParams() *cobra.Command {
}
queryClient := types.NewQueryClient(clientCtx)

res, _ := queryClient.Params(cmd.Context(), &types.QueryParamsRequest{})
res, err := queryClient.Params(cmd.Context(), &types.QueryParamsRequest{})
if err != nil {
return err
}

return clientCtx.PrintProto(res.Params)
},
}
Expand Down
2 changes: 2 additions & 0 deletions modules/apps/27-interchain-accounts/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd

// RegisterServices registers module services
func (am AppModule) RegisterServices(cfg module.Configurator) {
controllertypes.RegisterQueryServer(cfg.QueryServer(), am.controllerKeeper)
hosttypes.RegisterQueryServer(cfg.QueryServer(), am.hostKeeper)
}

// InitGenesis performs genesis initialization for the interchain accounts module.
Expand Down
6 changes: 5 additions & 1 deletion modules/apps/transfer/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ func GetCmdParams() *cobra.Command {
}
queryClient := types.NewQueryClient(clientCtx)

res, _ := queryClient.Params(cmd.Context(), &types.QueryParamsRequest{})
res, err := queryClient.Params(cmd.Context(), &types.QueryParamsRequest{})
if err != nil {
return err
}

return clientCtx.PrintProto(res.Params)
},
}
Expand Down

0 comments on commit ce71056

Please sign in to comment.