rip staking_wrapper.ts, use wrapped staking proxy pattern instead

This commit is contained in:
Michael Zhu
2019-09-04 18:12:12 -07:00
parent c21bce9641
commit 6d83b2676e
17 changed files with 694 additions and 1041 deletions

View File

@@ -1,5 +1,6 @@
import { expect } from '@0x/contracts-test-utils';
import { BigNumber } from '@0x/utils';
import { Web3Wrapper } from '@0x/web3-wrapper';
import * as crypto from 'crypto';
import { Decimal } from 'decimal.js';
@@ -90,3 +91,13 @@ export function assertRoughlyEquals(actual: Numberish, expected: Numberish, prec
}
expect(actual).to.bignumber.eq(expected);
}
/**
* Converts `amount` into a base unit amount with 18 digits.
*/
export function toBaseUnitAmount(amount: Numberish): BigNumber {
const decimals = 18;
const amountAsBigNumber = new BigNumber(amount);
const baseUnitAmount = Web3Wrapper.toBaseUnitAmount(amountAsBigNumber, decimals);
return baseUnitAmount;
}