From f8b030aece9b492f81f09a9c753d2a02a1796e80 Mon Sep 17 00:00:00 2001 From: Sunny Aggarwal Date: Tue, 23 Oct 2018 01:40:53 -0700 Subject: [PATCH] cli fixes --- cmd/gaia/cmd/gaiacli/main.go | 1 + x/stake/client/cli/query.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/gaia/cmd/gaiacli/main.go b/cmd/gaia/cmd/gaiacli/main.go index 212a67021..a2be558eb 100644 --- a/cmd/gaia/cmd/gaiacli/main.go +++ b/cmd/gaia/cmd/gaiacli/main.go @@ -84,6 +84,7 @@ func main() { stakecmd.GetCmdQueryRedelegations(storeStake, cdc), stakecmd.GetCmdQueryValidator(storeStake, cdc), stakecmd.GetCmdQueryValidators(storeStake, cdc), + stakecmd.GetCmdQueryValidatorDelegations(queryRouteStake, cdc), stakecmd.GetCmdQueryValidatorUnbondingDelegations(queryRouteStake, cdc), stakecmd.GetCmdQueryValidatorRedelegations(queryRouteStake, cdc), stakecmd.GetCmdQueryParams(storeStake, cdc), diff --git a/x/stake/client/cli/query.go b/x/stake/client/cli/query.go index 47bcd693a..f6265c2cd 100644 --- a/x/stake/client/cli/query.go +++ b/x/stake/client/cli/query.go @@ -292,7 +292,7 @@ func GetCmdQueryDelegations(storeName string, cdc *codec.Codec) *cobra.Command { // GetCmdQueryValidatorDelegations implements the command to query all the // delegations to a specific validator. -func GetCmdQueryValidatorDelegations(storeName string, cdc *codec.Codec) *cobra.Command { +func GetCmdQueryValidatorDelegations(queryRoute string, cdc *codec.Codec) *cobra.Command { cmd := &cobra.Command{ Use: "delegations-to [validator-addr]", Short: "Query all delegations made to one validator", @@ -314,7 +314,7 @@ func GetCmdQueryValidatorDelegations(storeName string, cdc *codec.Codec) *cobra. cliCtx := context.NewCLIContext().WithCodec(cdc) - res, err := cliCtx.QueryWithData("custom/stake/validatorDelegations", bz) + res, err := cliCtx.QueryWithData(fmt.Sprintf("custom/%s/validatorDelegations", queryRoute), bz) if err != nil { return err }