Skip to content

Commit

Permalink
- add upgrade handler
Browse files Browse the repository at this point in the history
  • Loading branch information
StrathCole committed Sep 24, 2024
1 parent 07b1fba commit 9597a27
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ import (
v8 "github.com/classic-terra/core/v3/app/upgrades/v8"
v8_1 "github.com/classic-terra/core/v3/app/upgrades/v8_1"
v8_2 "github.com/classic-terra/core/v3/app/upgrades/v8_2"
v8_3 "github.com/classic-terra/core/v3/app/upgrades/v8_3"

customante "github.com/classic-terra/core/v3/custom/auth/ante"
custompost "github.com/classic-terra/core/v3/custom/auth/post"
Expand Down Expand Up @@ -89,6 +90,7 @@ var (
v8.Upgrade,
v8_1.Upgrade,
v8_2.Upgrade,
v8_3.Upgrade,
}

// Forks defines forks to be applied to the network
Expand Down
13 changes: 13 additions & 0 deletions app/upgrades/v8_3/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//nolint:revive
package v8_3

import (
"github.com/classic-terra/core/v3/app/upgrades"
)

const UpgradeName = "v8_3"

var Upgrade = upgrades.Upgrade{
UpgradeName: UpgradeName,
CreateUpgradeHandler: CreateV83UpgradeHandler,
}
21 changes: 21 additions & 0 deletions app/upgrades/v8_3/upgrades.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//nolint:revive
package v8_3

import (
"github.com/classic-terra/core/v3/app/keepers"
"github.com/classic-terra/core/v3/app/upgrades"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
)

func CreateV83UpgradeHandler(
mm *module.Manager,
cfg module.Configurator,
_ upgrades.BaseAppParamManager,
keepers *keepers.AppKeepers,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
return mm.RunMigrations(ctx, cfg, fromVM)
}
}

0 comments on commit 9597a27

Please sign in to comment.