Skip to content

Commit

Permalink
fix: LockedCoins for clawback vesting accounts uses legacy DelegatedV…
Browse files Browse the repository at this point in the history
…esting in calculations
  • Loading branch information
Yurist-85 committed Sep 17, 2024
1 parent 9c4e2e5 commit 034d751
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion x/vesting/types/clawback_vesting_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ func (va ClawbackVestingAccount) LockedCoins(blockTime time.Time) sdk.Coins {
//
// Consider that the "DelegatedFree" coins tracked on delegations refer to unvested tokens.
// These "free" (unvested) tokens can be locked up or unlocked
lockedUpVestedDelegatedCoins := va.DelegatedFree.Min(va.GetLockedUpVestedCoins(blockTime))
//
// Hot fix: add DelegatedVesting coins as they were tracked separately before migration to DelegatedFree only.
lockedUpVestedDelegatedCoins := va.DelegatedFree.Add(va.DelegatedVesting...).Min(va.GetLockedUpVestedCoins(blockTime))

res, isNeg := va.OriginalVesting.SafeSub(va.GetUnlockedVestedCoins(blockTime).Add(lockedUpVestedDelegatedCoins...)...)

Expand Down

0 comments on commit 034d751

Please sign in to comment.