diff options
author | Fabio Berger <me@fabioberger.com> | 2018-05-24 00:04:59 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-24 00:04:59 +0800 |
commit | f3fe9661f65f5ac58d45e965b7be02e9738df1c4 (patch) | |
tree | aeff401cb16007a30c08e9e3a980bb4904257f6a /packages/contracts/test/exchange/dispatcher.ts | |
parent | e7e8773cd43121cdedff6151d379503ff899e595 (diff) | |
parent | 17cfd7b001a046e1014257da6b77b28c7a291e54 (diff) | |
download | dexon-sol-tools-f3fe9661f65f5ac58d45e965b7be02e9738df1c4.tar dexon-sol-tools-f3fe9661f65f5ac58d45e965b7be02e9738df1c4.tar.gz dexon-sol-tools-f3fe9661f65f5ac58d45e965b7be02e9738df1c4.tar.bz2 dexon-sol-tools-f3fe9661f65f5ac58d45e965b7be02e9738df1c4.tar.lz dexon-sol-tools-f3fe9661f65f5ac58d45e965b7be02e9738df1c4.tar.xz dexon-sol-tools-f3fe9661f65f5ac58d45e965b7be02e9738df1c4.tar.zst dexon-sol-tools-f3fe9661f65f5ac58d45e965b7be02e9738df1c4.zip |
Merge pull request #609 from 0xProject/refactor/contracts/remove0xjsDep
Remove 0x.js dep from Contracts
Diffstat (limited to 'packages/contracts/test/exchange/dispatcher.ts')
-rw-r--r-- | packages/contracts/test/exchange/dispatcher.ts | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/packages/contracts/test/exchange/dispatcher.ts b/packages/contracts/test/exchange/dispatcher.ts index a1c37d8c8..a2238bd10 100644 --- a/packages/contracts/test/exchange/dispatcher.ts +++ b/packages/contracts/test/exchange/dispatcher.ts @@ -1,4 +1,3 @@ -import { ZeroEx } from '0x.js'; import { BlockchainLifecycle } from '@0xproject/dev-utils'; import { BigNumber } from '@0xproject/utils'; import * as chai from 'chai'; @@ -83,7 +82,7 @@ describe('AssetProxyDispatcher', () => { }); describe('registerAssetProxy', () => { it('should record proxy upon registration', async () => { - const prevProxyAddress = ZeroEx.NULL_ADDRESS; + const prevProxyAddress = constants.NULL_ADDRESS; await web3Wrapper.awaitTransactionMinedAsync( await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, @@ -99,7 +98,7 @@ describe('AssetProxyDispatcher', () => { it('should be able to record multiple proxies', async () => { // Record first proxy - const prevERC20ProxyAddress = ZeroEx.NULL_ADDRESS; + const prevERC20ProxyAddress = constants.NULL_ADDRESS; await web3Wrapper.awaitTransactionMinedAsync( await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, @@ -112,7 +111,7 @@ describe('AssetProxyDispatcher', () => { let proxyAddress = await assetProxyDispatcher.getAssetProxy.callAsync(AssetProxyId.ERC20); expect(proxyAddress).to.be.equal(erc20Proxy.address); // Record another proxy - const prevERC721ProxyAddress = ZeroEx.NULL_ADDRESS; + const prevERC721ProxyAddress = constants.NULL_ADDRESS; await web3Wrapper.awaitTransactionMinedAsync( await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC721, @@ -128,7 +127,7 @@ describe('AssetProxyDispatcher', () => { it('should replace proxy address upon re-registration', async () => { // Initial registration - const prevProxyAddress = ZeroEx.NULL_ADDRESS; + const prevProxyAddress = constants.NULL_ADDRESS; await web3Wrapper.awaitTransactionMinedAsync( await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, @@ -165,7 +164,7 @@ describe('AssetProxyDispatcher', () => { it('should throw if registering with incorrect "currentAssetProxyAddress" field', async () => { // Initial registration - const prevProxyAddress = ZeroEx.NULL_ADDRESS; + const prevProxyAddress = constants.NULL_ADDRESS; await web3Wrapper.awaitTransactionMinedAsync( await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, @@ -177,12 +176,12 @@ describe('AssetProxyDispatcher', () => { ); const proxyAddress = await assetProxyDispatcher.getAssetProxy.callAsync(AssetProxyId.ERC20); expect(proxyAddress).to.be.equal(erc20Proxy.address); - // The following transaction will throw because the currentAddress is no longer ZeroEx.NULL_ADDRESS + // The following transaction will throw because the currentAddress is no longer constants.NULL_ADDRESS return expect( assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, erc20Proxy.address, - ZeroEx.NULL_ADDRESS, + constants.NULL_ADDRESS, { from: owner }, ), ).to.be.rejectedWith(constants.REVERT); @@ -190,7 +189,7 @@ describe('AssetProxyDispatcher', () => { it('should be able to reset proxy address to NULL', async () => { // Initial registration - const prevProxyAddress = ZeroEx.NULL_ADDRESS; + const prevProxyAddress = constants.NULL_ADDRESS; await web3Wrapper.awaitTransactionMinedAsync( await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, @@ -203,7 +202,7 @@ describe('AssetProxyDispatcher', () => { const proxyAddress = await assetProxyDispatcher.getAssetProxy.callAsync(AssetProxyId.ERC20); expect(proxyAddress).to.be.equal(erc20Proxy.address); // The following transaction will reset the proxy address - const newProxyAddress = ZeroEx.NULL_ADDRESS; + const newProxyAddress = constants.NULL_ADDRESS; await web3Wrapper.awaitTransactionMinedAsync( await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, @@ -218,7 +217,7 @@ describe('AssetProxyDispatcher', () => { }); it('should throw if requesting address is not owner', async () => { - const prevProxyAddress = ZeroEx.NULL_ADDRESS; + const prevProxyAddress = constants.NULL_ADDRESS; return expect( assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, @@ -230,7 +229,7 @@ describe('AssetProxyDispatcher', () => { }); it('should throw if attempting to register a proxy to the incorrect id', async () => { - const prevProxyAddress = ZeroEx.NULL_ADDRESS; + const prevProxyAddress = constants.NULL_ADDRESS; return expect( assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC721, @@ -244,7 +243,7 @@ describe('AssetProxyDispatcher', () => { describe('getAssetProxy', () => { it('should return correct address of registered proxy', async () => { - const prevProxyAddress = ZeroEx.NULL_ADDRESS; + const prevProxyAddress = constants.NULL_ADDRESS; await web3Wrapper.awaitTransactionMinedAsync( await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, @@ -260,14 +259,14 @@ describe('AssetProxyDispatcher', () => { it('should return NULL address if requesting non-existent proxy', async () => { const proxyAddress = await assetProxyDispatcher.getAssetProxy.callAsync(AssetProxyId.ERC20); - expect(proxyAddress).to.be.equal(ZeroEx.NULL_ADDRESS); + expect(proxyAddress).to.be.equal(constants.NULL_ADDRESS); }); }); describe('dispatchTransferFrom', () => { it('should dispatch transfer to registered proxy', async () => { // Register ERC20 proxy - const prevProxyAddress = ZeroEx.NULL_ADDRESS; + const prevProxyAddress = constants.NULL_ADDRESS; await web3Wrapper.awaitTransactionMinedAsync( await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, |