Skip to content

Commit

Permalink
feat(upgrade): retrieve old sweep value and set new
Browse files Browse the repository at this point in the history
  • Loading branch information
jdubpark committed Sep 9, 2024
1 parent b8c5aaf commit 46223f1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions client/app/upgrades/v0_10_0/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,16 @@ func CreateUpgradeHandler(
}

clog.Info(ctx, "Setting NextValidatorDelegationSweepIndex parameter...")
if err := keepers.EvmStakingKeeper.SetNextValidatorDelegationSweepIndex(
nextValIndex, err := keepers.EvmStakingKeeper.GetOldValidatorSweepIndex(ctx)
if err != nil {
return vm, errors.Wrap(err, "get old validator sweep index")
}

nextValDelIndex := sdk.IntProto{Int: math.NewInt(0)}
if err := keepers.EvmStakingKeeper.SetValidatorSweepIndex(
ctx,
sdk.IntProto{Int: math.NewInt(0)},
nextValIndex,
nextValDelIndex,
); err != nil {
return vm, errors.Wrap(err, "set evmstaking NextValidatorDelegationSweepIndex")
}
Expand Down

0 comments on commit 46223f1

Please sign in to comment.