Merge PR #7354: Fix TestMsgCreateVestingAccount
This commit is contained in:
parent
02c20804ac
commit
535510be1f
|
@ -39,28 +39,32 @@ func (suite *HandlerTestSuite) TestMsgCreateVestingAccount() {
|
|||
suite.app.AccountKeeper.SetAccount(ctx, acc1)
|
||||
suite.Require().NoError(suite.app.BankKeeper.SetBalances(ctx, addr1, balances))
|
||||
|
||||
testCases := map[string]struct {
|
||||
testCases := []struct {
|
||||
name string
|
||||
msg *types.MsgCreateVestingAccount
|
||||
expectErr bool
|
||||
}{
|
||||
"create delayed vesting account": {
|
||||
{
|
||||
name: "create delayed vesting account",
|
||||
msg: types.NewMsgCreateVestingAccount(addr1, addr2, sdk.NewCoins(sdk.NewInt64Coin("test", 100)), ctx.BlockTime().Unix()+10000, true),
|
||||
expectErr: false,
|
||||
},
|
||||
"create continuous vesting account": {
|
||||
{
|
||||
name: "create continuous vesting account",
|
||||
msg: types.NewMsgCreateVestingAccount(addr1, addr3, sdk.NewCoins(sdk.NewInt64Coin("test", 100)), ctx.BlockTime().Unix()+10000, false),
|
||||
expectErr: false,
|
||||
},
|
||||
"continuous vesting account already exists": {
|
||||
{
|
||||
name: "continuous vesting account already exists",
|
||||
msg: types.NewMsgCreateVestingAccount(addr1, addr3, sdk.NewCoins(sdk.NewInt64Coin("test", 100)), ctx.BlockTime().Unix()+10000, false),
|
||||
expectErr: true,
|
||||
},
|
||||
}
|
||||
|
||||
for name, tc := range testCases {
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
|
||||
suite.Run(name, func() {
|
||||
suite.Run(tc.name, func() {
|
||||
res, err := suite.handler(ctx, tc.msg)
|
||||
if tc.expectErr {
|
||||
suite.Require().Error(err)
|
||||
|
|
Loading…
Reference in New Issue