cosmos-sdk/x/staking/module_test.go

32 lines
751 B
Go

package staking_test
import (
"testing"
"github.com/cosmos/cosmos-sdk/x/staking"
"github.com/stretchr/testify/require"
"github.com/tendermint/tendermint/abci/types"
"github.com/cosmos/cosmos-sdk/simapp"
"github.com/cosmos/cosmos-sdk/x/supply"
)
func TestItCreatesModuleAccountOnInitBlock(t *testing.T) {
app := simapp.Setup(false)
ctx := app.BaseApp.NewContext(false, types.Header{})
app.InitChain(
types.RequestInitChain{
AppStateBytes: []byte("{}"),
ChainId: "test-chain-id",
},
)
acc := app.AccountKeeper.GetAccount(ctx, supply.NewModuleAddress(staking.BondedPoolName))
require.NotNil(t, acc)
acc = app.AccountKeeper.GetAccount(ctx, supply.NewModuleAddress(staking.NotBondedPoolName))
require.NotNil(t, acc)
}