Skip to content

Commit

Permalink
Roll moneta-alpha and moneta-beta into a single upgrade handler (#105)
Browse files Browse the repository at this point in the history
* Roll moneta-alpha and moneta-beta into a single upgrade handler

* Also apply upgradehandler name change to upgradeinfo check
  • Loading branch information
the-frey authored Dec 1, 2021
1 parent 7f555bf commit fa88eb0
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ func New(
panic(err)
}

if upgradeInfo.Name == "moneta-alpha" && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) {
if upgradeInfo.Name == "moneta" && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) {
storeUpgrades := store.StoreUpgrades{
Added: []string{authz.ModuleName, feegrant.ModuleName, wasm.ModuleName},
}
Expand Down Expand Up @@ -705,11 +705,7 @@ func (app *App) RegisterTendermintService(clientCtx client.Context) {

// RegisterUpgradeHandlers returns upgrade handlers
func (app *App) RegisterUpgradeHandlers(cfg module.Configurator) {
app.UpgradeKeeper.SetUpgradeHandler("moneta-alpha", func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
return app.mm.RunMigrations(ctx, cfg, vm)
})

app.UpgradeKeeper.SetUpgradeHandler("moneta-beta", func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
app.UpgradeKeeper.SetUpgradeHandler("moneta", func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
// force an update of validator min commission
validators := app.StakingKeeper.GetAllValidators(ctx)
// hard code this because we don't want
Expand Down

0 comments on commit fa88eb0

Please sign in to comment.