Skip to content

Commit

Permalink
create a new chain upgrade handler for chain upgrade.
Browse files Browse the repository at this point in the history
  • Loading branch information
RustNinja committed Mar 7, 2024
1 parent 35247a7 commit fcdbe5d
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
"github.com/cosmos/cosmos-sdk/x/bank"

"github.com/notional-labs/composable/v6/app/keepers"
"github.com/notional-labs/composable/v6/app/upgrades/v6_4_6"
"github.com/notional-labs/composable/v6/app/upgrades/v6_4_7"

// bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"

Expand Down Expand Up @@ -147,7 +147,7 @@ var (
// https://github.com/CosmWasm/wasmd/blob/02a54d33ff2c064f3539ae12d75d027d9c665f05/x/wasm/internal/types/proposal.go#L28-L34
EnableSpecificProposals = ""

Upgrades = []upgrades.Upgrade{v6_4_6.Upgrade}
Upgrades = []upgrades.Upgrade{v6_4_7.Upgrade}
Forks = []upgrades.Fork{}
)

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

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

"github.com/notional-labs/composable/v6/app/upgrades"
)

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

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

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/cosmos/cosmos-sdk/codec"
"github.com/notional-labs/composable/v6/app/keepers"
"github.com/notional-labs/composable/v6/app/upgrades"
)

func CreateUpgradeHandler(
mm *module.Manager,
configurator module.Configurator,
_ upgrades.BaseAppParamManager,
_ codec.Codec,
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 fcdbe5d

Please sign in to comment.