From bf84b223e3a00519b6681062de3fb5bc74db78f5 Mon Sep 17 00:00:00 2001 From: Rayden Ge Date: Thu, 5 Dec 2024 11:25:39 +0100 Subject: [PATCH] fix(staking): add remove old UnbondingID func (#29) --- x/staking/keeper/unbonding.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/x/staking/keeper/unbonding.go b/x/staking/keeper/unbonding.go index 024191727266..19159a662203 100644 --- a/x/staking/keeper/unbonding.go +++ b/x/staking/keeper/unbonding.go @@ -25,6 +25,12 @@ func (k Keeper) GetOldUnbondingID(ctx context.Context) (unbondingID uint64, err return unbondingID, err } +func (k Keeper) RemoveOldUnbondingID(ctx context.Context) error { + store := k.storeService.OpenKVStore(ctx) + // Old UnbondingID used same key as period delegation, which is not used independently. + return store.Delete(types.PeriodDelegationKey) +} + func (k Keeper) GetUnbondingID(ctx context.Context) (unbondingID uint64, err error) { store := k.storeService.OpenKVStore(ctx) bz, err := store.Get(types.UnbondingIDKey)