From d4852092b84936a7c2db207899321ad2a1955e64 Mon Sep 17 00:00:00 2001 From: Amir Bandeali Date: Fri, 29 Jun 2018 14:34:46 -0700 Subject: Make registerAssetProxy append only --- packages/contracts/src/utils/core_combinatorial_utils.ts | 4 ++-- packages/contracts/src/utils/exchange_wrapper.ts | 16 ++-------------- 2 files changed, 4 insertions(+), 16 deletions(-) (limited to 'packages/contracts/src/utils') diff --git a/packages/contracts/src/utils/core_combinatorial_utils.ts b/packages/contracts/src/utils/core_combinatorial_utils.ts index 5b725fbe3..93f4fc79d 100644 --- a/packages/contracts/src/utils/core_combinatorial_utils.ts +++ b/packages/contracts/src/utils/core_combinatorial_utils.ts @@ -96,8 +96,8 @@ export async function coreCombinatorialUtilsFactoryAsync( zrxAssetData, ); const exchangeWrapper = new ExchangeWrapper(exchangeContract, provider); - await exchangeWrapper.registerAssetProxyAsync(AssetProxyId.ERC20, erc20Proxy.address, ownerAddress); - await exchangeWrapper.registerAssetProxyAsync(AssetProxyId.ERC721, erc721Proxy.address, ownerAddress); + await exchangeWrapper.registerAssetProxyAsync(erc20Proxy.address, ownerAddress); + await exchangeWrapper.registerAssetProxyAsync(erc721Proxy.address, ownerAddress); await web3Wrapper.awaitTransactionSuccessAsync( await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(exchangeContract.address, { diff --git a/packages/contracts/src/utils/exchange_wrapper.ts b/packages/contracts/src/utils/exchange_wrapper.ts index ad68c8ff4..baf967065 100644 --- a/packages/contracts/src/utils/exchange_wrapper.ts +++ b/packages/contracts/src/utils/exchange_wrapper.ts @@ -1,12 +1,10 @@ -import { AssetProxyId, SignedOrder } from '@0xproject/types'; +import { SignedOrder } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import { Provider, TransactionReceiptWithDecodedLogs } from 'ethereum-types'; -import * as _ from 'lodash'; import { ExchangeContract } from '../generated_contract_wrappers/exchange'; -import { constants } from './constants'; import { formatters } from './formatters'; import { LogDecoder } from './log_decoder'; import { orderUtils } from './order_utils'; @@ -192,20 +190,10 @@ export class ExchangeWrapper { return tx; } public async registerAssetProxyAsync( - assetProxyId: AssetProxyId, assetProxyAddress: string, from: string, - opts: { oldAssetProxyAddressIfExists?: string } = {}, ): Promise { - const oldAssetProxyAddress = _.isUndefined(opts.oldAssetProxyAddressIfExists) - ? constants.NULL_ADDRESS - : opts.oldAssetProxyAddressIfExists; - const txHash = await this._exchange.registerAssetProxy.sendTransactionAsync( - assetProxyId, - assetProxyAddress, - oldAssetProxyAddress, - { from }, - ); + const txHash = await this._exchange.registerAssetProxy.sendTransactionAsync(assetProxyAddress, { from }); const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash); return tx; } -- cgit v1.2.3