@0x/contracts-staking: All tests but rewards_test working.

This commit is contained in:
Lawrence Forman
2019-09-19 03:05:06 -04:00
committed by Lawrence Forman
parent 54ac1c284b
commit b43fa88606
20 changed files with 628 additions and 414 deletions

View File

@@ -94,7 +94,10 @@ export function assertRoughlyEquals(actual: Numberish, expected: Numberish, prec
* Asserts that two numbers are equal with up to `maxError` difference between them.
*/
export function assertIntegerRoughlyEquals(actual: Numberish, expected: Numberish, maxError: number = 1): void {
const diff = new BigNumber(actual).minus(expected).abs().toNumber();
const diff = new BigNumber(actual)
.minus(expected)
.abs()
.toNumber();
if (diff <= maxError) {
return;
}