We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4226567 commit b1d61adCopy full SHA for b1d61ad
x/commitment/types/commitments.go
@@ -137,10 +137,7 @@ func (c Commitments) GetCreatorAccount() sdk.AccAddress {
137
}
138
139
func (vesting *VestingTokens) VestedSoFar(ctx sdk.Context) math.Int {
140
- totalBlocks := ctx.BlockHeight() - vesting.StartBlock
141
- if totalBlocks > vesting.NumBlocks {
142
- totalBlocks = vesting.NumBlocks
143
- }
+ totalBlocks := min(ctx.BlockHeight()-vesting.StartBlock, vesting.NumBlocks)
144
return vesting.TotalAmount.Mul(math.NewInt(totalBlocks)).Quo(math.NewInt(vesting.NumBlocks))
145
146
0 commit comments