Skip to content

Commit

Permalink
skip other keytables
Browse files Browse the repository at this point in the history
  • Loading branch information
Reecepbcups committed Oct 27, 2023
1 parent 0f2fa62 commit 5830c7e
Showing 1 changed file with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,20 @@ func CreateV2UpgradeHandler(
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
// NOTE: If you already migrated the previous module, you ONLY need to migrate packetforward case now.
p, ok := paramskeeper.GetSubspace(packetforwardtypes.ModuleName)
if !ok {
panic("paramskeeper does not have packetforward subspace")
}
for _, subspace := range paramskeeper.GetSubspaces() {
subspace := subspace

var keyTable paramstypes.KeyTable
if subspace.Name() == packetforwardtypes.ModuleName {
keyTable = packetforwardtypes.ParamKeyTable()
} else {
continue
}

p.WithKeyTable(packetforwardtypes.ParamKeyTable())
if !subspace.HasKeyTable() {
subspace.WithKeyTable(keyTable)
}
}

// Migrate Tendermint consensus parameters from x/params module to a deprecated x/consensus module.
// The old params module is required to still be imported in your app.go in order to handle this migration.
Expand Down

0 comments on commit 5830c7e

Please sign in to comment.