x/upgrade: clean-up redundant struct (#6606)

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
Amaury Martiny
2020-07-06 10:27:44 +00:00
committed by GitHub
co-authored by Alessio Treglia mergify[bot]
parent 51df2f2033
commit d0cabdeb88
4 changed files with 3 additions and 14 deletions
+1 -1
View File
@@ -54,7 +54,7 @@ func GetAppliedHeightCmd(storeName string, cdc *codec.Codec) *cobra.Command {
clientCtx := client.NewContext().WithCodec(cdc).WithJSONMarshaler(cdc)
name := args[0]
params := types.NewQueryAppliedParams(name)
params := types.NewQueryAppliedPlanRequest(name)
bz, err := clientCtx.JSONMarshaler.MarshalJSON(params)
if err != nil {
return err
+1 -1
View File
@@ -45,7 +45,7 @@ func getDonePlanHandler(clientCtx client.Context) func(http.ResponseWriter, *htt
return func(w http.ResponseWriter, r *http.Request) {
name := mux.Vars(r)["name"]
params := types.NewQueryAppliedParams(name)
params := types.NewQueryAppliedPlanRequest(name)
bz, err := clientCtx.JSONMarshaler.MarshalJSON(params)
if rest.CheckBadRequestError(w, err) {
return
+1 -1
View File
@@ -43,7 +43,7 @@ func queryCurrent(ctx sdk.Context, _ abci.RequestQuery, k Keeper) ([]byte, error
}
func queryApplied(ctx sdk.Context, req abci.RequestQuery, k Keeper) ([]byte, error) {
var params types.QueryAppliedParams
var params types.QueryAppliedPlanRequest
err := k.cdc.UnmarshalJSON(req.Data, &params)
if err != nil {
-11
View File
@@ -15,14 +15,3 @@ func NewQueryCurrentPlanRequest() *QueryCurrentPlanRequest {
func NewQueryAppliedPlanRequest(name string) *QueryAppliedPlanRequest {
return &QueryAppliedPlanRequest{Name: name}
}
// QueryAppliedParams is passed as data with QueryApplied
type QueryAppliedParams struct {
Name string
}
// NewQueryAppliedParams creates a new instance to query
// if a named plan was applied
func NewQueryAppliedParams(name string) QueryAppliedParams {
return QueryAppliedParams{Name: name}
}