From db542cfd708352bd41c7ec6c619b41c89595da39 Mon Sep 17 00:00:00 2001 From: Randy Grok Date: Wed, 14 Aug 2024 01:44:41 +0200 Subject: [PATCH] remove option to export certain modules only --- runtime/v2/builder.go | 2 +- runtime/v2/manager.go | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/runtime/v2/builder.go b/runtime/v2/builder.go index 39031bbc830d..578cd9934a6e 100644 --- a/runtime/v2/builder.go +++ b/runtime/v2/builder.go @@ -176,7 +176,7 @@ func (a *AppBuilder[T]) Build(opts ...AppBuilderOption[T]) (*App[T], error) { return nil }, ExportGenesis: func(ctx context.Context, version uint64) ([]byte, error) { - genesisJson, err := a.app.moduleManager.ExportGenesisForModules(ctx) // TODO: add option to export certain modules? + genesisJson, err := a.app.moduleManager.ExportGenesisForModules(ctx) if err != nil { return nil, fmt.Errorf("failed to export genesis: %w", err) } diff --git a/runtime/v2/manager.go b/runtime/v2/manager.go index 289357b24e92..b3f95a6c9be4 100644 --- a/runtime/v2/manager.go +++ b/runtime/v2/manager.go @@ -193,11 +193,9 @@ func (m *MM[T]) InitGenesisJSON( // ExportGenesisForModules performs export genesis functionality for modules func (m *MM[T]) ExportGenesisForModules( ctx context.Context, - modulesToExport ...string, ) (map[string]json.RawMessage, error) { - if len(modulesToExport) == 0 { - modulesToExport = m.config.ExportGenesis - } + modulesToExport := m.config.ExportGenesis + // verify modules exists in app, so that we don't panic in the middle of an export if err := m.checkModulesExists(modulesToExport); err != nil { return nil, err