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