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 }