github.com/cosmos/cosmos-sdk@v0.50.10/x/staking/module_test.go (about) 1 package staking_test 2 3 import ( 4 "testing" 5 6 "github.com/stretchr/testify/require" 7 8 "cosmossdk.io/depinject" 9 "cosmossdk.io/log" 10 11 simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" 12 authKeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" 13 authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" 14 "github.com/cosmos/cosmos-sdk/x/staking/testutil" 15 "github.com/cosmos/cosmos-sdk/x/staking/types" 16 ) 17 18 func TestItCreatesModuleAccountOnInitBlock(t *testing.T) { 19 var accountKeeper authKeeper.AccountKeeper 20 app, err := simtestutil.SetupAtGenesis( 21 depinject.Configs( 22 testutil.AppConfig, 23 depinject.Supply(log.NewNopLogger()), 24 ), &accountKeeper) 25 require.NoError(t, err) 26 27 ctx := app.BaseApp.NewContext(false) 28 acc := accountKeeper.GetAccount(ctx, authtypes.NewModuleAddress(types.BondedPoolName)) 29 require.NotNil(t, acc) 30 31 acc = accountKeeper.GetAccount(ctx, authtypes.NewModuleAddress(types.NotBondedPoolName)) 32 require.NotNil(t, acc) 33 }