diff options
author | Amir Bandeali <abandeali1@gmail.com> | 2018-04-23 08:25:28 +0800 |
---|---|---|
committer | Amir Bandeali <abandeali1@gmail.com> | 2018-04-24 01:50:09 +0800 |
commit | 432b064601776d4daacfc2415c3da41c91a24d27 (patch) | |
tree | 40e4e240dbd3e7a5441d3d2c5a52f3a64b2a8ac6 /packages/contracts/test/exchange/wrapper.ts | |
parent | a8a0a5cbfb7299cd22181c8713e1da6dec412dae (diff) | |
download | dexon-sol-tools-432b064601776d4daacfc2415c3da41c91a24d27.tar dexon-sol-tools-432b064601776d4daacfc2415c3da41c91a24d27.tar.gz dexon-sol-tools-432b064601776d4daacfc2415c3da41c91a24d27.tar.bz2 dexon-sol-tools-432b064601776d4daacfc2415c3da41c91a24d27.tar.lz dexon-sol-tools-432b064601776d4daacfc2415c3da41c91a24d27.tar.xz dexon-sol-tools-432b064601776d4daacfc2415c3da41c91a24d27.tar.zst dexon-sol-tools-432b064601776d4daacfc2415c3da41c91a24d27.zip |
Fix tests
Diffstat (limited to 'packages/contracts/test/exchange/wrapper.ts')
-rw-r--r-- | packages/contracts/test/exchange/wrapper.ts | 40 |
1 files changed, 9 insertions, 31 deletions
diff --git a/packages/contracts/test/exchange/wrapper.ts b/packages/contracts/test/exchange/wrapper.ts index 60f47373e..1d40bd3d9 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'; @@ -45,7 +44,6 @@ describe('Exchange wrappers', () => { let zrx: DummyERC20TokenContract; let erc721Token: DummyERC721TokenContract; let exchange: ExchangeContract; - let assetProxyDispatcher: AssetProxyDispatcherContract; let erc20Proxy: ERC20ProxyContract; let erc721Proxy: ERC721ProxyContract; @@ -81,44 +79,24 @@ 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(zrx.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; |