cosmos-sdk/x/gov/module_test.go

29 lines
724 B
Go
Raw Normal View History

package gov_test
import (
"testing"
"github.com/stretchr/testify/require"
2020-06-13 02:07:51 -07:00
abcitypes "github.com/tendermint/tendermint/abci/types"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
"github.com/cosmos/cosmos-sdk/simapp"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
2020-06-13 02:07:51 -07:00
"github.com/cosmos/cosmos-sdk/x/gov/types"
)
func TestItCreatesModuleAccountOnInitBlock(t *testing.T) {
app := simapp.Setup(false)
ctx := app.BaseApp.NewContext(false, tmproto.Header{})
app.InitChain(
2020-06-13 02:07:51 -07:00
abcitypes.RequestInitChain{
AppStateBytes: []byte("{}"),
ChainId: "test-chain-id",
},
)
acc := app.AccountKeeper.GetAccount(ctx, authtypes.NewModuleAddress(types.ModuleName))
require.NotNil(t, acc)
}