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 12:27:44 +02:00 committed by GitHub
parent 51df2f2033
commit d0cabdeb88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 3 additions and 14 deletions

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

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

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 {

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}
}