mirror of https://github.com/certusone/wasmd.git
Fix list contracts by code id
This commit is contained in:
parent
e4be8f1e58
commit
7c6c31de74
|
@ -77,7 +77,12 @@ func queryCodeHandlerFn(cliCtx context.CLIContext) http.HandlerFunc {
|
||||||
|
|
||||||
func listContractsByCodeHandlerFn(cliCtx context.CLIContext) http.HandlerFunc {
|
func listContractsByCodeHandlerFn(cliCtx context.CLIContext) http.HandlerFunc {
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
route := fmt.Sprintf("custom/%s/%s", types.QuerierRoute, keeper.QueryListContractByCode)
|
codeID, err := strconv.ParseUint(mux.Vars(r)["codeID"], 10, 64)
|
||||||
|
if err != nil {
|
||||||
|
rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
route := fmt.Sprintf("custom/%s/%s/%d", types.QuerierRoute, keeper.QueryListContractByCode, codeID)
|
||||||
res, _, err := cliCtx.Query(route)
|
res, _, err := cliCtx.Query(route)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error())
|
rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error())
|
||||||
|
|
Loading…
Reference in New Issue