test(x/staking): write integration tests (#15890)
This commit is contained in:
@@ -308,6 +308,7 @@ func (s *CLITestSuite) TestNewCreateValidatorCmd() {
|
||||
func (s *CLITestSuite) TestNewEditValidatorCmd() {
|
||||
cmd := cli.NewEditValidatorCmd()
|
||||
|
||||
moniker := "testing"
|
||||
details := "bio"
|
||||
identity := "test identity"
|
||||
securityContact := "test contact"
|
||||
@@ -382,9 +383,21 @@ func (s *CLITestSuite) TestNewEditValidatorCmd() {
|
||||
},
|
||||
"",
|
||||
},
|
||||
{
|
||||
"edit validator moniker", // https://github.com/cosmos/cosmos-sdk/issues/10660
|
||||
[]string{
|
||||
fmt.Sprintf("--%s=%s", cli.FlagEditMoniker, moniker),
|
||||
fmt.Sprintf("--%s=%s", flags.FlagFrom, s.addrs[0]),
|
||||
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
|
||||
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync),
|
||||
fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10))).String()),
|
||||
},
|
||||
"",
|
||||
},
|
||||
{
|
||||
"with all edit flags",
|
||||
[]string{
|
||||
fmt.Sprintf("--%s=%s", cli.FlagEditMoniker, moniker),
|
||||
fmt.Sprintf("--details=%s", details),
|
||||
fmt.Sprintf("--identity=%s", identity),
|
||||
fmt.Sprintf("--security-contact=%s", securityContact),
|
||||
@@ -499,6 +512,34 @@ func (s *CLITestSuite) TestNewRedelegateCmd() {
|
||||
},
|
||||
"invalid decimal coin expression: fooCoin",
|
||||
},
|
||||
{
|
||||
"wrong src validator",
|
||||
[]string{
|
||||
"invalid", // wrong src-validator-addr
|
||||
sdk.ValAddress(s.addrs[1]).String(), // dst-validator-addr
|
||||
sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(150)).String(), // amount
|
||||
fmt.Sprintf("--%s=%s", flags.FlagFrom, s.addrs[0]),
|
||||
fmt.Sprintf("--%s=%d", flags.FlagGas, 300000),
|
||||
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
|
||||
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync),
|
||||
fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10))).String()),
|
||||
},
|
||||
"invalid bech32",
|
||||
},
|
||||
{
|
||||
"wrong dst validator",
|
||||
[]string{
|
||||
sdk.ValAddress(s.addrs[0]).String(), // src-validator-addr
|
||||
"invalid", // wrong dst-validator-addr
|
||||
sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(150)).String(), // amount
|
||||
fmt.Sprintf("--%s=%s", flags.FlagFrom, s.addrs[0]),
|
||||
fmt.Sprintf("--%s=%d", flags.FlagGas, 300000),
|
||||
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
|
||||
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync),
|
||||
fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10))).String()),
|
||||
},
|
||||
"invalid bech32",
|
||||
},
|
||||
{
|
||||
"valid transaction of delegate",
|
||||
[]string{
|
||||
|
||||
Reference in New Issue
Block a user