From 779c0ac47a0d87067d007b51077ccd2207467796 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Thu, 3 Nov 2022 22:50:21 +0100 Subject: [PATCH] chore: add `TestSendCoins_Invalid_SendLockedCoins` to tests/integration (#13752) --- tests/integration/bank/keeper/keeper_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/integration/bank/keeper/keeper_test.go b/tests/integration/bank/keeper/keeper_test.go index 4d93f9d765..6f2b391fef 100644 --- a/tests/integration/bank/keeper/keeper_test.go +++ b/tests/integration/bank/keeper/keeper_test.go @@ -523,6 +523,26 @@ func (suite *IntegrationTestSuite) TestValidateBalance() { suite.Require().Error(suite.bankKeeper.ValidateBalance(ctx, addr2)) } +func (suite *IntegrationTestSuite) TestSendCoins_Invalid_SendLockedCoins() { + ctx := suite.ctx + balances := sdk.NewCoins(newFooCoin(50)) + addr := sdk.AccAddress([]byte("addr1_______________")) + addr2 := sdk.AccAddress([]byte("addr2_______________")) + + now := tmtime.Now() + endTime := now.Add(24 * time.Hour) + + origCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 100)) + sendCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 50)) + + acc0 := authtypes.NewBaseAccountWithAddress(addr) + vacc := vesting.NewContinuousVestingAccount(acc0, origCoins, now.Unix(), endTime.Unix()) + suite.accountKeeper.SetAccount(ctx, vacc) + + suite.Require().NoError(testutil.FundAccount(suite.bankKeeper, suite.ctx, addr2, balances)) + suite.Require().Error(suite.bankKeeper.SendCoins(ctx, addr, addr2, sendCoins)) +} + func (suite *IntegrationTestSuite) TestSendEnabled() { ctx := suite.ctx enabled := true