2020-03-05 13:11:05 -08:00
|
|
|
package auth_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/require"
|
2020-06-17 11:42:27 -07:00
|
|
|
abcitypes "github.com/tendermint/tendermint/abci/types"
|
2020-08-14 10:58:53 -07:00
|
|
|
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
|
2020-03-05 13:11:05 -08:00
|
|
|
|
|
|
|
"github.com/cosmos/cosmos-sdk/simapp"
|
2020-06-17 11:42:27 -07:00
|
|
|
"github.com/cosmos/cosmos-sdk/x/auth/types"
|
2020-03-05 13:11:05 -08:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestItCreatesModuleAccountOnInitBlock(t *testing.T) {
|
|
|
|
app := simapp.Setup(false)
|
2020-08-14 10:58:53 -07:00
|
|
|
ctx := app.BaseApp.NewContext(false, tmproto.Header{})
|
2020-03-05 13:11:05 -08:00
|
|
|
|
|
|
|
app.InitChain(
|
2020-06-17 11:42:27 -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, types.NewModuleAddress(types.FeeCollectorName))
|
2020-03-05 13:11:05 -08:00
|
|
|
require.NotNil(t, acc)
|
|
|
|
}
|