diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-07-18 21:48:23 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-07-18 22:31:17 +0800 |
commit | a1acf19ff3c1948214dde05a91eb3fbeac728d2c (patch) | |
tree | 44789fff181ec24846728d885ba541c23f682321 | |
parent | 5044fe4fe4486f67408572cf6807482aecf7f6c9 (diff) | |
download | dexon-sol-tools-a1acf19ff3c1948214dde05a91eb3fbeac728d2c.tar dexon-sol-tools-a1acf19ff3c1948214dde05a91eb3fbeac728d2c.tar.gz dexon-sol-tools-a1acf19ff3c1948214dde05a91eb3fbeac728d2c.tar.bz2 dexon-sol-tools-a1acf19ff3c1948214dde05a91eb3fbeac728d2c.tar.lz dexon-sol-tools-a1acf19ff3c1948214dde05a91eb3fbeac728d2c.tar.xz dexon-sol-tools-a1acf19ff3c1948214dde05a91eb3fbeac728d2c.tar.zst dexon-sol-tools-a1acf19ff3c1948214dde05a91eb3fbeac728d2c.zip |
Fix a bad merge
17 files changed, 100 insertions, 50 deletions
diff --git a/packages/0x.js/src/artifacts/ZRXToken.json b/packages/0x.js/src/artifacts/ZRXToken.json index 0c7d547eb..0ce91c1c1 100644 --- a/packages/0x.js/src/artifacts/ZRXToken.json +++ b/packages/0x.js/src/artifacts/ZRXToken.json @@ -10021,5 +10021,11 @@ } } }, - "networks": {} + "networks": { + "50": { + "address": "0x871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c", + "links": {}, + "constructorArgs": "[]" + } + } }
\ No newline at end of file diff --git a/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts index b5ea56789..3e7619228 100644 --- a/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts +++ b/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts @@ -1,5 +1,5 @@ import { schemas } from '@0xproject/json-schemas'; -import { assetProxyUtils } from '@0xproject/order-utils'; +import { assetDataUtils } from '@0xproject/order-utils'; import { AssetProxyId, Order, SignedOrder } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; @@ -1074,7 +1074,7 @@ export class ExchangeWrapper extends ContractWrapper { */ public getZRXAssetData(): string { const zrxTokenAddress = this.getZRXTokenAddress(); - const zrxAssetData = assetProxyUtils.encodeERC20AssetData(zrxTokenAddress); + const zrxAssetData = assetDataUtils.encodeERC20AssetData(zrxTokenAddress); return zrxAssetData; } // tslint:disable:no-unused-variable diff --git a/packages/fill-scenarios/src/fill_scenarios.ts b/packages/fill-scenarios/src/fill_scenarios.ts index 8294657e7..8f2766e24 100644 --- a/packages/fill-scenarios/src/fill_scenarios.ts +++ b/packages/fill-scenarios/src/fill_scenarios.ts @@ -1,4 +1,4 @@ -import { assetProxyUtils, orderFactory } from '@0xproject/order-utils'; +import { assetDataUtils, orderFactory } from '@0xproject/order-utils'; import { AssetProxyId, ERC721AssetData, OrderWithoutExchangeAddress, SignedOrder } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; @@ -12,13 +12,13 @@ import { DummyERC721TokenContract } from './generated_contract_wrappers/dummy_er import { ExchangeContract } from './generated_contract_wrappers/exchange'; export class FillScenarios { - private _web3Wrapper: Web3Wrapper; - private _userAddresses: string[]; - private _coinbase: string; - private _zrxTokenAddress: string; - private _exchangeAddress: string; - private _erc20ProxyAddress: string; - private _erc721ProxyAddress: string; + private readonly _web3Wrapper: Web3Wrapper; + private readonly _userAddresses: string[]; + private readonly _coinbase: string; + private readonly _zrxTokenAddress: string; + private readonly _exchangeAddress: string; + private readonly _erc20ProxyAddress: string; + private readonly _erc721ProxyAddress: string; constructor( provider: Provider, userAddresses: string[], @@ -151,7 +151,7 @@ export class FillScenarios { feeRecepientAddress: string, expirationTimeSeconds?: BigNumber, ): Promise<SignedOrder> { - const decodedMakerAssetData = assetProxyUtils.decodeAssetDataOrThrow(makerAssetData); + const decodedMakerAssetData = assetDataUtils.decodeAssetDataOrThrow(makerAssetData); if (decodedMakerAssetData.assetProxyId === AssetProxyId.ERC20) { await this._increaseERC20BalanceAndAllowanceAsync( decodedMakerAssetData.tokenAddress, @@ -165,10 +165,11 @@ export class FillScenarios { await this._increaseERC721BalanceAndAllowanceAsync( decodedMakerAssetData.tokenAddress, makerAddress, + // tslint:disable-next-line:no-unnecessary-type-assertion (decodedMakerAssetData as ERC721AssetData).tokenId, ); } - const decodedTakerAssetData = assetProxyUtils.decodeAssetDataOrThrow(takerAssetData); + const decodedTakerAssetData = assetDataUtils.decodeAssetDataOrThrow(takerAssetData); if (decodedTakerAssetData.assetProxyId === AssetProxyId.ERC20) { const takerTokenAddress = decodedTakerAssetData.tokenAddress; await this._increaseERC20BalanceAndAllowanceAsync(takerTokenAddress, takerAddress, takerFillableAmount); @@ -179,6 +180,7 @@ export class FillScenarios { await this._increaseERC721BalanceAndAllowanceAsync( decodedTakerAssetData.tokenAddress, takerAddress, + // tslint:disable-next-line:no-unnecessary-type-assertion (decodedMakerAssetData as ERC721AssetData).tokenId, ); } diff --git a/packages/migrations/artifacts/2.0.0/AssetProxyOwner.json b/packages/migrations/artifacts/2.0.0/AssetProxyOwner.json index f00f47779..80751855b 100644 --- a/packages/migrations/artifacts/2.0.0/AssetProxyOwner.json +++ b/packages/migrations/artifacts/2.0.0/AssetProxyOwner.json @@ -44468,5 +44468,11 @@ } } }, - "networks": {} + "networks": { + "50": { + "address": "0x34d402f14d58e001d8efbe6585051bf9706aa064", + "links": {}, + "constructorArgs": "[[\"0x5409ed021d9299bf6814279a6a1411a7e866a631\",\"0x6ecbe1db9ef729cbe972c83fb886247691fb6beb\"],[\"0x1dc4c1cefef38a777b15aa20260a54e584b16c48\",\"0x1d7022f5b17d2f8b695918fb48fa1089c9f85401\"],\"2\",\"0\"]" + } + } }
\ No newline at end of file diff --git a/packages/migrations/artifacts/2.0.0/ERC20Proxy.json b/packages/migrations/artifacts/2.0.0/ERC20Proxy.json index 82175bfb4..ed755fbed 100644 --- a/packages/migrations/artifacts/2.0.0/ERC20Proxy.json +++ b/packages/migrations/artifacts/2.0.0/ERC20Proxy.json @@ -252,5 +252,11 @@ } } }, - "networks": {} + "networks": { + "50": { + "address": "0x1dc4c1cefef38a777b15aa20260a54e584b16c48", + "links": {}, + "constructorArgs": "[]" + } + } }
\ No newline at end of file diff --git a/packages/migrations/artifacts/2.0.0/ERC721Proxy.json b/packages/migrations/artifacts/2.0.0/ERC721Proxy.json index 0784a9c52..5b6e68dfa 100644 --- a/packages/migrations/artifacts/2.0.0/ERC721Proxy.json +++ b/packages/migrations/artifacts/2.0.0/ERC721Proxy.json @@ -252,5 +252,11 @@ } } }, - "networks": {} + "networks": { + "50": { + "address": "0x1d7022f5b17d2f8b695918fb48fa1089c9f85401", + "links": {}, + "constructorArgs": "[]" + } + } }
\ No newline at end of file diff --git a/packages/migrations/artifacts/2.0.0/Exchange.json b/packages/migrations/artifacts/2.0.0/Exchange.json index 41926ec88..3add148b5 100644 --- a/packages/migrations/artifacts/2.0.0/Exchange.json +++ b/packages/migrations/artifacts/2.0.0/Exchange.json @@ -2148,5 +2148,11 @@ } } }, - "networks": {} + "networks": { + "50": { + "address": "0x48bacb9266a570d521063ef5dd96e61686dbe788", + "links": {}, + "constructorArgs": "[\"0xf47261b0000000000000000000000000871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c\"]" + } + } }
\ No newline at end of file diff --git a/packages/migrations/artifacts/2.0.0/Forwarder.json b/packages/migrations/artifacts/2.0.0/Forwarder.json index f4267ad94..479f9d2eb 100644 --- a/packages/migrations/artifacts/2.0.0/Forwarder.json +++ b/packages/migrations/artifacts/2.0.0/Forwarder.json @@ -892,5 +892,11 @@ } } }, - "networks": {} + "networks": { + "50": { + "address": "0xb69e673309512a9d726f87304c6984054f87a93b", + "links": {}, + "constructorArgs": "[\"0x48bacb9266a570d521063ef5dd96e61686dbe788\",\"0x0b1ba0af832d7c05fd64161e0db78e85978e8082\",\"0x871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c\",\"0xf47261b0000000000000000000000000871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c\",\"0xf47261b00000000000000000000000000b1ba0af832d7c05fd64161e0db78e85978e8082\"]" + } + } }
\ No newline at end of file diff --git a/packages/migrations/artifacts/2.0.0/WETH9.json b/packages/migrations/artifacts/2.0.0/WETH9.json index 56479981f..9c2c79938 100644 --- a/packages/migrations/artifacts/2.0.0/WETH9.json +++ b/packages/migrations/artifacts/2.0.0/WETH9.json @@ -326,5 +326,11 @@ } } }, - "networks": {} + "networks": { + "50": { + "address": "0x0b1ba0af832d7c05fd64161e0db78e85978e8082", + "links": {}, + "constructorArgs": "[]" + } + } }
\ No newline at end of file diff --git a/packages/migrations/artifacts/2.0.0/ZRXToken.json b/packages/migrations/artifacts/2.0.0/ZRXToken.json index 0c7d547eb..0ce91c1c1 100644 --- a/packages/migrations/artifacts/2.0.0/ZRXToken.json +++ b/packages/migrations/artifacts/2.0.0/ZRXToken.json @@ -10021,5 +10021,11 @@ } } }, - "networks": {} + "networks": { + "50": { + "address": "0x871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c", + "links": {}, + "constructorArgs": "[]" + } + } }
\ No newline at end of file diff --git a/packages/order-utils/src/store/balance_and_proxy_allowance_lazy_store.ts b/packages/order-utils/src/store/balance_and_proxy_allowance_lazy_store.ts index 2c866d190..5a2c1d7ff 100644 --- a/packages/order-utils/src/store/balance_and_proxy_allowance_lazy_store.ts +++ b/packages/order-utils/src/store/balance_and_proxy_allowance_lazy_store.ts @@ -4,7 +4,7 @@ import * as _ from 'lodash'; import { AbstractBalanceAndProxyAllowanceFetcher } from '../abstract/abstract_balance_and_proxy_allowance_fetcher'; import { AbstractBalanceAndProxyAllowanceLazyStore } from '../abstract/abstract_balance_and_proxy_allowance_lazy_store'; -import { assetProxyUtils } from '../asset_proxy_utils'; +import { assetDataUtils } from '../asset_data_utils'; /** * Copy on read store for balances/proxyAllowances of tokens/accounts @@ -79,7 +79,7 @@ export class BalanceAndProxyAllowanceLazyStore implements AbstractBalanceAndProx public deleteAllERC721ProxyAllowance(tokenAddress: string, userAddress: string): void { for (const assetData in this._proxyAllowance) { if (this._proxyAllowance.hasOwnProperty(assetData)) { - const decodedAssetData = assetProxyUtils.decodeAssetDataOrThrow(assetData); + const decodedAssetData = assetDataUtils.decodeAssetDataOrThrow(assetData); if ( decodedAssetData.assetProxyId === AssetProxyId.ERC721 && decodedAssetData.tokenAddress === tokenAddress && diff --git a/packages/order-utils/src/store/order_filled_cancelled_lazy_store.ts b/packages/order-utils/src/store/order_filled_cancelled_lazy_store.ts index 4b1ad70b6..336c6d0ba 100644 --- a/packages/order-utils/src/store/order_filled_cancelled_lazy_store.ts +++ b/packages/order-utils/src/store/order_filled_cancelled_lazy_store.ts @@ -8,7 +8,7 @@ import { AbstractOrderFilledCancelledLazyStore } from '../abstract/abstract_orde * Copy on read store for balances/proxyAllowances of tokens/accounts */ export class OrderFilledCancelledLazyStore implements AbstractOrderFilledCancelledLazyStore { - private _orderFilledCancelledFetcher: AbstractOrderFilledCancelledFetcher; + private readonly _orderFilledCancelledFetcher: AbstractOrderFilledCancelledFetcher; private _filledTakerAmount: { [orderHash: string]: BigNumber; }; diff --git a/packages/order-watcher/src/fetchers/asset_balance_and_proxy_allowance_fetcher.ts b/packages/order-watcher/src/fetchers/asset_balance_and_proxy_allowance_fetcher.ts index bfa33c8b9..a1de22a5e 100644 --- a/packages/order-watcher/src/fetchers/asset_balance_and_proxy_allowance_fetcher.ts +++ b/packages/order-watcher/src/fetchers/asset_balance_and_proxy_allowance_fetcher.ts @@ -1,6 +1,6 @@ // tslint:disable:no-unnecessary-type-assertion import { BlockParamLiteral, ERC20TokenWrapper, ERC721TokenWrapper } from '@0xproject/contract-wrappers'; -import { AbstractBalanceAndProxyAllowanceFetcher, assetProxyUtils } from '@0xproject/order-utils'; +import { AbstractBalanceAndProxyAllowanceFetcher, assetDataUtils } from '@0xproject/order-utils'; import { AssetProxyId, ERC20AssetData, ERC721AssetData } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; @@ -14,7 +14,7 @@ export class AssetBalanceAndProxyAllowanceFetcher implements AbstractBalanceAndP this._stateLayer = stateLayer; } public async getBalanceAsync(assetData: string, userAddress: string): Promise<BigNumber> { - const decodedAssetData = assetProxyUtils.decodeAssetDataOrThrow(assetData); + const decodedAssetData = assetDataUtils.decodeAssetDataOrThrow(assetData); if (decodedAssetData.assetProxyId === AssetProxyId.ERC20) { const decodedERC20AssetData = decodedAssetData as ERC20AssetData; const balance = await this._erc20Token.getBalanceAsync(decodedERC20AssetData.tokenAddress, userAddress, { @@ -35,7 +35,7 @@ export class AssetBalanceAndProxyAllowanceFetcher implements AbstractBalanceAndP } } public async getProxyAllowanceAsync(assetData: string, userAddress: string): Promise<BigNumber> { - const decodedAssetData = assetProxyUtils.decodeAssetDataOrThrow(assetData); + const decodedAssetData = assetDataUtils.decodeAssetDataOrThrow(assetData); if (decodedAssetData.assetProxyId === AssetProxyId.ERC20) { const decodedERC20AssetData = decodedAssetData as ERC20AssetData; const proxyAllowance = await this._erc20Token.getProxyAllowanceAsync( diff --git a/packages/order-watcher/src/order_watcher/dependent_order_hashes_tracker.ts b/packages/order-watcher/src/order_watcher/dependent_order_hashes_tracker.ts index d639242ac..cc70bd5d7 100644 --- a/packages/order-watcher/src/order_watcher/dependent_order_hashes_tracker.ts +++ b/packages/order-watcher/src/order_watcher/dependent_order_hashes_tracker.ts @@ -1,5 +1,5 @@ // tslint:disable:no-unnecessary-type-assertion -import { assetProxyUtils, orderHashUtils } from '@0xproject/order-utils'; +import { assetDataUtils, orderHashUtils } from '@0xproject/order-utils'; import { AssetProxyId, ERC20AssetData, ERC721AssetData, SignedOrder } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import * as _ from 'lodash'; @@ -54,7 +54,7 @@ export class DependentOrderHashesTracker { return dependentOrderHashes; } public getDependentOrderHashesByAssetDataByMaker(makerAddress: string, assetData: string): string[] { - const decodedAssetData = assetProxyUtils.decodeAssetDataOrThrow(assetData); + const decodedAssetData = assetDataUtils.decodeAssetDataOrThrow(assetData); const dependentOrderHashes = decodedAssetData.assetProxyId === AssetProxyId.ERC20 ? this._getDependentOrderHashesByERC20AssetData(makerAddress, assetData) @@ -62,7 +62,7 @@ export class DependentOrderHashesTracker { return dependentOrderHashes; } public addToDependentOrderHashes(signedOrder: SignedOrder): void { - const decodedMakerAssetData = assetProxyUtils.decodeAssetDataOrThrow(signedOrder.makerAssetData); + const decodedMakerAssetData = assetDataUtils.decodeAssetDataOrThrow(signedOrder.makerAssetData); if (decodedMakerAssetData.assetProxyId === AssetProxyId.ERC20) { this._addToERC20DependentOrderHashes(signedOrder, (decodedMakerAssetData as ERC20AssetData).tokenAddress); } else { @@ -76,7 +76,7 @@ export class DependentOrderHashesTracker { this._addToMakerDependentOrderHashes(signedOrder); } public removeFromDependentOrderHashes(signedOrder: SignedOrder): void { - const decodedMakerAssetData = assetProxyUtils.decodeAssetDataOrThrow(signedOrder.makerAssetData); + const decodedMakerAssetData = assetDataUtils.decodeAssetDataOrThrow(signedOrder.makerAssetData); if (decodedMakerAssetData.assetProxyId === AssetProxyId.ERC20) { this._removeFromERC20DependentOrderhashes( signedOrder, @@ -93,7 +93,7 @@ export class DependentOrderHashesTracker { this._removeFromMakerDependentOrderhashes(signedOrder); } private _getDependentOrderHashesByERC20AssetData(makerAddress: string, erc20AssetData: string): string[] { - const tokenAddress = assetProxyUtils.decodeERC20AssetData(erc20AssetData).tokenAddress; + const tokenAddress = assetDataUtils.decodeERC20AssetData(erc20AssetData).tokenAddress; let dependentOrderHashes: string[] = []; if ( !_.isUndefined(this._orderHashesByERC20ByMakerAddress[makerAddress]) && @@ -104,8 +104,8 @@ export class DependentOrderHashesTracker { return dependentOrderHashes; } private _getDependentOrderHashesByERC721AssetData(makerAddress: string, erc721AssetData: string): string[] { - const tokenAddress = assetProxyUtils.decodeERC721AssetData(erc721AssetData).tokenAddress; - const tokenId = assetProxyUtils.decodeERC721AssetData(erc721AssetData).tokenId; + const tokenAddress = assetDataUtils.decodeERC721AssetData(erc721AssetData).tokenAddress; + const tokenId = assetDataUtils.decodeERC721AssetData(erc721AssetData).tokenId; let dependentOrderHashes: string[] = []; if ( !_.isUndefined(this._orderHashesByERC721AddressByTokenIdByMakerAddress[makerAddress]) && diff --git a/packages/order-watcher/src/order_watcher/order_watcher.ts b/packages/order-watcher/src/order_watcher/order_watcher.ts index afc854445..2dfbd4230 100644 --- a/packages/order-watcher/src/order_watcher/order_watcher.ts +++ b/packages/order-watcher/src/order_watcher/order_watcher.ts @@ -22,7 +22,7 @@ import { } from '@0xproject/contract-wrappers'; import { schemas } from '@0xproject/json-schemas'; import { - assetProxyUtils, + assetDataUtils, BalanceAndProxyAllowanceLazyStore, OrderFilledCancelledLazyStore, orderHashUtils, @@ -125,7 +125,7 @@ export class OrderWatcher { config.orderExpirationCheckingIntervalMs, ); this._cleanupJobInterval = config.cleanupJobIntervalMs; - const zrxTokenAddress = assetProxyUtils.decodeERC20AssetData(orderFilledCancelledFetcher.getZRXAssetData()) + const zrxTokenAddress = assetDataUtils.decodeERC20AssetData(orderFilledCancelledFetcher.getZRXAssetData()) .tokenAddress; this._dependentOrderHashesTracker = new DependentOrderHashesTracker(zrxTokenAddress); } @@ -147,7 +147,7 @@ export class OrderWatcher { const orderAssetDatas = [signedOrder.makerAssetData, signedOrder.takerAssetData]; _.each(orderAssetDatas, assetData => { - const decodedAssetData = assetProxyUtils.decodeAssetDataOrThrow(assetData); + const decodedAssetData = assetDataUtils.decodeAssetDataOrThrow(assetData); if (decodedAssetData.assetProxyId === AssetProxyId.ERC20) { this._collisionResistantAbiDecoder.addERC20Token(decodedAssetData.tokenAddress); } else if (decodedAssetData.assetProxyId === AssetProxyId.ERC721) { @@ -277,7 +277,7 @@ export class OrderWatcher { // ERC20 // Invalidate cache const args = decodedLog.args as ERC20TokenApprovalEventArgs; - const tokenAssetData = assetProxyUtils.encodeERC20AssetData(decodedLog.address); + const tokenAssetData = assetDataUtils.encodeERC20AssetData(decodedLog.address); this._balanceAndProxyAllowanceLazyStore.deleteProxyAllowance(tokenAssetData, args._owner); // Revalidate orders const orderHashes = this._dependentOrderHashesTracker.getDependentOrderHashesByAssetDataByMaker( @@ -290,7 +290,7 @@ export class OrderWatcher { // ERC721 // Invalidate cache const args = decodedLog.args as ERC721TokenApprovalEventArgs; - const tokenAssetData = assetProxyUtils.encodeERC721AssetData(decodedLog.address, args._tokenId); + const tokenAssetData = assetDataUtils.encodeERC721AssetData(decodedLog.address, args._tokenId); this._balanceAndProxyAllowanceLazyStore.deleteProxyAllowance(tokenAssetData, args._owner); // Revalidate orders const orderHashes = this._dependentOrderHashesTracker.getDependentOrderHashesByAssetDataByMaker( @@ -308,7 +308,7 @@ export class OrderWatcher { // ERC20 // Invalidate cache const args = decodedLog.args as ERC20TokenTransferEventArgs; - const tokenAssetData = assetProxyUtils.encodeERC20AssetData(decodedLog.address); + const tokenAssetData = assetDataUtils.encodeERC20AssetData(decodedLog.address); this._balanceAndProxyAllowanceLazyStore.deleteBalance(tokenAssetData, args._from); this._balanceAndProxyAllowanceLazyStore.deleteBalance(tokenAssetData, args._to); // Revalidate orders @@ -322,7 +322,7 @@ export class OrderWatcher { // ERC721 // Invalidate cache const args = decodedLog.args as ERC721TokenTransferEventArgs; - const tokenAssetData = assetProxyUtils.encodeERC721AssetData(decodedLog.address, args._tokenId); + const tokenAssetData = assetDataUtils.encodeERC721AssetData(decodedLog.address, args._tokenId); this._balanceAndProxyAllowanceLazyStore.deleteBalance(tokenAssetData, args._from); this._balanceAndProxyAllowanceLazyStore.deleteBalance(tokenAssetData, args._to); // Revalidate orders @@ -350,7 +350,7 @@ export class OrderWatcher { case WETH9Events.Deposit: { // Invalidate cache const args = decodedLog.args as WETH9DepositEventArgs; - const tokenAssetData = assetProxyUtils.encodeERC20AssetData(decodedLog.address); + const tokenAssetData = assetDataUtils.encodeERC20AssetData(decodedLog.address); this._balanceAndProxyAllowanceLazyStore.deleteBalance(tokenAssetData, args._owner); // Revalidate orders const orderHashes = this._dependentOrderHashesTracker.getDependentOrderHashesByAssetDataByMaker( @@ -363,7 +363,7 @@ export class OrderWatcher { case WETH9Events.Withdrawal: { // Invalidate cache const args = decodedLog.args as WETH9WithdrawalEventArgs; - const tokenAssetData = assetProxyUtils.encodeERC20AssetData(decodedLog.address); + const tokenAssetData = assetDataUtils.encodeERC20AssetData(decodedLog.address); this._balanceAndProxyAllowanceLazyStore.deleteBalance(tokenAssetData, args._owner); // Revalidate orders const orderHashes = this._dependentOrderHashesTracker.getDependentOrderHashesByAssetDataByMaker( diff --git a/packages/order-watcher/test/expiration_watcher_test.ts b/packages/order-watcher/test/expiration_watcher_test.ts index f765e8278..ea9923487 100644 --- a/packages/order-watcher/test/expiration_watcher_test.ts +++ b/packages/order-watcher/test/expiration_watcher_test.ts @@ -2,7 +2,7 @@ import { ContractWrappers } from '@0xproject/contract-wrappers'; import { tokenUtils } from '@0xproject/contract-wrappers/lib/test/utils/token_utils'; import { BlockchainLifecycle, callbackErrorReporter } from '@0xproject/dev-utils'; import { FillScenarios } from '@0xproject/fill-scenarios'; -import { assetProxyUtils, orderHashUtils } from '@0xproject/order-utils'; +import { assetDataUtils, orderHashUtils } from '@0xproject/order-utils'; import { DoneCallback } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import * as chai from 'chai'; @@ -56,8 +56,8 @@ describe('ExpirationWatcher', () => { [coinbase, makerAddress, takerAddress, feeRecipient] = userAddresses; const [makerTokenAddress, takerTokenAddress] = tokenUtils.getDummyERC20TokenAddresses(); [makerAssetData, takerAssetData] = [ - assetProxyUtils.encodeERC20AssetData(makerTokenAddress), - assetProxyUtils.encodeERC20AssetData(takerTokenAddress), + assetDataUtils.encodeERC20AssetData(makerTokenAddress), + assetDataUtils.encodeERC20AssetData(takerTokenAddress), ]; }); after(async () => { diff --git a/packages/order-watcher/test/order_watcher_test.ts b/packages/order-watcher/test/order_watcher_test.ts index 2363bb544..00962bed0 100644 --- a/packages/order-watcher/test/order_watcher_test.ts +++ b/packages/order-watcher/test/order_watcher_test.ts @@ -1,9 +1,9 @@ // tslint:disable:no-unnecessary-type-assertion -import { BlockParamLiteral, ContractWrappers } from '@0xproject/contract-wrappers'; +import { ContractWrappers } from '@0xproject/contract-wrappers'; import { tokenUtils } from '@0xproject/contract-wrappers/lib/test/utils/token_utils'; import { BlockchainLifecycle, callbackErrorReporter } from '@0xproject/dev-utils'; import { FillScenarios } from '@0xproject/fill-scenarios'; -import { assetProxyUtils, orderHashUtils } from '@0xproject/order-utils'; +import { assetDataUtils, orderHashUtils } from '@0xproject/order-utils'; import { DoneCallback, ExchangeContractErrs, @@ -71,8 +71,8 @@ describe('OrderWatcher', () => { [coinbase, makerAddress, takerAddress, feeRecipient] = userAddresses; [makerTokenAddress, takerTokenAddress] = tokenUtils.getDummyERC20TokenAddresses(); [makerAssetData, takerAssetData] = [ - assetProxyUtils.encodeERC20AssetData(makerTokenAddress), - assetProxyUtils.encodeERC20AssetData(takerTokenAddress), + assetDataUtils.encodeERC20AssetData(makerTokenAddress), + assetDataUtils.encodeERC20AssetData(takerTokenAddress), ]; const orderWatcherConfig = {}; orderWatcher = new OrderWatcher(provider, networkId, orderWatcherConfig); @@ -539,7 +539,7 @@ describe('OrderWatcher', () => { let makerErc721TokenAddress: string; const tokenId = new BigNumber(42); [makerErc721TokenAddress] = tokenUtils.getDummyERC721TokenAddresses(); - makerErc721AssetData = assetProxyUtils.encodeERC721AssetData(makerErc721TokenAddress, tokenId); + makerErc721AssetData = assetDataUtils.encodeERC721AssetData(makerErc721TokenAddress, tokenId); const fillableErc721Amount = new BigNumber(1); it('should emit orderStateInvalid when maker allowance set to 0 for watched order', (done: DoneCallback) => { (async () => { |