Skip to content

Commit

Permalink
add upgrade handler
Browse files Browse the repository at this point in the history
  • Loading branch information
GNaD13 committed Sep 21, 2023
1 parent ab47f77 commit 58e41c9
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/upgrades/v5/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ package v5

import (
store "github.com/cosmos/cosmos-sdk/store/types"
ccvconsumertypes "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types"
"github.com/notional-labs/centauri/v5/app/upgrades"
txboundary "github.com/notional-labs/centauri/v5/x/tx-boundary/types"
)

const (
// UpgradeName defines the on-chain upgrade name for the Centauri upgrade.
UpgradeName = "v5"
UpgradeName = "v6"
)

var Upgrade = upgrades.Upgrade{
UpgradeName: UpgradeName,
CreateUpgradeHandler: CreateUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{
Added: []string{txboundary.ModuleName},
Added: []string{ccvconsumertypes.ModuleName},
},
}
20 changes: 20 additions & 0 deletions app/upgrades/v6/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package v5

import (
store "github.com/cosmos/cosmos-sdk/store/types"
"github.com/notional-labs/centauri/v5/app/upgrades"
txboundary "github.com/notional-labs/centauri/v5/x/tx-boundary/types"
)

const (
// UpgradeName defines the on-chain upgrade name for the Centauri upgrade.
UpgradeName = "v6"
)

var Upgrade = upgrades.Upgrade{
UpgradeName: UpgradeName,
CreateUpgradeHandler: CreateUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{
Added: []string{txboundary.ModuleName},
},
}
20 changes: 20 additions & 0 deletions app/upgrades/v6/upgrade.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package v5

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/notional-labs/centauri/v5/app/keepers"
"github.com/notional-labs/centauri/v5/app/upgrades"
)

func CreateUpgradeHandler(
mm *module.Manager,
configurator module.Configurator,
_ upgrades.BaseAppParamManager,
keepers *keepers.AppKeepers,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
return mm.RunMigrations(ctx, configurator, vm)
}
}

0 comments on commit 58e41c9

Please sign in to comment.