diff --git a/app/setup_handlers.go b/app/setup_handlers.go index 0774288ac..60d86d8ed 100644 --- a/app/setup_handlers.go +++ b/app/setup_handlers.go @@ -3,16 +3,11 @@ package app import ( "fmt" - "cosmossdk.io/math" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" m "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/version" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - tiermoduletypes "github.com/elys-network/elys/x/tier/types" ) func SetupHandlers(app *ElysApp) { @@ -27,35 +22,6 @@ func setUpgradeHandler(app *ElysApp) { func(ctx sdk.Context, plan upgradetypes.Plan, vm m.VersionMap) (m.VersionMap, error) { app.Logger().Info("Running upgrade handler for " + version.Version) - if version.Version == "v0.32.0" || version.Version == "v999.999.999" { - // Since invariant is broken sending missing amount to bonded pool - sumOfValTokens := math.ZeroInt() - app.EstakingKeeper.IterateBondedValidatorsByPower(ctx, func(_ int64, validator stakingtypes.ValidatorI) bool { - sumOfValTokens = sumOfValTokens.Add(validator.GetTokens()) - return false - }) - - totalBondedTokens := app.EstakingKeeper.TotalBondedTokens(ctx) - if totalBondedTokens.LT(sumOfValTokens) { - missingAmount := sumOfValTokens.Sub(totalBondedTokens) - missingCoins := sdk.Coins{sdk.NewCoin("uelys", missingAmount)} - err := app.BankKeeper.MintCoins(ctx, minttypes.ModuleName, missingCoins) - if err != nil { - panic(err) - } - err = app.BankKeeper.SendCoinsFromModuleToModule(ctx, minttypes.ModuleName, stakingtypes.BondedPoolName, missingCoins) - if err != nil { - panic(err) - } - } - - app.Logger().Info("Deleting proposals with ID <= 193") - store := ctx.KVStore(app.keys[govtypes.StoreKey]) - for i := uint64(1); i <= 193; i++ { - store.Delete(govtypes.ProposalKey(i)) - } - } - return app.mm.RunMigrations(ctx, app.configurator, vm) }, ) @@ -71,7 +37,8 @@ func loadUpgradeStore(app *ElysApp) { if shouldLoadUpgradeStore(app, upgradeInfo) { storeUpgrades := storetypes.StoreUpgrades{ - Added: []string{tiermoduletypes.StoreKey}, + // Added: []string{}, + // Deleted: []string{}, } fmt.Printf("Setting store loader with height %d and store upgrades: %+v\n", upgradeInfo.Height, storeUpgrades)