-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package v510 | ||
|
||
import ( | ||
store "cosmossdk.io/store/types" | ||
"github.com/OmniFlix/omniflixhub/v5/app/upgrades" | ||
) | ||
|
||
const UpgradeName = "v5.1.0" | ||
|
||
var Upgrade = upgrades.Upgrade{ | ||
UpgradeName: UpgradeName, | ||
CreateUpgradeHandler: CreateV510UpgradeHandler, | ||
StoreUpgrades: store.StoreUpgrades{ | ||
Added: []string{}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package v510 | ||
|
||
import ( | ||
"context" | ||
|
||
upgradetypes "cosmossdk.io/x/upgrade/types" | ||
"github.com/OmniFlix/omniflixhub/v5/app/keepers" | ||
"github.com/OmniFlix/omniflixhub/v5/app/upgrades" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/cosmos/cosmos-sdk/types/module" | ||
) | ||
|
||
func CreateV510UpgradeHandler( | ||
mm *module.Manager, | ||
cfg module.Configurator, | ||
_ upgrades.BaseAppParamManager, | ||
keepers *keepers.AppKeepers, | ||
) upgradetypes.UpgradeHandler { | ||
return func(context context.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { | ||
ctx := sdk.UnwrapSDKContext(context) | ||
// Run migrations before applying any other state changes. | ||
// NOTE: DO NOT PUT ANY STATE CHANGES BEFORE RunMigrations(). | ||
versionMap, err := mm.RunMigrations(ctx, cfg, fromVM) | ||
if err != nil { | ||
return nil, err | ||
} | ||
ctx.Logger().Info("Upgrade complete") | ||
return versionMap, nil | ||
} | ||
} |