Skip to content

Commit

Permalink
feat: code for v11.9.0 (#322)
Browse files Browse the repository at this point in the history
code for v11.9.0
  • Loading branch information
puneet2019 authored Apr 9, 2024
1 parent 1d7e21b commit 436921c
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ import (

"github.com/persistenceOne/persistenceCore/v11/app/keepers"
"github.com/persistenceOne/persistenceCore/v11/app/upgrades"
"github.com/persistenceOne/persistenceCore/v11/app/upgrades/testnet/v11.9.0-rc0"
"github.com/persistenceOne/persistenceCore/v11/app/upgrades/v11.9.0"
"github.com/persistenceOne/persistenceCore/v11/client/docs"
)

var (
DefaultNodeHome string
Upgrades = []upgrades.Upgrade{v11_9_0_rc0.Upgrade}
Upgrades = []upgrades.Upgrade{v11_9_0.Upgrade}
ModuleBasics = module.NewBasicManager(keepers.AppModuleBasics...)
)

Expand Down
18 changes: 18 additions & 0 deletions app/upgrades/v11.9.0/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package v11_9_0

import (
store "github.com/cosmos/cosmos-sdk/store/types"

"github.com/persistenceOne/persistenceCore/v11/app/upgrades"
)

const (
// UpgradeName defines the on-chain upgrade name.
UpgradeName = "v11.9.0"
)

var Upgrade = upgrades.Upgrade{
UpgradeName: UpgradeName,
CreateUpgradeHandler: CreateUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{},
}
24 changes: 24 additions & 0 deletions app/upgrades/v11.9.0/upgrades.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package v11_9_0

import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/types"

"github.com/persistenceOne/persistenceCore/v11/app/upgrades"
)

func CreateUpgradeHandler(args upgrades.UpgradeHandlerArgs) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
ctx.Logger().Info("running module migrations...")

// register param subspace in order to migrate from this legacy params.
subspace, ok := args.Keepers.ParamsKeeper.GetSubspace(packetforwardtypes.ModuleName)
if ok && !subspace.HasKeyTable() {
subspace.WithKeyTable(packetforwardtypes.ParamKeyTable())
}

return args.ModuleManager.RunMigrations(ctx, args.Configurator, vm)
}
}
2 changes: 1 addition & 1 deletion interchaintest/chain_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func TestPersistenceUpgradeBasic(t *testing.T) {
var (
chainName = "persistence"
initialVersion = "v11.8.1"
upgradeName = "v11.9.0-rc0"
upgradeName = "v11.9.0"
upgradeRepo = PersistenceCoreImage.Repository
upgradeBranchVersion = PersistenceCoreImage.Version
)
Expand Down

0 comments on commit 436921c

Please sign in to comment.