upgrade proposal needs tx flags. (#6981)

* upgrade proposal needs tx flags

* use AddTxFlagToCmd to every proposal command

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
This commit is contained in:
Jonathan Gimeno 2020-08-13 17:46:12 +02:00 committed by GitHub
parent a555b2cd4c
commit 4c762db64e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 2 additions and 4 deletions

View File

@ -820,6 +820,7 @@ func (s *IntegrationTestSuite) TestGetCmdSubmitProposal() {
s.Run(tc.name, func() { s.Run(tc.name, func() {
cmd := cli.GetCmdSubmitProposal() cmd := cli.GetCmdSubmitProposal()
flags.AddTxFlagsToCmd(cmd)
_, out := testutil.ApplyMockIO(cmd) _, out := testutil.ApplyMockIO(cmd)
clientCtx := val.ClientCtx.WithOutput(out) clientCtx := val.ClientCtx.WithOutput(out)

View File

@ -318,7 +318,5 @@ Where proposal.json contains:
}, },
} }
flags.AddTxFlagsToCmd(cmd)
return cmd return cmd
} }

View File

@ -61,6 +61,7 @@ func NewTxCmd(propCmds []*cobra.Command) *cobra.Command {
cmdSubmitProp := NewCmdSubmitProposal() cmdSubmitProp := NewCmdSubmitProposal()
for _, propCmd := range propCmds { for _, propCmd := range propCmds {
flags.AddTxFlagsToCmd(propCmd)
cmdSubmitProp.AddCommand(propCmd) cmdSubmitProp.AddCommand(propCmd)
} }

View File

@ -7,7 +7,6 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/client/tx" "github.com/cosmos/cosmos-sdk/client/tx"
sdk "github.com/cosmos/cosmos-sdk/types" sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/gov/client/cli" "github.com/cosmos/cosmos-sdk/x/gov/client/cli"
@ -146,7 +145,6 @@ func NewCmdSubmitCancelUpgradeProposal() *cobra.Command {
cmd.Flags().String(cli.FlagDeposit, "", "deposit of proposal") cmd.Flags().String(cli.FlagDeposit, "", "deposit of proposal")
cmd.MarkFlagRequired(cli.FlagTitle) cmd.MarkFlagRequired(cli.FlagTitle)
cmd.MarkFlagRequired(cli.FlagDescription) cmd.MarkFlagRequired(cli.FlagDescription)
flags.AddTxFlagsToCmd(cmd)
return cmd return cmd
} }