Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tac0turtle committed May 13, 2024
1 parent 55fcb7b commit e673249
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 25 deletions.
9 changes: 0 additions & 9 deletions x/bank/keeper/grpc_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
vestingtypes "cosmossdk.io/x/auth/vesting/types"
"cosmossdk.io/x/bank/testutil"
"cosmossdk.io/x/bank/types"
banktypes "cosmossdk.io/x/bank/types"

codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil"
"github.com/cosmos/cosmos-sdk/testutil/testdata"
Expand Down Expand Up @@ -607,10 +606,6 @@ func (suite *KeeperTestSuite) TestGRPCDenomOwners() {
suite.mockMintCoins(mintAcc)
suite.Require().NoError(keeper.MintCoins(ctx, types.MintModuleName, initCoins))

suite.Require().NoError(suite.bankKeeper.SetParams(suite.ctx, banktypes.Params{
DefaultSendEnabled: banktypes.DefaultDefaultSendEnabled,
}))

for i := 0; i < 10; i++ {
addr := sdk.AccAddress(fmt.Sprintf("account-%d", i))

Expand Down Expand Up @@ -836,10 +831,6 @@ func (suite *KeeperTestSuite) TestGRPCDenomOwnersByQuery() {
suite.mockMintCoins(mintAcc)
suite.Require().NoError(keeper.MintCoins(ctx, types.MintModuleName, newCoins))

suite.Require().NoError(suite.bankKeeper.SetParams(suite.ctx, banktypes.Params{
DefaultSendEnabled: banktypes.DefaultDefaultSendEnabled,
}))

for i := 0; i < 10; i++ {
addr := sdk.AccAddress(fmt.Sprintf("account-%d", i))

Expand Down
21 changes: 5 additions & 16 deletions x/bank/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ func (suite *KeeperTestSuite) SetupTest() {
authority,
)

suite.Require().NoError(suite.bankKeeper.SetParams(ctx, banktypes.Params{
DefaultSendEnabled: banktypes.DefaultDefaultSendEnabled,
}))

banktypes.RegisterInterfaces(encCfg.InterfaceRegistry)

queryHelper := baseapp.NewQueryServerTestHelper(ctx, encCfg.InterfaceRegistry)
Expand All @@ -177,7 +181,7 @@ func (suite *KeeperTestSuite) mockMintCoins(moduleAcc *authtypes.ModuleAccount)

func (suite *KeeperTestSuite) mockSendCoinsFromModuleToAccount(moduleAcc *authtypes.ModuleAccount, _ sdk.AccAddress) {
suite.authKeeper.EXPECT().GetModuleAddress(moduleAcc.Name).Return(moduleAcc.GetAddress())
suite.authKeeper.EXPECT().GetAccount(suite.ctx, moduleAcc.GetAddress()).Return(moduleAcc).AnyTimes()
suite.authKeeper.EXPECT().GetAccount(suite.ctx, moduleAcc.GetAddress()).Return(moduleAcc)
}

func (suite *KeeperTestSuite) mockBurnCoins(moduleAcc *authtypes.ModuleAccount) {
Expand Down Expand Up @@ -408,13 +412,6 @@ func (suite *KeeperTestSuite) TestSupply_DelegateUndelegateCoins() {
require := suite.Require()
authKeeper, keeper := suite.authKeeper, suite.bankKeeper

require.NoError(keeper.SetParams(ctx, banktypes.Params{
DefaultSendEnabled: banktypes.DefaultDefaultSendEnabled,
}))

res := keeper.GetParams(ctx)
fmt.Println(res)

// set initial balances
suite.mockMintCoins(mintAcc)
require.NoError(keeper.MintCoins(ctx, banktypes.MintModuleName, initCoins))
Expand Down Expand Up @@ -1702,10 +1699,6 @@ func (suite *KeeperTestSuite) TestDelegateCoins() {
vacc, err := vesting.NewContinuousVestingAccount(acc0, origCoins, ctx.HeaderInfo().Time.Unix(), endTime.Unix())
suite.Require().NoError(err)

suite.Require().NoError(suite.bankKeeper.SetParams(suite.ctx, banktypes.Params{
DefaultSendEnabled: banktypes.DefaultDefaultSendEnabled,
}))

suite.mockFundAccount(accAddrs[0])
require.NoError(banktestutil.FundAccount(ctx, suite.bankKeeper, accAddrs[0], origCoins))

Expand Down Expand Up @@ -1884,10 +1877,6 @@ func (suite *KeeperTestSuite) TestIterateAllDenomMetaData() {
func (suite *KeeperTestSuite) TestBalanceTrackingEvents() {
require := suite.Require()

require.NoError(suite.bankKeeper.SetParams(suite.ctx, banktypes.Params{
DefaultSendEnabled: banktypes.DefaultDefaultSendEnabled,
}))

// mint coins
suite.mockMintCoins(multiPermAcc)
require.NoError(
Expand Down

0 comments on commit e673249

Please sign in to comment.