Merge PR #7354: Fix TestMsgCreateVestingAccount

This commit is contained in:
Alexander Bezobchuk 2020-09-21 09:54:50 -04:00 committed by GitHub
parent 02c20804ac
commit 535510be1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 6 deletions

View File

@ -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)