Skip to content

Commit

Permalink
format export
Browse files Browse the repository at this point in the history
  • Loading branch information
avery committed Dec 17, 2024
1 parent 37ff0fe commit 980d8c4
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions app/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ func (app *IrisApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [
return false
},
)
if err != nil {
panic(err)
}

// reinitialize all delegations
for _, del := range dels {
Expand All @@ -176,7 +179,7 @@ func (app *IrisApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [
/* Handle staking state. */

// iterate through redelegations, reset creation height
app.StakingKeeper.IterateRedelegations(ctx, func(_ int64, red stakingtypes.Redelegation) (stop bool) {
err = app.StakingKeeper.IterateRedelegations(ctx, func(_ int64, red stakingtypes.Redelegation) (stop bool) {
for i := range red.Entries {
red.Entries[i].CreationHeight = 0
}
Expand All @@ -186,6 +189,9 @@ func (app *IrisApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [
}
return false
})
if err != nil {
panic(err)
}

// iterate through unbonding delegations, reset creation height
app.StakingKeeper.IterateUnbondingDelegations(ctx, func(_ int64, ubd stakingtypes.UnbondingDelegation) (stop bool) {
Expand Down Expand Up @@ -217,7 +223,10 @@ func (app *IrisApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [
validator.Jailed = true
}

app.StakingKeeper.SetValidator(ctx, validator)
err = app.StakingKeeper.SetValidator(ctx, validator)
if err != nil {
panic(err)
}
counter++
}

Expand Down

0 comments on commit 980d8c4

Please sign in to comment.