From 944340bbbad7da8ee48b623655d9dd626866031b Mon Sep 17 00:00:00 2001 From: Xianny <8582774+xianny@users.noreply.github.com> Date: Wed, 4 Dec 2019 13:08:08 -0800 Subject: [PATCH] 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 --- test/order_prune_utils_test.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/test/order_prune_utils_test.ts b/test/order_prune_utils_test.ts index dea927eaf6..5bf26004e6 100644 --- a/test/order_prune_utils_test.ts +++ b/test/order_prune_utils_test.ts @@ -3,7 +3,6 @@ import { DevUtilsContract, ERC20TokenContract, ExchangeContract } from '@0x/cont import { constants as devConstants, getLatestBlockTimestampAsync, OrderFactory } from '@0x/contracts-test-utils'; import { BlockchainLifecycle, tokenUtils } from '@0x/dev-utils'; import { migrateOnceAsync } from '@0x/migrations'; -import { assetDataUtils } from '@0x/order-utils'; import { SignedOrder } from '@0x/types'; import { BigNumber } from '@0x/utils'; import * as chai from 'chai'; @@ -70,13 +69,15 @@ describe('OrderPruner', () => { [makerTokenAddress, takerTokenAddress] = tokenUtils.getDummyERC20TokenAddresses(); erc20MakerTokenContract = new ERC20TokenContract(makerTokenAddress, provider); erc20TakerTokenContract = new ERC20TokenContract(takerTokenAddress, provider); - [makerAssetData, takerAssetData, wethAssetData] = [ - assetDataUtils.encodeERC20AssetData(makerTokenAddress), - assetDataUtils.encodeERC20AssetData(takerTokenAddress), - assetDataUtils.encodeERC20AssetData(contractAddresses.etherToken), - ]; exchangeContract = new ExchangeContract(contractAddresses.exchange, provider); devUtilsContract = new DevUtilsContract(contractAddresses.devUtils, provider); + + [makerAssetData, takerAssetData, wethAssetData] = [ + await devUtilsContract.encodeERC20AssetData(makerTokenAddress).callAsync(), + await devUtilsContract.encodeERC20AssetData(takerTokenAddress).callAsync(), + await devUtilsContract.encodeERC20AssetData(contractAddresses.etherToken).callAsync(), + ]; + // Configure order defaults const defaultOrderParams = { ...devConstants.STATIC_ORDER_PARAMS,