Skip to content

Commit

Permalink
AddCommittedToken was edited to avoid amount duplicate on Lockup
Browse files Browse the repository at this point in the history
  • Loading branch information
fenriz07 committed Apr 30, 2024
1 parent 62db5c6 commit cc08f6c
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions x/commitment/types/commitments.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,6 @@ func (c *Commitments) AddCommittedTokens(denom string, amount math.Int, unlockTi
Amount: amount,
UnlockTimestamp: unlockTime,
})

li := int(0)
for _, lockup := range token.Lockups {
if lockup.UnlockTimestamp < unlockTime {
li++
continue
} else if lockup.UnlockTimestamp == unlockTime {
return
} else {
break
}
}
c.CommittedTokens[i].Lockups = append(token.Lockups[:li+1], token.Lockups[li:]...)
c.CommittedTokens[i].Lockups[li] = Lockup{
Amount: amount,
UnlockTimestamp: unlockTime,
}
return
}
}
Expand Down

0 comments on commit cc08f6c

Please sign in to comment.