From c0a88269e99f402fd7183ead1b6f0b1de9082fdf Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 6 Dec 2024 17:46:36 -0500 Subject: [PATCH] Run account plus migration in v8 upgrade (backport #2628) (#2629) Co-authored-by: jayy04 <103467857+jayy04@users.noreply.github.com> --- protocol/app/upgrades.go | 1 + protocol/app/upgrades/v8.0/upgrade.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/protocol/app/upgrades.go b/protocol/app/upgrades.go index 90e4a4d0cc..3f51ccecd7 100644 --- a/protocol/app/upgrades.go +++ b/protocol/app/upgrades.go @@ -33,6 +33,7 @@ func (app *App) setupUpgradeHandlers() { app.PricesKeeper, app.PerpetualsKeeper, app.ClobKeeper, + app.AccountPlusKeeper, ), ) } diff --git a/protocol/app/upgrades/v8.0/upgrade.go b/protocol/app/upgrades/v8.0/upgrade.go index dbce44bb9d..4864a65bce 100644 --- a/protocol/app/upgrades/v8.0/upgrade.go +++ b/protocol/app/upgrades/v8.0/upgrade.go @@ -94,11 +94,14 @@ func CreateUpgradeHandler( pricesKeeper pricestypes.PricesKeeper, perpetualsKeeper perptypes.PerpetualsKeeper, clobKeeper clobtypes.ClobKeeper, + accountplusKeeper accountpluskeeper.Keeper, ) upgradetypes.UpgradeHandler { return func(ctx context.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { sdkCtx := lib.UnwrapSDKContext(ctx, "app/upgrades") sdkCtx.Logger().Info(fmt.Sprintf("Running %s Upgrade...", UpgradeName)) + MigrateAccountplusAccountState(sdkCtx, accountplusKeeper) + // Set market, perpetual, and clob ids to a set number setMarketListingBaseIds(sdkCtx, pricesKeeper, perpetualsKeeper, clobKeeper)