From 4bb90bd88e0e65f70a114d8e9d3d5dd6418e9ec5 Mon Sep 17 00:00:00 2001 From: jayy04 <103467857+jayy04@users.noreply.github.com> Date: Fri, 6 Dec 2024 17:18:31 -0500 Subject: [PATCH] Run account plus migration in v8 upgrade (#2628) (cherry picked from commit a957b13cf4b0bfdef1425be2bb6708d45152ea0e) --- 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 90e4a4d0cc3..3f51ccecd7c 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 dbce44bb9d1..4864a65bceb 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)