diff options
author | Fabio Berger <me@fabioberger.com> | 2018-04-24 17:38:11 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-24 17:38:11 +0800 |
commit | ebd6f7ace0c38315e0deb6cbb2036bc3b0a22d23 (patch) | |
tree | 091084f5f32e99a1f9d173ee010b1cf403d15fea /packages/contracts/test/exchange/wrapper.ts | |
parent | fd041e2997dd10eeb5a50f413775e247176a8432 (diff) | |
parent | a6d5cd4b39140c7ceca31644941c0e67405df7d5 (diff) | |
download | dexon-0x-contracts-ebd6f7ace0c38315e0deb6cbb2036bc3b0a22d23.tar.gz dexon-0x-contracts-ebd6f7ace0c38315e0deb6cbb2036bc3b0a22d23.tar.zst dexon-0x-contracts-ebd6f7ace0c38315e0deb6cbb2036bc3b0a22d23.zip |
Merge pull request #549 from 0xProject/feature/contracts/combineAssetProxyDispatcher
Merge Exchange and AssetProxyDispatcher (depends on #548)
Diffstat (limited to 'packages/contracts/test/exchange/wrapper.ts')
-rw-r--r-- | packages/contracts/test/exchange/wrapper.ts | 39 |
1 files changed, 9 insertions, 30 deletions
diff --git a/packages/contracts/test/exchange/wrapper.ts b/packages/contracts/test/exchange/wrapper.ts index d2d82f977..855c79b56 100644 --- a/packages/contracts/test/exchange/wrapper.ts +++ b/packages/contracts/test/exchange/wrapper.ts @@ -6,7 +6,6 @@ import * as chai from 'chai'; import * as _ from 'lodash'; import * as Web3 from 'web3'; -import { AssetProxyDispatcherContract } from '../../src/contract_wrappers/generated/asset_proxy_dispatcher'; import { DummyERC20TokenContract } from '../../src/contract_wrappers/generated/dummy_e_r_c20_token'; import { DummyERC721TokenContract } from '../../src/contract_wrappers/generated/dummy_e_r_c721_token'; import { ERC20ProxyContract } from '../../src/contract_wrappers/generated/e_r_c20_proxy'; @@ -39,7 +38,6 @@ describe('Exchange wrappers', () => { let zrxToken: DummyERC20TokenContract; let erc721Token: DummyERC721TokenContract; let exchange: ExchangeContract; - let assetProxyDispatcher: AssetProxyDispatcherContract; let erc20Proxy: ERC20ProxyContract; let erc721Proxy: ERC721ProxyContract; @@ -75,44 +73,25 @@ describe('Exchange wrappers', () => { erc721MakerAssetId = erc721Balances[makerAddress][erc721Token.address][0]; erc721TakerAssetId = erc721Balances[takerAddress][erc721Token.address][0]; - const assetProxyDispatcherInstance = await deployer.deployAsync(ContractName.AssetProxyDispatcher); - assetProxyDispatcher = new AssetProxyDispatcherContract( - assetProxyDispatcherInstance.abi, - assetProxyDispatcherInstance.address, - provider, - ); - const prevERC20ProxyAddress = ZeroEx.NULL_ADDRESS; - await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( - AssetProxyId.ERC20, - erc20Proxy.address, - prevERC20ProxyAddress, - { from: owner }, - ); - const prevERC721ProxyAddress = ZeroEx.NULL_ADDRESS; - await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( - AssetProxyId.ERC721, - erc721Proxy.address, - prevERC721ProxyAddress, - { from: owner }, - ); - await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(assetProxyDispatcher.address, { - from: owner, - }); - await erc721Proxy.addAuthorizedAddress.sendTransactionAsync(assetProxyDispatcher.address, { - from: owner, - }); - const exchangeInstance = await deployer.deployAsync(ContractName.Exchange, [ assetProxyDispatcher.address, assetProxyUtils.encodeERC20ProxyData(zrxToken.address), ]); exchange = new ExchangeContract(exchangeInstance.abi, exchangeInstance.address, provider); - await assetProxyDispatcher.addAuthorizedAddress.sendTransactionAsync(exchange.address, { from: owner }); zeroEx = new ZeroEx(provider, { exchangeContractAddress: exchange.address, networkId: constants.TESTRPC_NETWORK_ID, }); exchangeWrapper = new ExchangeWrapper(exchange, zeroEx); + await exchangeWrapper.registerAssetProxyAsync(AssetProxyId.ERC20, erc20Proxy.address, owner); + await exchangeWrapper.registerAssetProxyAsync(AssetProxyId.ERC721, erc721Proxy.address, owner); + + await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, { + from: owner, + }); + await erc721Proxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, { + from: owner, + }); defaultMakerAssetAddress = erc20TokenA.address; defaultTakerAssetAddress = erc20TokenB.address; |