2020-03-05 13:11:05 -08:00
|
|
|
package staking_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
"github.com/tendermint/tendermint/abci/types"
|
|
|
|
|
|
|
|
"github.com/cosmos/cosmos-sdk/simapp"
|
2020-04-20 12:32:10 -07:00
|
|
|
"github.com/cosmos/cosmos-sdk/x/auth"
|
2020-04-20 08:22:12 -07:00
|
|
|
"github.com/cosmos/cosmos-sdk/x/staking"
|
2020-03-05 13:11:05 -08:00
|
|
|
)
|
|
|
|
|
|
|
|
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",
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
2020-04-20 12:32:10 -07:00
|
|
|
acc := app.AccountKeeper.GetAccount(ctx, auth.NewModuleAddress(staking.BondedPoolName))
|
2020-03-05 13:11:05 -08:00
|
|
|
require.NotNil(t, acc)
|
|
|
|
|
2020-04-20 12:32:10 -07:00
|
|
|
acc = app.AccountKeeper.GetAccount(ctx, auth.NewModuleAddress(staking.NotBondedPoolName))
|
2020-03-05 13:11:05 -08:00
|
|
|
require.NotNil(t, acc)
|
|
|
|
}
|