Skip to content

Commit

Permalink
split ExportGenesis into two functions to maintain backwards compatib…
Browse files Browse the repository at this point in the history
…ility (#339)
  • Loading branch information
nicolaslara authored and julienrbrt committed Oct 4, 2022
1 parent c388798 commit b7fbe42
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion simapp/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func (app *SimApp) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAd
app.prepForZeroHeightGenesis(ctx, jailAllowedAddrs)
}

genState := app.ModuleManager.ExportGenesis(ctx, app.appCodec, modulesToExport)
genState := app.mm.ExportGenesisForModules(ctx, app.appCodec, modulesToExport)
appState, err := json.MarshalIndent(genState, "", " ")
if err != nil {
return servertypes.ExportedApp{}, err
Expand Down
7 changes: 6 additions & 1 deletion types/module/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,12 @@ func (m *Manager) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, genesisData
}

// ExportGenesis performs export genesis functionality for modules
func (m *Manager) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec, modulesToExport []string) map[string]json.RawMessage {
func (m *Manager) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) map[string]json.RawMessage {
return m.ExportGenesisForModules(ctx, cdc, []string{})
}

// ExportGenesisForModules performs export genesis functionality for modules
func (m *Manager) ExportGenesisForModules(ctx sdk.Context, cdc codec.JSONCodec, modulesToExport []string) map[string]json.RawMessage {
genesisData := make(map[string]json.RawMessage)
if len(modulesToExport) == 0 {
for _, moduleName := range m.OrderExportGenesis {
Expand Down

0 comments on commit b7fbe42

Please sign in to comment.