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:
@@ -1,16 +1,10 @@
|
||||
import { IAssetDataContract } from '@0x/contracts-asset-proxy';
|
||||
import { DummyERC721TokenContract } from '@0x/contracts-erc721';
|
||||
import { ForwarderContract } from '@0x/contracts-exchange-forwarder';
|
||||
import {
|
||||
blockchainTests,
|
||||
constants,
|
||||
getLatestBlockTimestampAsync,
|
||||
hexConcat,
|
||||
toBaseUnitAmount,
|
||||
} from '@0x/contracts-test-utils';
|
||||
import { blockchainTests, constants, getLatestBlockTimestampAsync, toBaseUnitAmount } from '@0x/contracts-test-utils';
|
||||
import { generatePseudoRandomSalt } from '@0x/order-utils';
|
||||
import { SignatureType, SignedOrder } from '@0x/types';
|
||||
import { AbiEncoder, BigNumber, ExchangeForwarderRevertErrors } from '@0x/utils';
|
||||
import { AbiEncoder, BigNumber, ExchangeForwarderRevertErrors, hexUtils } from '@0x/utils';
|
||||
|
||||
import { deployEth2DaiBridgeAsync } from '../bridges/deploy_eth2dai_bridge';
|
||||
import { deployUniswapBridgeAsync } from '../bridges/deploy_uniswap_bridge';
|
||||
@@ -111,7 +105,7 @@ blockchainTests.resets('Forwarder <> ERC20Bridge integration tests', env => {
|
||||
takerFeeAssetData: wethAssetData,
|
||||
expirationTimeSeconds: new BigNumber(currentBlockTimestamp).plus(fifteenMinutesInSeconds),
|
||||
salt: generatePseudoRandomSalt(),
|
||||
signature: hexConcat(SignatureType.Wallet),
|
||||
signature: hexUtils.concat(SignatureType.Wallet),
|
||||
};
|
||||
eth2DaiBridgeOrder = {
|
||||
...orderDefaults,
|
||||
|
@@ -1,16 +1,8 @@
|
||||
import { IAssetDataContract } from '@0x/contracts-asset-proxy';
|
||||
import { ForwarderContract } from '@0x/contracts-exchange-forwarder';
|
||||
import {
|
||||
constants,
|
||||
expect,
|
||||
getPercentageOfValue,
|
||||
hexSlice,
|
||||
Numberish,
|
||||
OrderStatus,
|
||||
provider,
|
||||
} from '@0x/contracts-test-utils';
|
||||
import { constants, expect, getPercentageOfValue, Numberish, OrderStatus, provider } from '@0x/contracts-test-utils';
|
||||
import { AssetProxyId, OrderInfo, SignedOrder } from '@0x/types';
|
||||
import { BigNumber, RevertError } from '@0x/utils';
|
||||
import { BigNumber, hexUtils, RevertError } from '@0x/utils';
|
||||
import { TransactionReceiptWithDecodedLogs } from 'ethereum-types';
|
||||
|
||||
import { FeeRecipient } from '../framework/actors/fee_recipient';
|
||||
@@ -37,8 +29,8 @@ interface MarketBuyOptions extends MarketSellOptions {
|
||||
}
|
||||
|
||||
function areUnderlyingAssetsEqual(assetData1: string, assetData2: string): boolean {
|
||||
const assetProxyId1 = hexSlice(assetData1, 0, 4);
|
||||
const assetProxyId2 = hexSlice(assetData2, 0, 4);
|
||||
const assetProxyId1 = hexUtils.slice(assetData1, 0, 4);
|
||||
const assetProxyId2 = hexUtils.slice(assetData2, 0, 4);
|
||||
if (
|
||||
(assetProxyId1 === AssetProxyId.ERC20 || assetProxyId1 === AssetProxyId.ERC20Bridge) &&
|
||||
(assetProxyId2 === AssetProxyId.ERC20 || assetProxyId2 === AssetProxyId.ERC20Bridge)
|
||||
|
Reference in New Issue
Block a user