Skip to content

Commit

Permalink
chore: set test emergency group in the upgrade handler (#2229)
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-zaremba authored Sep 6, 2023
1 parent b0ab4c4 commit 3b6408e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (

"github.com/umee-network/umee/v6/app/upgradev3"
"github.com/umee-network/umee/v6/app/upgradev3x3"
"github.com/umee-network/umee/v6/util"
"github.com/umee-network/umee/v6/x/incentive"
leveragekeeper "github.com/umee-network/umee/v6/x/leverage/keeper"
leveragetypes "github.com/umee-network/umee/v6/x/leverage/types"
Expand Down Expand Up @@ -61,14 +62,17 @@ func (app UmeeApp) RegisterUpgradeHandlers() {
func (app *UmeeApp) registerUpgrade6(upgradeInfo upgradetypes.Plan) {
planName := "v6.0"
gravityModuleName := "gravity" // hardcoded to avoid dependency on GB module
// TODO: update the address for the mainnet
emergencyGroup, err := sdk.AccAddressFromBech32("umee178nsnzse8capyfak4nwlntvfg64p4lmsau4t5n")
util.Panic(err)

app.UpgradeKeeper.SetUpgradeHandler(planName,
func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
ctx.Logger().Info("-----------------------------\n---------------")
if err := app.LeverageKeeper.SetParams(ctx, leveragetypes.DefaultParams()); err != nil {
return fromVM, err
}
// TODO: need to register emergency group
app.UGovKeeperB.Keeper(&ctx).SetEmergencyGroup(emergencyGroup)

return app.mm.RunMigrations(ctx, app.configurator, fromVM)
},
Expand Down

0 comments on commit 3b6408e

Please sign in to comment.