Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Service Provider rewards math (#887)
* more accurately name our rounding routine * remove math from test code Break out calculating rewards for a single service provider. This means in a test when we only care about a single sp, we can find that record and get all of the rewards from it without having to do any math. So the math can not differ from prod. * Add real world tests from a failed run * rename variable now that we're dealing with bones through the pipeline Previously, half the values were representing DC, and the other half Bones. You cannot take percentages of one unit from another unit when they are scaled differently. Early on, we convert dc -> bones, then calculate percentages based off those numbers. dc_perc has been renamed to data_perc because it is the percentage of rewards that is allocated because of data transfer. Rounding now uses the floor function provided by rust_decimal. * remove unused function we no longer need to know the rewards_per_share, because we are not doinga share type algorithm for computing rewards. We get percentages of a whole, which has the same effect as multipling shares by a fraction of reward units. * now is not the time to change how the rounding is done * use correct variable for max amount of bones allocated for reward period
- Loading branch information