Skip to content

Commit

Permalink
ibc upgrade migration
Browse files Browse the repository at this point in the history
  • Loading branch information
mikluke committed Nov 26, 2023
1 parent 4559a5f commit 2db7362
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"os"
"path/filepath"

ibc07tendermint13 "github.com/Decentr-net/decentr/app/upgrade/07tendermint13"
v160 "github.com/Decentr-net/decentr/app/upgrade/v160"
v163 "github.com/Decentr-net/decentr/app/upgrade/v163"
"github.com/cosmos/cosmos-sdk/baseapp"
Expand Down Expand Up @@ -555,6 +556,7 @@ func New(

app.UpgradeKeeper.SetUpgradeHandler(v160.Name, v160.Handler(app.configurator, app.mm))
app.UpgradeKeeper.SetUpgradeHandler(v163.Name, v160.Handler(app.configurator, app.mm))
app.UpgradeKeeper.SetUpgradeHandler(ibc07tendermint13.Name, ibc07tendermint13.Handler(app.configurator, app.mm))

upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk()
if err != nil {
Expand Down
3 changes: 2 additions & 1 deletion app/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ func (app *App) ExportAppStateAndValidators(

// prepare for fresh start at zero height
// NOTE zero height genesis is a temporary feature which will be deprecated
// in favour of export at a block height
//
// in favour of export at a block height
func (app *App) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []string) {
applyAllowedAddrs := false

Expand Down
18 changes: 18 additions & 0 deletions app/upgrade/07tendermint13/handler.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package ibc07tendermint13

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

const Name = "07-tendermint-13"

func Handler(
cfg module.Configurator,
mm *module.Manager,
) func(ctx sdk.Context, _ upgrade.Plan, _ module.VersionMap) (module.VersionMap, error) {
return func(ctx sdk.Context, _ upgrade.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
return mm.RunMigrations(ctx, cfg, fromVM)
}
}

0 comments on commit 2db7362

Please sign in to comment.