Skip to content

Commit

Permalink
chore: added more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
troykessler committed May 7, 2024
1 parent 426e4a9 commit bc9ebeb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/upgrades/v1_5/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ func CreateUpgradeHandler(mm *module.Manager, configurator module.Configurator,

// TODO: migrate delegation outstanding rewards

// TODO: migrate network fee and whitelist weights

return mm.RunMigrations(ctx, configurator, fromVM)
}
}
Expand Down
5 changes: 4 additions & 1 deletion x/bundles/keeper/logic_bundles.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,10 @@ func (k Keeper) calculatePayouts(ctx sdk.Context, poolId uint64, totalPayout sdk

// subtract storage cost from remaining total payout. We split the storage cost between all coins and charge
// the amount per coin. If there is not enough of that coin available we simply charge what is left, so there
// can be the case that the storageRewards are less than what we actually wanted to pay out.
// can be the case that the storageRewards are less than what we actually wanted to pay out. This is acceptable
// because this case is very rare, usually the minFundingAmount ensures that there are always enough funds left
// of each coin, and in the case there are not enough the coins are removed and therefore for the next bundle
// we split between the other remaining coins.
whitelist := k.fundersKeeper.GetCoinWhitelistMap(ctx)
wantedStorageRewards := sdk.NewCoins()
storageCostPerCoin := k.GetStorageCost(ctx, bundleProposal.StorageProviderId).MulInt64(int64(bundleProposal.DataSize)).QuoInt64(int64(totalPayout.Len()))
Expand Down

0 comments on commit bc9ebeb

Please sign in to comment.