Skip to content

Commit

Permalink
Fix TestSendCoinsWithRestriction by not expecting call to GetAccount
Browse files Browse the repository at this point in the history
  • Loading branch information
wr1159 committed Jun 2, 2024
1 parent 830d9d1 commit aeba93e
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions x/bank/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,7 @@ func (suite *KeeperTestSuite) TestSendCoinsWithRestrictions() {
},
expErr: "test restriction error",
expBals: expBals{
from: sdk.NewCoins(newFooCoin(885), newBarCoin(273)),
from: sdk.NewCoins(newFooCoin(985), newBarCoin(473)),
to1: sdk.NewCoins(newFooCoin(15)),
to2: sdk.NewCoins(newBarCoin(27)),
},
Expand All @@ -1194,12 +1194,9 @@ func (suite *KeeperTestSuite) TestSendCoinsWithRestrictions() {
actualRestrictionArgs = nil
suite.bankKeeper.SetSendRestriction(tc.fn)
ctx := suite.ctx
if len(tc.expErr) > 0 {
suite.authKeeper.EXPECT().GetAccount(ctx, fromAddr).Return(fromAcc)
} else {
if len(tc.expErr) == 0 {
suite.mockSendCoins(ctx, fromAcc, tc.finalAddr)
}

var err error
testFunc := func() {
err = suite.bankKeeper.SendCoins(ctx, fromAddr, tc.toAddr, tc.amt)
Expand Down

0 comments on commit aeba93e

Please sign in to comment.