livepeer / protocol

Livepeer protocol
MIT License
154 stars 45 forks source link

add post LIP-36 integration test #400

Closed kyriediculous closed 4 years ago

kyriediculous commented 4 years ago

What does this pull request do? Explain your changes. (required) Completes test/integration/Earnings.js with post LIP-36 cases

Specific updates (required)

Alternatives Keep acceptable delta in the tests at 0.001 but change the MathUtils.sol , PERC_DIVISOR to 1*10^9 This affects other contracts that use MathUtils though

How did you test each of these updates (required) Ran tests

Added console log statements to cumulativeEarningsAndCheck function to see that the delta doesn't exceed the maximum I anticipated (0.005)

        console.log("actualTranscoderRewardShare", transcoderRewardShare.toString())
        console.log("expTranscoderRewardShare", expTranscoderRewardShare.toString())
        console.log("reward delta", transcoderRewardShare.sub(expTranscoderRewardShare).abs().toString())
        console.log("actualTranscoderFeeShare", transcoderFeeShare.toString())
        console.log("expTranscoderFeeShare", expTranscoderFeeShare.toString())
        console.log("fee delta", transcoderFeeShare.sub(expTranscoderFeeShare).abs().toString())
        console.log("\n")

Does this pull request close any open issues?

coveralls commented 4 years ago

Pull Request Test Coverage Report for Build 6fa9190f-03a1-4748-b629-ed2518b1df62


Totals Coverage Status
Change from base Build d3c57f16-2339-45eb-81ea-de8ce2d8ec08: 0.0%
Covered Lines: 745
Relevant Lines: 746

đź’› - Coveralls
yondonfu commented 4 years ago

Incorporated these changes with a few small tweaks discussed offline in fcedeac