Remove assetDataUtils everywhere (#2373)

* remove assetDataUtils everywhere

* export IAssetDataContract from @0x/contract-wrappers to allow @0x/instant to decode asset data  synchronously

* export generic function `decodeAssetDataOrThrow` and add ERC20Bridge support

* export `hexUtils` from order-utils instead of contracts-test-utils
This commit is contained in:
Xianny
2019-12-04 13:08:08 -08:00
committed by GitHub
parent b86d19028c
commit fcbcbac889
70 changed files with 1498 additions and 1129 deletions

View File

@@ -1,5 +1,5 @@
import { blockchainTests, expect, hexRandom, Numberish } from '@0x/contracts-test-utils';
import { BigNumber, FixedMathRevertErrors } from '@0x/utils';
import { blockchainTests, expect, Numberish } from '@0x/contracts-test-utils';
import { BigNumber, FixedMathRevertErrors, hexUtils } from '@0x/utils';
import { Decimal } from 'decimal.js';
import * as _ from 'lodash';
@@ -803,7 +803,7 @@ blockchainTests('LibFixedMath unit tests', env => {
function getRandomDecimal(min: Numberish, max: Numberish): BigNumber {
const range = new BigNumber(max).minus(min);
const random = fromFixed(new BigNumber(hexRandom().substr(2), 16));
const random = fromFixed(new BigNumber(hexUtils.random().substr(2), 16));
return random.mod(range).plus(min);
}