diff --git a/types/module/module.go b/types/module/module.go index 37f1bf97f..9b8dde314 100644 --- a/types/module/module.go +++ b/types/module/module.go @@ -298,10 +298,12 @@ func (m *Manager) RegisterServices(cfg Configurator) { // InitGenesis performs init genesis functionality for modules func (m *Manager) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, genesisData map[string]json.RawMessage) abci.ResponseInitChain { var validatorUpdates []abci.ValidatorUpdate + ctx.Logger().Info("initializing blockchain state from genesis.json") for _, moduleName := range m.OrderInitGenesis { if genesisData[moduleName] == nil { continue } + ctx.Logger().Debug("running initialization for module", "module", moduleName) moduleValUpdates := m.Modules[moduleName].InitGenesis(ctx, cdc, genesisData[moduleName]) diff --git a/types/module/module_test.go b/types/module/module_test.go index 4f2dcdeed..37fedd9d6 100644 --- a/types/module/module_test.go +++ b/types/module/module_test.go @@ -12,6 +12,8 @@ import ( "github.com/spf13/cobra" "github.com/stretchr/testify/require" abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/libs/log" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" @@ -200,7 +202,7 @@ func TestManager_InitGenesis(t *testing.T) { require.NotNil(t, mm) require.Equal(t, 2, len(mm.Modules)) - ctx := sdk.Context{} + ctx := sdk.NewContext(nil, tmproto.Header{}, false, log.NewNopLogger()) interfaceRegistry := types.NewInterfaceRegistry() cdc := codec.NewProtoCodec(interfaceRegistry) genesisData := map[string]json.RawMessage{"module1": json.RawMessage(`{"key": "value"}`)}