From 183acfef62ce14865617ca7563ee0ce9b04f49b8 Mon Sep 17 00:00:00 2001 From: Ruaridh Date: Sat, 1 Feb 2020 15:49:36 +0000 Subject: [PATCH] auction query fixes (#354) --- x/auction/client/rest/query.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/x/auction/client/rest/query.go b/x/auction/client/rest/query.go index 97e27aa7..3e0573b7 100644 --- a/x/auction/client/rest/query.go +++ b/x/auction/client/rest/query.go @@ -46,13 +46,13 @@ func queryAuctionHandlerFn(cliCtx context.CLIContext) http.HandlerFunc { } // Query - res, height, err := cliCtx.QueryWithData("custom/gov/proposal", bz) + res, height, err := cliCtx.QueryWithData(fmt.Sprintf("/custom/%s/%s", types.ModuleName, types.QueryGetAuction), bz) if err != nil { rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error()) return } var auction types.Auction - err = cliCtx.Codec.UnmarshalJSON(res, auction) + err = cliCtx.Codec.UnmarshalJSON(res, &auction) if err != nil { rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error()) return @@ -74,7 +74,7 @@ func queryAuctionsHandlerFn(cliCtx context.CLIContext) http.HandlerFunc { return } // Get all auctions - res, height, err := cliCtx.QueryWithData(fmt.Sprintf("/custom/auction/%s", types.QueryGetAuctions), nil) + res, height, err := cliCtx.QueryWithData(fmt.Sprintf("/custom/%s/%s", types.ModuleName, types.QueryGetAuctions), nil) if err != nil { rest.WriteErrorResponse(w, http.StatusNotFound, err.Error()) return @@ -83,7 +83,7 @@ func queryAuctionsHandlerFn(cliCtx context.CLIContext) http.HandlerFunc { cliCtx = cliCtx.WithHeight(height) var auctions types.Auctions - err = cliCtx.Codec.UnmarshalJSON(res, auctions) + err = cliCtx.Codec.UnmarshalJSON(res, &auctions) if err != nil { rest.WriteErrorResponse(w, http.StatusNotFound, err.Error()) return @@ -106,7 +106,7 @@ func getParamsHandlerFn(cliCtx context.CLIContext) http.HandlerFunc { return } // Get the params - res, height, err := cliCtx.QueryWithData(fmt.Sprintf("custom/auction/%s", types.QueryGetParams), nil) + res, height, err := cliCtx.QueryWithData(fmt.Sprintf("custom/%s/%s", types.ModuleName, types.QueryGetParams), nil) if err != nil { rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error()) return