Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

Commit

Permalink
Remove assetDataUtils everywhere (#2373)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
xianny authored Dec 4, 2019
1 parent c534c0e commit 944340b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions test/order_prune_utils_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 944340b

Please sign in to comment.