diff options
author | Greg Hysen <greg.hysen@gmail.com> | 2018-04-17 08:33:55 +0800 |
---|---|---|
committer | Amir Bandeali <abandeali1@gmail.com> | 2018-04-21 04:56:18 +0800 |
commit | c19fb1dffcca820e1e82b5baad4b126abda8d112 (patch) | |
tree | b899bd223172aed975e0fc3f5aca9e4b5a17c8bc /packages/contracts/test/exchange | |
parent | 436a6605fb990d4c7aaea5688aefad73dee4d748 (diff) | |
download | dexon-sol-tools-c19fb1dffcca820e1e82b5baad4b126abda8d112.tar dexon-sol-tools-c19fb1dffcca820e1e82b5baad4b126abda8d112.tar.gz dexon-sol-tools-c19fb1dffcca820e1e82b5baad4b126abda8d112.tar.bz2 dexon-sol-tools-c19fb1dffcca820e1e82b5baad4b126abda8d112.tar.lz dexon-sol-tools-c19fb1dffcca820e1e82b5baad4b126abda8d112.tar.xz dexon-sol-tools-c19fb1dffcca820e1e82b5baad4b126abda8d112.tar.zst dexon-sol-tools-c19fb1dffcca820e1e82b5baad4b126abda8d112.zip |
Removed ERC20 V1 Proxy + TokenTransferProxy
Diffstat (limited to 'packages/contracts/test/exchange')
-rw-r--r-- | packages/contracts/test/exchange/core.ts | 60 | ||||
-rw-r--r-- | packages/contracts/test/exchange/helpers.ts | 1 |
2 files changed, 5 insertions, 56 deletions
diff --git a/packages/contracts/test/exchange/core.ts b/packages/contracts/test/exchange/core.ts index 499e846e8..087270db7 100644 --- a/packages/contracts/test/exchange/core.ts +++ b/packages/contracts/test/exchange/core.ts @@ -12,15 +12,13 @@ import { DummyERC721TokenContract } from '../../src/contract_wrappers/generated/ import { DummyTokenContract } from '../../src/contract_wrappers/generated/dummy_token'; import { ERC20ProxyContract } from '../../src/contract_wrappers/generated/e_r_c20_proxy'; import { ERC721ProxyContract } from '../../src/contract_wrappers/generated/e_r_c721_proxy'; -import { ERC20Proxy_v1Contract } from '../../src/contract_wrappers/generated/erc20proxy_v1'; import { CancelContractEventArgs, ExchangeContract, ExchangeErrorContractEventArgs, FillContractEventArgs, } from '../../src/contract_wrappers/generated/exchange'; -import { TokenTransferProxyContract } from '../../src/contract_wrappers/generated/token_transfer_proxy'; -import { encodeERC20ProxyData, encodeERC20V1ProxyData, encodeERC721ProxyData } from '../../src/utils/asset_proxy_utils'; +import { encodeERC20ProxyData, encodeERC721ProxyData } from '../../src/utils/asset_proxy_utils'; import { Balances } from '../../src/utils/balances'; import { constants } from '../../src/utils/constants'; import { crypto } from '../../src/utils/crypto'; @@ -56,9 +54,7 @@ describe('Exchange', () => { let zrx: DummyTokenContract; let erc721Token: DummyERC721TokenContract; let exchange: ExchangeContract; - let tokenTransferProxy: TokenTransferProxyContract; let assetProxyDispatcher: AssetProxyDispatcherContract; - let erc20TransferProxyV1: ERC20Proxy_v1Contract; let erc20TransferProxy: ERC20ProxyContract; let erc721TransferProxy: ERC721ProxyContract; @@ -105,34 +101,6 @@ describe('Exchange', () => { assetProxyDispatcherInstance.address, provider, ); - // Deploy TokenTransferProxy - const tokenTransferProxyInstance = await deployer.deployAsync(ContractName.TokenTransferProxy); - tokenTransferProxy = new TokenTransferProxyContract( - tokenTransferProxyInstance.abi, - tokenTransferProxyInstance.address, - provider, - ); - // Deploy ERC20 V1 Proxy - const erc20TransferProxyV1Instance = await deployer.deployAsync(ContractName.ERC20V1Proxy, [ - tokenTransferProxy.address, - ]); - erc20TransferProxyV1 = new ERC20Proxy_v1Contract( - erc20TransferProxyV1Instance.abi, - erc20TransferProxyV1Instance.address, - provider, - ); - await erc20TransferProxyV1.addAuthorizedAddress.sendTransactionAsync(assetProxyDispatcher.address, { - from: owner, - }); - await tokenTransferProxy.addAuthorizedAddress.sendTransactionAsync(erc20TransferProxyV1.address, { - from: owner, - }); - await assetProxyDispatcher.addAssetProxy.sendTransactionAsync( - AssetProxyId.ERC20V1, - erc20TransferProxyV1.address, - ZeroEx.NULL_ADDRESS, - { from: owner }, - ); // Deploy ERC20 Proxy const erc20TransferProxyInstance = await deployer.deployAsync(ContractName.ERC20Proxy); erc20TransferProxy = new ERC20ProxyContract( @@ -197,12 +165,6 @@ describe('Exchange', () => { orderFactory = new OrderFactory(privateKey, defaultOrderParams); dmyBalances = new Balances([rep, dgd, zrx], [makerAddress, takerAddress, feeRecipientAddress]); await Promise.all([ - rep.approve.sendTransactionAsync(tokenTransferProxy.address, INITIAL_ALLOWANCE, { - from: makerAddress, - }), - rep.approve.sendTransactionAsync(tokenTransferProxy.address, INITIAL_ALLOWANCE, { - from: takerAddress, - }), rep.approve.sendTransactionAsync(erc20TransferProxy.address, INITIAL_ALLOWANCE, { from: makerAddress, }), @@ -211,12 +173,6 @@ describe('Exchange', () => { }), rep.setBalance.sendTransactionAsync(makerAddress, INITIAL_BALANCE, { from: tokenOwner }), rep.setBalance.sendTransactionAsync(takerAddress, INITIAL_BALANCE, { from: tokenOwner }), - dgd.approve.sendTransactionAsync(tokenTransferProxy.address, INITIAL_ALLOWANCE, { - from: makerAddress, - }), - dgd.approve.sendTransactionAsync(tokenTransferProxy.address, INITIAL_ALLOWANCE, { - from: takerAddress, - }), dgd.approve.sendTransactionAsync(erc20TransferProxy.address, INITIAL_ALLOWANCE, { from: makerAddress, }), @@ -225,12 +181,6 @@ describe('Exchange', () => { }), dgd.setBalance.sendTransactionAsync(makerAddress, INITIAL_BALANCE, { from: tokenOwner }), dgd.setBalance.sendTransactionAsync(takerAddress, INITIAL_BALANCE, { from: tokenOwner }), - zrx.approve.sendTransactionAsync(tokenTransferProxy.address, INITIAL_ALLOWANCE, { - from: makerAddress, - }), - zrx.approve.sendTransactionAsync(tokenTransferProxy.address, INITIAL_ALLOWANCE, { - from: takerAddress, - }), zrx.approve.sendTransactionAsync(erc20TransferProxy.address, INITIAL_ALLOWANCE, { from: makerAddress, }), @@ -672,21 +622,21 @@ describe('Exchange', () => { }); it('should throw if maker allowances are too low to fill order', async () => { - await rep.approve.sendTransactionAsync(tokenTransferProxy.address, new BigNumber(0), { + await rep.approve.sendTransactionAsync(erc20TransferProxy.address, new BigNumber(0), { from: makerAddress, }); expect(exWrapper.fillOrderAsync(signedOrder, takerAddress)).to.be.rejectedWith(constants.REVERT); - await rep.approve.sendTransactionAsync(tokenTransferProxy.address, INITIAL_ALLOWANCE, { + await rep.approve.sendTransactionAsync(erc20TransferProxy.address, INITIAL_ALLOWANCE, { from: makerAddress, }); }); it('should throw if taker allowances are too low to fill order', async () => { - await dgd.approve.sendTransactionAsync(tokenTransferProxy.address, new BigNumber(0), { + await dgd.approve.sendTransactionAsync(erc20TransferProxy.address, new BigNumber(0), { from: takerAddress, }); expect(exWrapper.fillOrderAsync(signedOrder, takerAddress)).to.be.rejectedWith(constants.REVERT); - await dgd.approve.sendTransactionAsync(tokenTransferProxy.address, INITIAL_ALLOWANCE, { + await dgd.approve.sendTransactionAsync(erc20TransferProxy.address, INITIAL_ALLOWANCE, { from: takerAddress, }); }); diff --git a/packages/contracts/test/exchange/helpers.ts b/packages/contracts/test/exchange/helpers.ts index 92fce8e47..43dfd5402 100644 --- a/packages/contracts/test/exchange/helpers.ts +++ b/packages/contracts/test/exchange/helpers.ts @@ -35,7 +35,6 @@ describe('Exchange', () => { [makerAddress, feeRecipientAddress] = accounts; const owner = accounts[0]; const tokenRegistry = await deployer.deployAsync(ContractName.TokenRegistry); - const tokenTransferProxy = await deployer.deployAsync(ContractName.TokenTransferProxy); const [rep, dgd, zrx] = await Promise.all([ deployer.deployAsync(ContractName.DummyToken, constants.DUMMY_TOKEN_ARGS), deployer.deployAsync(ContractName.DummyToken, constants.DUMMY_TOKEN_ARGS), |