Merge PR #3580: Code cleanup of client types

This commit is contained in:
Alessio Treglia
2019-02-14 08:53:36 -08:00
committed by Jack Zampolin
parent f72a7c3829
commit 1aa6c197ff
34 changed files with 330 additions and 362 deletions
+3 -2
View File
@@ -3,7 +3,7 @@ package tx
import (
"net/http"
"github.com/cosmos/cosmos-sdk/client/rest"
"github.com/cosmos/cosmos-sdk/types/rest"
"io/ioutil"
@@ -50,7 +50,8 @@ func BroadcastTxRequest(cliCtx context.CLIContext, cdc *codec.Codec) http.Handle
case flagAsync:
res, err = cliCtx.BroadcastTxAsync(m.TxBytes)
default:
rest.WriteErrorResponse(w, http.StatusInternalServerError, "unsupported return type. supported types: block, sync, async")
rest.WriteErrorResponse(w, http.StatusInternalServerError,
"unsupported return type. supported types: block, sync, async")
return
}
if err != nil {
+1 -1
View File
@@ -13,9 +13,9 @@ import (
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/context"
"github.com/cosmos/cosmos-sdk/client/rest"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/rest"
"github.com/cosmos/cosmos-sdk/x/auth"
)
+3 -3
View File
@@ -8,12 +8,11 @@ import (
"strconv"
"strings"
"github.com/cosmos/cosmos-sdk/client/rest"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/context"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/rest"
"github.com/spf13/cobra"
"github.com/spf13/viper"
@@ -176,7 +175,8 @@ func SearchTxRequestHandlerFn(cliCtx context.CLIContext, cdc *codec.Codec) http.
var txs []sdk.TxResponse
err := r.ParseForm()
if err != nil {
rest.WriteErrorResponse(w, http.StatusBadRequest, sdk.AppendMsgToErr("could not parse query parameters", err.Error()))
rest.WriteErrorResponse(w, http.StatusBadRequest,
sdk.AppendMsgToErr("could not parse query parameters", err.Error()))
return
}
if len(r.Form) == 0 {