From 8aee4c234b39bd5b8d3fb937b5e01a28c3cd5c78 Mon Sep 17 00:00:00 2001 From: marston Date: Wed, 15 May 2024 11:29:38 -0400 Subject: [PATCH] adding upgrade handler for alpha3 --- app/upgrades.go | 2 ++ app/upgrades/v4alpha3/upgrades.go | 44 +++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 app/upgrades/v4alpha3/upgrades.go diff --git a/app/upgrades.go b/app/upgrades.go index b9c15e3b..fe919ba3 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -12,6 +12,7 @@ import ( v3 "github.com/jackalLabs/canine-chain/v3/app/upgrades/v3" v4 "github.com/jackalLabs/canine-chain/v3/app/upgrades/v4" "github.com/jackalLabs/canine-chain/v3/app/upgrades/v4alpha1" + "github.com/jackalLabs/canine-chain/v3/app/upgrades/v4alpha3" ) func (app *JackalApp) registerTestnetUpgradeHandlers() { @@ -22,6 +23,7 @@ func (app *JackalApp) registerTestnetUpgradeHandlers() { app.registerUpgrade(v121.NewUpgrade(app.mm, app.configurator)) app.registerUpgrade(v4alpha1.NewUpgrade(app.mm, app.configurator)) + app.registerUpgrade(v4alpha3.NewUpgrade(app.mm, app.configurator)) } func (app *JackalApp) registerMainnetUpgradeHandlers() { diff --git a/app/upgrades/v4alpha3/upgrades.go b/app/upgrades/v4alpha3/upgrades.go new file mode 100644 index 00000000..15640620 --- /dev/null +++ b/app/upgrades/v4alpha3/upgrades.go @@ -0,0 +1,44 @@ +package v4alpha3 + +import ( + storetypes "github.com/cosmos/cosmos-sdk/store/types" + 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/jackalLabs/canine-chain/v3/app/upgrades" +) + +var _ upgrades.Upgrade = &Upgrade{} + +type Upgrade struct { + mm *module.Manager + configurator module.Configurator +} + +// NewUpgrade returns a new Upgrade instance +func NewUpgrade(mm *module.Manager, configurator module.Configurator) *Upgrade { + return &Upgrade{ + mm: mm, + configurator: configurator, + } +} + +// Name implements upgrades.Upgrade +func (u *Upgrade) Name() string { + return "4alpha3" +} + +// Handler implements upgrades.Upgrade +func (u *Upgrade) Handler() upgradetypes.UpgradeHandler { + return func(_ sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + return fromVM, nil + } +} + +// StoreUpgrades implements upgrades.Upgrade +func (u *Upgrade) StoreUpgrades() *storetypes.StoreUpgrades { + return &storetypes.StoreUpgrades{ + Added: []string{}, + Deleted: []string{}, + } +}