Skip to content

Commit

Permalink
i need sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
sontrinh16 committed Aug 4, 2024
1 parent 90bbaef commit efd6d89
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
1 change: 0 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,6 @@ func (app OnomyApp) GetBaseApp() *baseapp.BaseApp { return app.BaseApp }
func (app *OnomyApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock {
for _, fork := range Forks {
if ctx.BlockHeight() == fork.UpgradeHeight {
ctx.Logger().Info("running fork name %s", fork.UpgradeName)
fork.BeginForkLogic(ctx)
}
}
Expand Down
15 changes: 0 additions & 15 deletions app/upgrades/v1.1.5-fix/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,20 @@ func CreateFork(
if len(consumerChainIDS) == 0 {
break
}
valsetUpdateID := pk.GetValidatorSetUpdateId(ctx)

fmt.Println("consumer chain", consumerChainIDS, valsetUpdateID)

// Add to indexes
for _, consumerChainID := range consumerChainIDS {
ubdOpIds := pk.GetAllUnbondingOpIndexes(ctx, consumerChainID)
for _, ubdIds := range ubdOpIds {
fmt.Println("old", ubdIds)

newIds := []uint64{}

for _, ubdId := range ubdIds.UnbondingOpIds {
fmt.Println("should", ubdId, id)
if ubdId == id {
ctx.Logger().Info(fmt.Sprintf("filter out id %d", ubdId))
continue
}

newIds = append(newIds, ubdId)
}

fmt.Println("new", newIds)

// filter out invalid ID
pk.SetUnbondingOpIndex(ctx, consumerChainID, ubdIds.VscId, newIds)
}
Expand All @@ -64,17 +54,13 @@ func CreateFork(
_, found := pk.GetUnbondingOp(ctx, id)
if found {
pk.DeleteUnbondingOp(ctx, id)
ctx.Logger().Info(fmt.Sprintf("delete id %d", id))
}
}

// clear invalid mature ubd entries
ids := []uint64{}
for _, id := range pk.GetMaturedUnbondingOps(ctx) {
fmt.Println("should true", slices.Contains(targetIds, id))

if slices.Contains(targetIds, id) {
ctx.Logger().Info(fmt.Sprintf("filter matured id %d", id))
continue
}

Expand All @@ -94,7 +80,6 @@ func CreateFork(
// update mature ubd ids
store := ctx.KVStore(providerStoreKey)
store.Set(ibcprovidertypes.MaturedUnbondingOpsKey(), bz)
ctx.Logger().Info(fmt.Sprint("updated matured ids"))
}
return upgrades.Fork{
UpgradeName: Name,
Expand Down

0 comments on commit efd6d89

Please sign in to comment.