diff --git a/app/app.go b/app/app.go index 5fae53a359..2a0de41d6a 100644 --- a/app/app.go +++ b/app/app.go @@ -22,6 +22,7 @@ import ( v410 "github.com/desmos-labs/desmos/v4/app/upgrades/v410" v420 "github.com/desmos-labs/desmos/v4/app/upgrades/v420" v430 "github.com/desmos-labs/desmos/v4/app/upgrades/v430" + v441 "github.com/desmos-labs/desmos/v4/app/upgrades/v441" profilesv4 "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v4" @@ -1069,6 +1070,7 @@ func (app *DesmosApp) registerUpgradeHandlers() { app.registerUpgrade(v410.NewUpgrade(app.mm, app.configurator)) app.registerUpgrade(v420.NewUpgrade(app.mm, app.configurator)) app.registerUpgrade(v430.NewUpgrade(app.mm, app.configurator)) + app.registerUpgrade(v441.NewUpgrade(app.mm, app.configurator)) } // registerUpgrade registers the given upgrade to be supported by the app diff --git a/app/upgrades/v441/upgrade.go b/app/upgrades/v441/upgrade.go new file mode 100644 index 0000000000..b1485fb995 --- /dev/null +++ b/app/upgrades/v441/upgrade.go @@ -0,0 +1,46 @@ +package v441 + +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/desmos-labs/desmos/v4/app/upgrades" +) + +var ( + _ upgrades.Upgrade = &Upgrade{} +) + +// Upgrade represents the v4.3.0 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 "v4.4.1" +} + +// Handler implements upgrades.Upgrade +func (u *Upgrade) Handler() upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + // Do nothing here as we don't have anything particular in this update + return u.mm.RunMigrations(ctx, u.configurator, fromVM) + } +} + +// StoreUpgrades implements upgrades.Upgrade +func (u *Upgrade) StoreUpgrades() *storetypes.StoreUpgrades { + return &storetypes.StoreUpgrades{} +}