Skip to content

Commit

Permalink
fix: genesis on migrations (#17679)
Browse files Browse the repository at this point in the history
  • Loading branch information
tac0turtle committed Sep 11, 2023
1 parent 91fad07 commit 5eaa7b8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions types/module/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -694,12 +694,11 @@ func (m Manager) RunMigrations(ctx context.Context, cfg Configurator, fromVM Ver
}
} else {
sdkCtx.Logger().Info(fmt.Sprintf("adding a new module: %s", moduleName))
module1, ok := m.Modules[moduleName].(HasGenesis)
if ok {
module1.InitGenesis(sdkCtx, c.cdc, module1.DefaultGenesis(c.cdc))
if module, ok := m.Modules[moduleName].(HasGenesis); ok {
module.InitGenesis(sdkCtx, c.cdc, module.DefaultGenesis(c.cdc))
}
if module2, ok := m.Modules[moduleName].(HasABCIGenesis); ok {
moduleValUpdates := module2.InitGenesis(sdkCtx, c.cdc, module1.DefaultGenesis(c.cdc))
if module, ok := m.Modules[moduleName].(HasABCIGenesis); ok {
moduleValUpdates := module.InitGenesis(sdkCtx, c.cdc, module.DefaultGenesis(c.cdc))
// The module manager assumes only one module will update the
// validator set, and it can't be a new module.
if len(moduleValUpdates) > 0 {
Expand Down

0 comments on commit 5eaa7b8

Please sign in to comment.