2020-03-05 13:11:05 -08:00
|
|
|
package distribution_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/require"
|
2020-06-14 04:01:47 -07:00
|
|
|
abcitypes "github.com/tendermint/tendermint/abci/types"
|
2020-03-20 10:14:14 -07:00
|
|
|
|
|
|
|
"github.com/cosmos/cosmos-sdk/simapp"
|
2020-06-17 11:42:27 -07:00
|
|
|
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
2020-06-14 04:01:47 -07:00
|
|
|
"github.com/cosmos/cosmos-sdk/x/distribution/types"
|
2020-03-05 13:11:05 -08:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestItCreatesModuleAccountOnInitBlock(t *testing.T) {
|
|
|
|
app := simapp.Setup(false)
|
2020-06-14 04:01:47 -07:00
|
|
|
ctx := app.BaseApp.NewContext(false, abcitypes.Header{})
|
2020-03-05 13:11:05 -08:00
|
|
|
|
|
|
|
app.InitChain(
|
2020-06-14 04:01:47 -07:00
|
|
|
abcitypes.RequestInitChain{
|
2020-03-05 13:11:05 -08:00
|
|
|
AppStateBytes: []byte("{}"),
|
|
|
|
ChainId: "test-chain-id",
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
2020-06-17 11:42:27 -07:00
|
|
|
acc := app.AccountKeeper.GetAccount(ctx, authtypes.NewModuleAddress(types.ModuleName))
|
2020-03-05 13:11:05 -08:00
|
|
|
require.NotNil(t, acc)
|
|
|
|
}
|