diff --git a/x/incentive/client/cli/query.go b/x/incentive/client/cli/query.go index ec5755ab..e3dc4bf7 100644 --- a/x/incentive/client/cli/query.go +++ b/x/incentive/client/cli/query.go @@ -35,13 +35,13 @@ func GetQueryCmd(queryRoute string, cdc *codec.Codec) *cobra.Command { func queryClaimsCmd(queryRoute string, cdc *codec.Codec) *cobra.Command { return &cobra.Command{ - Use: "claims [owner-addr] [denom]", - Short: "get claims by onwer and denom", + Use: "claims [owner-addr] [collateral-type]", + Short: "get claims by owner and collateral-type", Long: strings.TrimSpace( fmt.Sprintf(`Get all claims owned by the owner address for the particular collateral type. Example: - $ %s query %s claims kava15qdefkmwswysgg4qxgqpqr35k3m49pkx2jdfnw bnb`, version.ClientName, types.ModuleName)), + $ %s query %s claims kava15qdefkmwswysgg4qxgqpqr35k3m49pkx2jdfnw bnb-a`, version.ClientName, types.ModuleName)), Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { cliCtx := context.NewCLIContext().WithCodec(cdc) @@ -66,7 +66,7 @@ func queryClaimsCmd(queryRoute string, cdc *codec.Codec) *cobra.Command { } cliCtx = cliCtx.WithHeight(height) - var claims types.Claims + var claims types.AugmentedClaims if err := cdc.UnmarshalJSON(res, &claims); err != nil { return fmt.Errorf("failed to unmarshal claims: %w", err) } diff --git a/x/incentive/client/rest/query.go b/x/incentive/client/rest/query.go index 09177618..429c97b0 100644 --- a/x/incentive/client/rest/query.go +++ b/x/incentive/client/rest/query.go @@ -13,13 +13,8 @@ import ( "github.com/kava-labs/kava/x/incentive/types" ) -const ( - restOwner = "owner" - restDenom = "denom" -) - func registerQueryRoutes(cliCtx context.CLIContext, r *mux.Router) { - r.HandleFunc(fmt.Sprintf("/%s/claims/{%s}/{%s}", types.ModuleName, restOwner, restDenom), queryClaimsHandlerFn(cliCtx)).Methods("GET") + r.HandleFunc(fmt.Sprintf("/%s/claims/{%s}/{%s}", types.ModuleName, types.RestClaimOwner, types.RestClaimCollateralType), queryClaimsHandlerFn(cliCtx)).Methods("GET") r.HandleFunc(fmt.Sprintf("/%s/rewardperiods", types.ModuleName), queryRewardPeriodsHandlerFn(cliCtx)).Methods("GET") r.HandleFunc(fmt.Sprintf("/%s/claimperiods", types.ModuleName), queryClaimPeriodsHandlerFn(cliCtx)).Methods("GET") r.HandleFunc(fmt.Sprintf("/%s/parameters", types.ModuleName), queryParamsHandlerFn(cliCtx)).Methods("GET")