Skip to content

Commit

Permalink
fix(staking): add remove old UnbondingID func (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
ezreal1997 authored Dec 5, 2024
1 parent b7c7e97 commit bf84b22
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions x/staking/keeper/unbonding.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit bf84b22

Please sign in to comment.