diff --git a/client/tendermint/tx/searchtx.go b/client/tendermint/tx/searchtx.go index 36b8450de..2305b9292 100644 --- a/client/tendermint/tx/searchtx.go +++ b/client/tendermint/tx/searchtx.go @@ -3,19 +3,19 @@ package tx import ( "errors" "fmt" + "net/http" + "net/url" "strings" - "github.com/spf13/cobra" - "github.com/spf13/viper" - "github.com/irisnet/irishub/client" "github.com/irisnet/irishub/client/context" "github.com/irisnet/irishub/client/utils" "github.com/irisnet/irishub/codec" sdk "github.com/irisnet/irishub/types" + "github.com/spf13/cobra" + "github.com/spf13/viper" ctypes "github.com/tendermint/tendermint/rpc/core/types" - "net/http" - "net/url" + "github.com/tendermint/tendermint/types" ) const ( @@ -60,7 +60,11 @@ $ iriscli tendermint txs --tags ':&:' return fmt.Errorf("%s should only contain one : pair", tagsStr) } keyValue := strings.Split(tag, ":") - tag = fmt.Sprintf("%s='%s'", keyValue[0], keyValue[1]) + if keyValue[0] == types.TxHeightKey { + tag = fmt.Sprintf("%s=%s", keyValue[0], keyValue[1]) + } else { + tag = fmt.Sprintf("%s='%s'", keyValue[0], keyValue[1]) + } tmTags = append(tmTags, tag) } @@ -168,9 +172,11 @@ func SearchTxRequestHandlerFn(cliCtx context.CLIContext, cdc *codec.Codec) http. utils.WriteErrorResponse(w, http.StatusBadRequest, sdk.AppendMsgToErr("could not decode query value", err.Error())) return } - - tag := fmt.Sprintf("%s='%s'", key, value) - tags = append(tags, tag) + if key == types.TxHeightKey { + tags = append(tags, fmt.Sprintf("%s=%s", key, value)) + } else { + tags = append(tags, fmt.Sprintf("%s='%s'", key, value)) + } } pageString := r.FormValue("search_request_page") sizeString := r.FormValue("search_request_size")