Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: call SetOrderExportGenesis from SimApp #12048

Merged
merged 6 commits into from
May 25, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
182 changes: 159 additions & 23 deletions api/cosmos/app/runtime/v1alpha1/module.pulsar.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/cosmos/base/abci/v1beta1/abci.pulsar.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions proto/cosmos/app/runtime/v1alpha1/module.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,8 @@ message Module {
// to call in the order in which they should be called. If this is left empty
// no init genesis function will be registered.
repeated string init_genesis = 4;

// export_genesis specifies the order in which to export module genesis data.
// If this is left empty no module genesis data will be exported.
repeated string export_genesis = 5;
kocubinski marked this conversation as resolved.
Show resolved Hide resolved
}
4 changes: 4 additions & 0 deletions runtime/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ func (a *App) Load(loadLatest bool) error {
a.SetInitChainer(a.InitChainer)
}

if len(a.config.ExportGenesis) != 0 {
a.ModuleManager.SetOrderExportGenesis(a.config.ExportGenesis...)
aaronc marked this conversation as resolved.
Show resolved Hide resolved
}

if len(a.config.BeginBlockers) != 0 {
a.ModuleManager.SetOrderBeginBlockers(a.config.BeginBlockers...)
a.SetBeginBlocker(a.BeginBlocker)
Expand Down
16 changes: 8 additions & 8 deletions simapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ func NewSimApp(

app.GovKeeper = *govKeeper.SetHooks(
govtypes.NewMultiGovHooks(
// register the governance hooks
// register the governance hooks
),
)
// set the governance module account as the authority for conducting upgrades
Expand Down Expand Up @@ -383,13 +383,13 @@ func NewSimApp(
// NOTE: Capability module must occur first so that it can initialize any capabilities
// so that other modules that want to create or claim capabilities afterwards in InitChain
// can do so safely.
app.ModuleManager.SetOrderInitGenesis(
capabilitytypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName, distrtypes.ModuleName, stakingtypes.ModuleName,
slashingtypes.ModuleName, govtypes.ModuleName, minttypes.ModuleName, crisistypes.ModuleName,
genutiltypes.ModuleName, evidencetypes.ModuleName, authz.ModuleName,
feegrant.ModuleName, nft.ModuleName, group.ModuleName,
paramstypes.ModuleName, upgradetypes.ModuleName, vestingtypes.ModuleName,
)
genesisModuleOrder := []string{capabilitytypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName,
distrtypes.ModuleName, stakingtypes.ModuleName, slashingtypes.ModuleName, govtypes.ModuleName,
minttypes.ModuleName, crisistypes.ModuleName, genutiltypes.ModuleName, evidencetypes.ModuleName, authz.ModuleName,
feegrant.ModuleName, nft.ModuleName, group.ModuleName, paramstypes.ModuleName, upgradetypes.ModuleName,
vestingtypes.ModuleName}
app.ModuleManager.SetOrderInitGenesis(genesisModuleOrder...)
app.ModuleManager.SetOrderExportGenesis(genesisModuleOrder...)

// Uncomment if you want to set a custom migration order here.
// app.mm.SetOrderMigrations(custom order)
Expand Down
2 changes: 1 addition & 1 deletion types/abci.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.