Skip to content

Commit

Permalink
comment
Browse files Browse the repository at this point in the history
  • Loading branch information
lumtis committed Apr 21, 2022
1 parent ab2b0da commit 87a9215
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions x/campaign/simulation/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,11 @@ func GetAccountWithVouchers(
bk.IterateAccountBalances(ctx, accountAddr, func(coin sdk.Coin) bool {
coinCampID, err := types.VoucherCampaign(coin.Denom)
if err == nil && coinCampID == campID {
// retain a random portion of the balance in the range [0, coin.Amount)
retainAmt := sdk.NewInt(r.Int63n(coin.Amount.Int64()))
coin.Amount = coin.Amount.Sub(retainAmt)
coins = append(coins, coin)
// fetch a part of each voucher hold by the account
amt, err := simtypes.RandPositiveInt(r, coin.Amount)
if err == nil {
coins = append(coins, sdk.NewCoin(coin.Denom, amt))
}
}
return false
})
Expand Down

0 comments on commit 87a9215

Please sign in to comment.