diff options
author | Amir Bandeali <abandeali1@gmail.com> | 2018-06-30 05:34:46 +0800 |
---|---|---|
committer | Amir Bandeali <abandeali1@gmail.com> | 2018-06-30 07:25:16 +0800 |
commit | d4852092b84936a7c2db207899321ad2a1955e64 (patch) | |
tree | b693ee17fce41377eb0e18e24f054b9845ef0588 /packages/contracts/src/utils | |
parent | 622ce0bf2ee348cd8640cd589962bd88a6d632fb (diff) | |
download | dexon-0x-contracts-d4852092b84936a7c2db207899321ad2a1955e64.tar.gz dexon-0x-contracts-d4852092b84936a7c2db207899321ad2a1955e64.tar.zst dexon-0x-contracts-d4852092b84936a7c2db207899321ad2a1955e64.zip |
Make registerAssetProxy append only
Diffstat (limited to 'packages/contracts/src/utils')
-rw-r--r-- | packages/contracts/src/utils/core_combinatorial_utils.ts | 4 | ||||
-rw-r--r-- | packages/contracts/src/utils/exchange_wrapper.ts | 16 |
2 files changed, 4 insertions, 16 deletions
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<TransactionReceiptWithDecodedLogs> { - 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; } |