Skip to content

Commit

Permalink
add upgrade handler for 10.4.1 (#290)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajeet97 authored Feb 15, 2024
1 parent e3944a8 commit bcb4936
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ import (

"github.com/persistenceOne/persistenceCore/v10/app/keepers"
"github.com/persistenceOne/persistenceCore/v10/app/upgrades"
v10_4_0 "github.com/persistenceOne/persistenceCore/v10/app/upgrades/v10.4.0"
v10_4_1 "github.com/persistenceOne/persistenceCore/v10/app/upgrades/v10.4.1"
)

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

Expand Down
20 changes: 20 additions & 0 deletions app/upgrades/v10.4.1/constant.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package v10_4_1

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

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

const (
// UpgradeName defines the on-chain upgrade name.
UpgradeName = "v10.4.1"
)

var Upgrade = upgrades.Upgrade{
UpgradeName: UpgradeName,
CreateUpgradeHandler: CreateUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{
Added: []string{},
},
}
17 changes: 17 additions & 0 deletions app/upgrades/v10.4.1/upgrades.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package v10_4_1

import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

"github.com/persistenceOne/persistenceCore/v10/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 upgrade handler")

return args.ModuleManager.RunMigrations(ctx, args.Configurator, vm)
}
}
4 changes: 2 additions & 2 deletions interchaintest/chain_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ func TestPersistenceUpgradeBasic(t *testing.T) {
var (
chainName = "persistence"
upgradeRepo = PersistenceCoreImage.Repository
initialVersion = "v10.3.0"
initialVersion = "v10.4.0"
upgradeBranchVersion = PersistenceCoreImage.Version
upgradeName = "v10.4.0"
upgradeName = "v10.4.1"
)

CosmosChainUpgradeTest(
Expand Down

0 comments on commit bcb4936

Please sign in to comment.