Skip to content

Commit

Permalink
fix: base chain oracle status (#853)
Browse files Browse the repository at this point in the history
  • Loading branch information
zakir-code authored Dec 31, 2024
1 parent a2d557a commit 11ab2b1
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions app/upgrades/v8/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (
fxevmkeeper "github.com/pundiai/fx-core/v8/x/evm/keeper"
"github.com/pundiai/fx-core/v8/x/gov/keeper"
fxgovv8 "github.com/pundiai/fx-core/v8/x/gov/migrations/v8"
layer2types "github.com/pundiai/fx-core/v8/x/layer2/types"
fxstakingv8 "github.com/pundiai/fx-core/v8/x/staking/migrations/v8"
)

Expand Down Expand Up @@ -94,6 +95,8 @@ func CreateUpgradeHandler(cdc codec.Codec, mm *module.Manager, configurator modu
return fromVM, err
}

fixBaseOracleStatus(cacheCtx, app.CrosschainKeepers.Layer2Keeper)

commit()
cacheCtx.Logger().Info("upgrade complete", "module", "upgrade")
return toVM, nil
Expand Down Expand Up @@ -301,3 +304,17 @@ func deployAccessControlContract(
getContractOwner(cacheCtx),
)
}

func fixBaseOracleStatus(ctx sdk.Context, crosschainKeeper crosschainkeeper.Keeper) {
if crosschainKeeper.ModuleName() != layer2types.ModuleName {
return
}
oracles := crosschainKeeper.GetAllOracles(ctx, false)
for _, oracle := range oracles {
oracle.Online = true
oracle.SlashTimes = 0
oracle.StartHeight = ctx.BlockHeight()
crosschainKeeper.SetOracle(ctx, oracle)
}
crosschainKeeper.SetLastTotalPower(ctx)
}

0 comments on commit 11ab2b1

Please sign in to comment.