Skip to content

Commit

Permalink
do not return error when decreasing shares
Browse files Browse the repository at this point in the history
  • Loading branch information
stana-miric committed Dec 4, 2024
1 parent 61dbfc5 commit e87c800
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions x/staking/keeper/slash.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,20 +404,14 @@ func (k Keeper) SlashRedelegation(ctx context.Context, srcValidator types.Valida

// if the delegator holds a validator bond to destination validator, decrease the destination validator bond shares
if delegation.ValidatorBond {
if err := k.SafelyDecreaseValidatorBond(ctx, valDstAddr, sharesToUnbond); err != nil {
return math.ZeroInt(), err
}
k.SafelyDecreaseValidatorBond(ctx, valDstAddr, sharesToUnbond)
}

// if this delegation is from a liquid staking provider (identified if the delegator
// is an ICA account), the global and validator liquid totals should be decremented
if k.DelegatorIsLiquidStaker(delegatorAddress) {
if err := k.DecreaseTotalLiquidStakedTokens(ctx, tokensToBurn); err != nil {
return math.ZeroInt(), err
}
if _, err := k.DecreaseValidatorLiquidShares(ctx, valDstAddr, sharesToUnbond); err != nil {
return math.ZeroInt(), err
}
k.DecreaseTotalLiquidStakedTokens(ctx, tokensToBurn)
k.DecreaseValidatorLiquidShares(ctx, valDstAddr, sharesToUnbond)
}

// tokens of a redelegation currently live in the destination validator
Expand Down

0 comments on commit e87c800

Please sign in to comment.