Skip to content

Commit

Permalink
Handle Zero Amount Coins to Entities (#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
boojamya authored May 24, 2023
1 parent 9e50cfa commit c608331
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion x/tariff/keeper/allocation.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ func (k Keeper) AllocateTokens(ctx sdk.Context) {

for _, s := range entityShare {
truncated, _ := s.TruncateDecimal()
coins = append(coins, truncated)
if truncated.Amount.GT(sdk.ZeroInt()) {
coins = append(coins, truncated)
}
}

if len(coins) == 0 {
continue
}

acc := sdk.MustAccAddressFromBech32(d.Address)
Expand Down

0 comments on commit c608331

Please sign in to comment.