Skip to content

Commit

Permalink
only migrate packetforward subspace
Browse files Browse the repository at this point in the history
  • Loading branch information
Reecepbcups committed Oct 27, 2023
1 parent b88eb00 commit 0f2fa62
Showing 1 changed file with 5 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,13 @@ 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.
for _, subspace := range paramskeeper.GetSubspaces() {
subspace := subspace

var keyTable paramstypes.KeyTable
// switch subspace.Name() {
// case packetforwardtypes.ModuleName:
// keyTable = packetforwardtypes.ParamKeyTable()
// }

if subspace.Name() == packetforwardtypes.ModuleName {
keyTable = packetforwardtypes.ParamKeyTable()
}

if !subspace.HasKeyTable() {
subspace.WithKeyTable(keyTable)
}
p, ok := paramskeeper.GetSubspace(packetforwardtypes.ModuleName)
if !ok {
panic("paramskeeper does not have packetforward subspace")
}

p.WithKeyTable(packetforwardtypes.ParamKeyTable())

// 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.
baseAppLegacySS := paramskeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramstypes.ConsensusParamsKeyTable())
Expand Down

0 comments on commit 0f2fa62

Please sign in to comment.