Skip to content

Commit

Permalink
Use IsZero instead of Negative
Browse files Browse the repository at this point in the history
  • Loading branch information
trinitys7 committed Aug 23, 2024
1 parent 577a240 commit c87ee8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion x/meshsecurity/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func (k Keeper) setDelegation(ctx sdk.Context, actor, delAddr sdk.AccAddress, va

newDelegation := k.GetDelegation(ctx, actor, delAddr, valAddr)
newDelegation.Amount = newDelegation.Amount.Add(changeAmount)
if !newDelegation.Amount.IsPositive() {
if newDelegation.Amount.IsZero() {
store.Delete(types.BuildDelegationKey(actor, delAddr, valAddr))
return
}
Expand Down

0 comments on commit c87ee8a

Please sign in to comment.