Skip to content

Commit

Permalink
[Data]: Commitment module fix (#723)
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
amityadav0 authored Aug 15, 2024
1 parent ac72db4 commit 5583131
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions x/commitment/migrations/v4_migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ func (m Migrator) V4Migration(ctx sdk.Context) error {

commitments = m.keeper.GetAllCommitments(ctx)
for _, c := range commitments {
// claim >= vestedSoFar fix
for _, vesting := range c.VestingTokens {
vestedSoFar := vesting.VestedSoFar(ctx)
if vesting.ClaimedAmount.GT(vestedSoFar) {
vesting.ClaimedAmount = vestedSoFar
}
}

newCommittedTokens := []*types.CommittedTokens{}
for _, commitmentToken := range c.CommittedTokens {
if commitmentToken.Amount.GT(sdk.ZeroInt()) {
Expand Down

0 comments on commit 5583131

Please sign in to comment.