From 46223f1dfb36d236c83c447f8cc4ed94c5d4720e Mon Sep 17 00:00:00 2001 From: Jongwon Park Date: Mon, 9 Sep 2024 11:08:14 -0500 Subject: [PATCH] feat(upgrade): retrieve old sweep value and set new --- client/app/upgrades/v0_10_0/upgrades.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/client/app/upgrades/v0_10_0/upgrades.go b/client/app/upgrades/v0_10_0/upgrades.go index b8e7b3ad..6a2f94f7 100644 --- a/client/app/upgrades/v0_10_0/upgrades.go +++ b/client/app/upgrades/v0_10_0/upgrades.go @@ -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") }