diff --git a/app/upgrade.go b/app/upgrade.go index 48185de08..ec66e42c1 100644 --- a/app/upgrade.go +++ b/app/upgrade.go @@ -22,6 +22,7 @@ func (app *App) RegisterUpgradeHandlers(chainID string, serverCfg *serverconfig. // Register the upgrade handlers here app.registerNagquUpgradeHandler() app.registerPampasUpgradeHandler() + app.registerEddystoneUpgradeHandler() // app.register...() // ... return nil @@ -104,3 +105,21 @@ func (app *App) registerPampasUpgradeHandler() { return nil }) } + +func (app *App) registerEddystoneUpgradeHandler() { + // Register the upgrade handler + app.UpgradeKeeper.SetUpgradeHandler(upgradetypes.Eddystone, + func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + app.Logger().Info("upgrade to ", plan.Name) + + return app.mm.RunMigrations(ctx, app.configurator, fromVM) + }) + + // Register the upgrade initializer + app.UpgradeKeeper.SetUpgradeInitializer(upgradetypes.Eddystone, + func() error { + app.Logger().Info("Init Eddystone upgrade") + + return nil + }) +} diff --git a/go.mod b/go.mod index 435b5327c..601cd4a84 100644 --- a/go.mod +++ b/go.mod @@ -180,7 +180,7 @@ replace ( github.com/cometbft/cometbft => github.com/bnb-chain/greenfield-cometbft v1.1.0 github.com/cometbft/cometbft-db => github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.1 github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 - github.com/cosmos/cosmos-sdk => github.com/bnb-chain/greenfield-cosmos-sdk v1.1.0 + github.com/cosmos/cosmos-sdk => github.com/bnb-chain/greenfield-cosmos-sdk v1.0.2-0.20231120082743-8e32ea3e005a github.com/cosmos/iavl => github.com/bnb-chain/greenfield-iavl v0.20.1 github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 github.com/wercker/journalhook => github.com/wercker/journalhook v0.0.0-20230927020745-64542ffa4117 diff --git a/go.sum b/go.sum index 4cc49b288..209b21193 100644 --- a/go.sum +++ b/go.sum @@ -163,8 +163,8 @@ github.com/bnb-chain/greenfield-cometbft v1.1.0 h1:jqnkDWIZW6f/rUn5/pE26YZMT9xzp github.com/bnb-chain/greenfield-cometbft v1.1.0/go.mod h1:NZ2/ZJK2HYe3++0CsPiw4LTG6UrC6pH7fQ3VOz6pqJw= github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.1 h1:XcWulGacHVRiSCx90Q8Y//ajOrLNBQWR/KDB89dy3cU= github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.1/go.mod h1:ey1CiK4bYo1RBNJLRiVbYr5CMdSxci9S/AZRINLtppI= -github.com/bnb-chain/greenfield-cosmos-sdk v1.1.0 h1:hHORuliVfVdkyWmCQ9I5C0pe8zIsgDUmG/IyVudRFe0= -github.com/bnb-chain/greenfield-cosmos-sdk v1.1.0/go.mod h1:Yrvq+J1Lsm7OHFX+M/AZWBTGt1TRHUTC4VYOMlvW3fs= +github.com/bnb-chain/greenfield-cosmos-sdk v1.0.2-0.20231120082743-8e32ea3e005a h1:uqWcS6BKt2RvyFAUIFqGg8iBVEB/DZZfg40/WSdmGTY= +github.com/bnb-chain/greenfield-cosmos-sdk v1.0.2-0.20231120082743-8e32ea3e005a/go.mod h1:Yrvq+J1Lsm7OHFX+M/AZWBTGt1TRHUTC4VYOMlvW3fs= github.com/bnb-chain/greenfield-cosmos-sdk/api v0.0.0-20230816082903-b48770f5e210 h1:GHPbV2bC+gmuO6/sG0Tm8oGal3KKSRlyE+zPscDjlA8= github.com/bnb-chain/greenfield-cosmos-sdk/api v0.0.0-20230816082903-b48770f5e210/go.mod h1:vhsZxXE9tYJeYB5JR4hPhd6Pc/uPf7j1T8IJ7p9FdeM= github.com/bnb-chain/greenfield-cosmos-sdk/math v0.0.0-20230816082903-b48770f5e210 h1:FLVOn4+OVbsKi2+YJX5kmD27/4dRu4FW7xCXFhzDO5s=