Skip to content

Commit e192a5f

Browse files
authored
resetting accounted pool (#1334)
1 parent baaa79e commit e192a5f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

app/setup_handlers.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package app
22

33
import (
44
"context"
5+
"errors"
56
"fmt"
67
"strings"
78

@@ -66,6 +67,18 @@ func (app *ElysApp) setUpgradeHandler() {
6667

6768
app.OracleKeeper.EndBlock(ctx)
6869

70+
allPerpetualPools := app.PerpetualKeeper.GetAllPools(ctx)
71+
for _, pool := range allPerpetualPools {
72+
ammPool, found := app.AmmKeeper.GetPool(ctx, pool.AmmPoolId)
73+
if !found {
74+
return vm, errors.New("amm pool not found during migration")
75+
}
76+
err := app.AccountedPoolKeeper.PerpetualUpdates(ctx, ammPool, pool)
77+
if err != nil {
78+
return vm, err
79+
}
80+
}
81+
6982
//oracleParams := app.OracleKeeper.GetParams(ctx)
7083
//if len(oracleParams.MandatoryList) == 0 {
7184
// err := app.ojoOracleMigration(ctx, plan.Height+1)

0 commit comments

Comments
 (0)