Refactor code in set response header
This commit is contained in:
parent
d46b5629c2
commit
31b26e7154
|
@ -14,6 +14,7 @@ import (
|
|||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/spf13/viper"
|
||||
tmtypes "github.com/tendermint/tendermint/types"
|
||||
"github.com/cosmos/cosmos-sdk/client/utils"
|
||||
)
|
||||
|
||||
// TODO these next two functions feel kinda hacky based on their placement
|
||||
|
@ -157,8 +158,7 @@ func ValidatorSetRequestHandlerFn(cliCtx context.CLIContext) http.HandlerFunc {
|
|||
w.Write([]byte(err.Error()))
|
||||
return
|
||||
}
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.Write(output)
|
||||
utils.PostProcessResponse(w, cdc, output, cliCtx.Indent)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -178,7 +178,6 @@ func LatestValidatorSetRequestHandlerFn(cliCtx context.CLIContext) http.HandlerF
|
|||
w.Write([]byte(err.Error()))
|
||||
return
|
||||
}
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.Write(output)
|
||||
utils.PostProcessResponse(w, cdc, output, cliCtx.Indent)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue