Add missing cancel-software-upgrade cmd (#6840)
* Add cancel software upgrade cmd * add proposal cancel handler * Fix gofmt
This commit is contained in:
parent
e906c012a0
commit
1f8cc450c4
|
@ -93,7 +93,7 @@ var (
|
|||
mint.AppModuleBasic{},
|
||||
distr.AppModuleBasic{},
|
||||
gov.NewAppModuleBasic(
|
||||
paramsclient.ProposalHandler, distrclient.ProposalHandler, upgradeclient.ProposalHandler,
|
||||
paramsclient.ProposalHandler, distrclient.ProposalHandler, upgradeclient.ProposalHandler, upgradeclient.CancelProposalHandler,
|
||||
),
|
||||
params.AppModuleBasic{},
|
||||
crisis.AppModuleBasic{},
|
||||
|
|
|
@ -144,6 +144,8 @@ func NewCmdSubmitCancelUpgradeProposal() *cobra.Command {
|
|||
cmd.Flags().String(cli.FlagTitle, "", "title of proposal")
|
||||
cmd.Flags().String(cli.FlagDescription, "", "description of proposal")
|
||||
cmd.Flags().String(cli.FlagDeposit, "", "deposit of proposal")
|
||||
cmd.MarkFlagRequired(cli.FlagTitle)
|
||||
cmd.MarkFlagRequired(cli.FlagDescription)
|
||||
flags.AddTxFlagsToCmd(cmd)
|
||||
|
||||
return cmd
|
||||
|
|
|
@ -7,3 +7,4 @@ import (
|
|||
)
|
||||
|
||||
var ProposalHandler = govclient.NewProposalHandler(cli.NewCmdSubmitUpgradeProposal, rest.ProposalRESTHandler)
|
||||
var CancelProposalHandler = govclient.NewProposalHandler(cli.NewCmdSubmitCancelUpgradeProposal, rest.ProposalCancelRESTHandler)
|
||||
|
|
|
@ -60,6 +60,13 @@ func ProposalRESTHandler(clientCtx client.Context) govrest.ProposalRESTHandler {
|
|||
}
|
||||
}
|
||||
|
||||
func ProposalCancelRESTHandler(clientCtx client.Context) govrest.ProposalRESTHandler {
|
||||
return govrest.ProposalRESTHandler{
|
||||
SubRoute: "upgrade",
|
||||
Handler: cancelPlanHandler(clientCtx),
|
||||
}
|
||||
}
|
||||
|
||||
// nolint
|
||||
func newPostPlanHandler(clientCtx client.Context, txg client.TxConfig, newMsgFn func() gov.MsgSubmitProposalI) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
|
|
Loading…
Reference in New Issue