cosmos-sdk/x/staking/module_test.go
Marko 5097b0c226
refactor(test): remove header dependence from tests (#16342)
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
2023-05-31 15:42:23 +00:00

33 lines
944 B
Go

package staking_test
import (
"testing"
"cosmossdk.io/depinject"
"cosmossdk.io/log"
"github.com/stretchr/testify/require"
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
authKeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/cosmos/cosmos-sdk/x/staking/testutil"
"github.com/cosmos/cosmos-sdk/x/staking/types"
)
func TestItCreatesModuleAccountOnInitBlock(t *testing.T) {
var accountKeeper authKeeper.AccountKeeper
app, err := simtestutil.SetupAtGenesis(
depinject.Configs(
testutil.AppConfig,
depinject.Supply(log.NewNopLogger()),
), &accountKeeper)
require.NoError(t, err)
ctx := app.BaseApp.NewContext(false)
acc := accountKeeper.GetAccount(ctx, authtypes.NewModuleAddress(types.BondedPoolName))
require.NotNil(t, acc)
acc = accountKeeper.GetAccount(ctx, authtypes.NewModuleAddress(types.NotBondedPoolName))
require.NotNil(t, acc)
}