diff options
author | Greg Hysen <greg.hysen@gmail.com> | 2018-06-01 05:06:47 +0800 |
---|---|---|
committer | Greg Hysen <greg.hysen@gmail.com> | 2018-06-08 06:38:48 +0800 |
commit | e042e0ad32cd2ac9e707cb8e52961957f58314ce (patch) | |
tree | 70183e915072dc90b7b5cb1597f022368e9a0c79 /packages/contracts/test | |
parent | 5db15ca54cd7e1fd90bf318d2975750dcd31cddc (diff) | |
download | dexon-sol-tools-e042e0ad32cd2ac9e707cb8e52961957f58314ce.tar dexon-sol-tools-e042e0ad32cd2ac9e707cb8e52961957f58314ce.tar.gz dexon-sol-tools-e042e0ad32cd2ac9e707cb8e52961957f58314ce.tar.bz2 dexon-sol-tools-e042e0ad32cd2ac9e707cb8e52961957f58314ce.tar.lz dexon-sol-tools-e042e0ad32cd2ac9e707cb8e52961957f58314ce.tar.xz dexon-sol-tools-e042e0ad32cd2ac9e707cb8e52961957f58314ce.tar.zst dexon-sol-tools-e042e0ad32cd2ac9e707cb8e52961957f58314ce.zip |
Converged on naming scheme for asset data: renamed all instances of assetMetadata, proxyData, proxyMetadata to assetData
Diffstat (limited to 'packages/contracts/test')
-rw-r--r-- | packages/contracts/test/asset_proxy/decoder.ts | 40 | ||||
-rw-r--r-- | packages/contracts/test/asset_proxy/proxies.ts | 117 | ||||
-rw-r--r-- | packages/contracts/test/exchange/core.ts | 42 | ||||
-rw-r--r-- | packages/contracts/test/exchange/dispatcher.ts | 8 | ||||
-rw-r--r-- | packages/contracts/test/exchange/libs.ts | 4 | ||||
-rw-r--r-- | packages/contracts/test/exchange/match_orders.ts | 166 | ||||
-rw-r--r-- | packages/contracts/test/exchange/signature_validator.ts | 4 | ||||
-rw-r--r-- | packages/contracts/test/exchange/transactions.ts | 6 | ||||
-rw-r--r-- | packages/contracts/test/exchange/wrapper.ts | 26 |
9 files changed, 190 insertions, 223 deletions
diff --git a/packages/contracts/test/asset_proxy/decoder.ts b/packages/contracts/test/asset_proxy/decoder.ts index 0f1413ff1..712ef8656 100644 --- a/packages/contracts/test/asset_proxy/decoder.ts +++ b/packages/contracts/test/asset_proxy/decoder.ts @@ -12,7 +12,7 @@ import { artifacts } from '../../src/utils/artifacts'; import { assetProxyUtils } from '../../src/utils/asset_proxy_utils'; import { chaiSetup } from '../../src/utils/chai_setup'; import { constants } from '../../src/utils/constants'; -import { AssetProxyId, ERC20ProxyData, ERC721ProxyData, ProxyData } from '../../src/utils/types'; +import { AssetProxyId, ERC20AssetData, ERC721AssetData, AssetData } from '../../src/utils/types'; import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper'; chaiSetup.configure(); @@ -45,21 +45,21 @@ describe('LibAssetProxyDecoder', () => { describe('LibAssetProxyDecoder', () => { it('should correctly decode ERC20 proxy data)', async () => { - const encodedProxyData = assetProxyUtils.encodeERC20ProxyData(testAddress); - const expectedDecodedProxyData = assetProxyUtils.decodeERC20ProxyData(encodedProxyData); + const encodedAssetData = assetProxyUtils.encodeERC20AssetData(testAddress); + const expectedDecodedAssetData = assetProxyUtils.decodeERC20AssetData(encodedAssetData); let decodedAssetProxyId: number; let decodedTokenAddress: string; [decodedAssetProxyId, decodedTokenAddress] = await testAssetProxyDecoder.publicDecodeERC20Data.callAsync( - encodedProxyData, + encodedAssetData, ); - expect(decodedAssetProxyId).to.be.equal(expectedDecodedProxyData.assetProxyId); - expect(decodedTokenAddress).to.be.equal(expectedDecodedProxyData.tokenAddress); + expect(decodedAssetProxyId).to.be.equal(expectedDecodedAssetData.assetProxyId); + expect(decodedTokenAddress).to.be.equal(expectedDecodedAssetData.tokenAddress); }); it('should correctly decode ERC721 proxy data', async () => { const tokenId = ZeroEx.generatePseudoRandomSalt(); - const encodedProxyData = assetProxyUtils.encodeERC721ProxyData(testAddress, tokenId); - const expectedDecodedProxyData = assetProxyUtils.decodeERC721ProxyData(encodedProxyData); + const encodedAssetData = assetProxyUtils.encodeERC721AssetData(testAddress, tokenId); + const expectedDecodedAssetData = assetProxyUtils.decodeERC721AssetData(encodedAssetData); let decodedAssetProxyId: number; let decodedTokenAddress: string; let decodedTokenId: BigNumber; @@ -69,18 +69,18 @@ describe('LibAssetProxyDecoder', () => { decodedTokenAddress, decodedTokenId, decodedData, - ] = await testAssetProxyDecoder.publicDecodeERC721Data.callAsync(encodedProxyData); - expect(decodedAssetProxyId).to.be.equal(expectedDecodedProxyData.assetProxyId); - expect(decodedTokenAddress).to.be.equal(expectedDecodedProxyData.tokenAddress); - expect(decodedTokenId).to.be.bignumber.equal(expectedDecodedProxyData.tokenId); - expect(decodedData).to.be.equal(expectedDecodedProxyData.data); + ] = await testAssetProxyDecoder.publicDecodeERC721Data.callAsync(encodedAssetData); + expect(decodedAssetProxyId).to.be.equal(expectedDecodedAssetData.assetProxyId); + expect(decodedTokenAddress).to.be.equal(expectedDecodedAssetData.tokenAddress); + expect(decodedTokenId).to.be.bignumber.equal(expectedDecodedAssetData.tokenId); + expect(decodedData).to.be.equal(expectedDecodedAssetData.data); }); it('should correctly decode ERC721 proxy data with receiver data', async () => { const tokenId = ZeroEx.generatePseudoRandomSalt(); const data = ethUtil.bufferToHex(assetProxyUtils.encodeUint256(ZeroEx.generatePseudoRandomSalt())) + 'FFFF'; - const encodedProxyData = assetProxyUtils.encodeERC721ProxyData(testAddress, tokenId, data); - const expectedDecodedProxyData = assetProxyUtils.decodeERC721ProxyData(encodedProxyData); + const encodedAssetData = assetProxyUtils.encodeERC721AssetData(testAddress, tokenId, data); + const expectedDecodedAssetData = assetProxyUtils.decodeERC721AssetData(encodedAssetData); let decodedAssetProxyId: number; let decodedTokenAddress: string; let decodedTokenId: BigNumber; @@ -90,11 +90,11 @@ describe('LibAssetProxyDecoder', () => { decodedTokenAddress, decodedTokenId, decodedData, - ] = await testAssetProxyDecoder.publicDecodeERC721Data.callAsync(encodedProxyData); - expect(decodedAssetProxyId).to.be.equal(expectedDecodedProxyData.assetProxyId); - expect(decodedTokenAddress).to.be.equal(expectedDecodedProxyData.tokenAddress); - expect(decodedTokenId).to.be.bignumber.equal(expectedDecodedProxyData.tokenId); - expect(decodedData).to.be.equal(expectedDecodedProxyData.data); + ] = await testAssetProxyDecoder.publicDecodeERC721Data.callAsync(encodedAssetData); + expect(decodedAssetProxyId).to.be.equal(expectedDecodedAssetData.assetProxyId); + expect(decodedTokenAddress).to.be.equal(expectedDecodedAssetData.tokenAddress); + expect(decodedTokenId).to.be.bignumber.equal(expectedDecodedAssetData.tokenId); + expect(decodedData).to.be.equal(expectedDecodedAssetData.data); }); }); }); diff --git a/packages/contracts/test/asset_proxy/proxies.ts b/packages/contracts/test/asset_proxy/proxies.ts index 4995e95a0..d6bc8163b 100644 --- a/packages/contracts/test/asset_proxy/proxies.ts +++ b/packages/contracts/test/asset_proxy/proxies.ts @@ -107,13 +107,13 @@ describe('Asset Transfer Proxies', () => { describe('transferFrom', () => { it('should successfully transfer tokens', async () => { // Construct metadata for ERC20 proxy - const encodedProxyMetadata = assetProxyUtils.encodeERC20ProxyData(zrxToken.address); + const encodedAssetData = assetProxyUtils.encodeERC20AssetData(zrxToken.address); // Perform a transfer from makerAddress to takerAddress const erc20Balances = await erc20Wrapper.getBalancesAsync(); const amount = new BigNumber(10); await web3Wrapper.awaitTransactionSuccessAsync( await erc20Proxy.transferFrom.sendTransactionAsync( - encodedProxyMetadata, + encodedAssetData, makerAddress, takerAddress, amount, @@ -133,13 +133,13 @@ describe('Asset Transfer Proxies', () => { it('should do nothing if transferring 0 amount of a token', async () => { // Construct metadata for ERC20 proxy - const encodedProxyMetadata = assetProxyUtils.encodeERC20ProxyData(zrxToken.address); + const encodedAssetData = assetProxyUtils.encodeERC20AssetData(zrxToken.address); // Perform a transfer from makerAddress to takerAddress const erc20Balances = await erc20Wrapper.getBalancesAsync(); const amount = new BigNumber(0); await web3Wrapper.awaitTransactionSuccessAsync( await erc20Proxy.transferFrom.sendTransactionAsync( - encodedProxyMetadata, + encodedAssetData, makerAddress, takerAddress, amount, @@ -159,7 +159,7 @@ describe('Asset Transfer Proxies', () => { it('should throw if allowances are too low', async () => { // Construct metadata for ERC20 proxy - const encodedProxyMetadata = assetProxyUtils.encodeERC20ProxyData(zrxToken.address); + const encodedAssetData = assetProxyUtils.encodeERC20AssetData(zrxToken.address); // Create allowance less than transfer amount. Set allowance on proxy. const allowance = new BigNumber(0); const transferAmount = new BigNumber(10); @@ -172,7 +172,7 @@ describe('Asset Transfer Proxies', () => { // Perform a transfer; expect this to fail. return expectRevertOrAlwaysFailingTransactionAsync( erc20Proxy.transferFrom.sendTransactionAsync( - encodedProxyMetadata, + encodedAssetData, makerAddress, takerAddress, transferAmount, @@ -183,19 +183,13 @@ describe('Asset Transfer Proxies', () => { it('should throw if requesting address is not authorized', async () => { // Construct metadata for ERC20 proxy - const encodedProxyMetadata = assetProxyUtils.encodeERC20ProxyData(zrxToken.address); + const encodedAssetData = assetProxyUtils.encodeERC20AssetData(zrxToken.address); // Perform a transfer from makerAddress to takerAddress const amount = new BigNumber(10); return expectRevertOrAlwaysFailingTransactionAsync( - erc20Proxy.transferFrom.sendTransactionAsync( - encodedProxyMetadata, - makerAddress, - takerAddress, - amount, - { - from: notAuthorized, - }, - ), + erc20Proxy.transferFrom.sendTransactionAsync(encodedAssetData, makerAddress, takerAddress, amount, { + from: notAuthorized, + }), ); }); }); @@ -204,16 +198,16 @@ describe('Asset Transfer Proxies', () => { it('should succesfully make multiple token transfers', async () => { const erc20Balances = await erc20Wrapper.getBalancesAsync(); - const encodedProxyMetadata = assetProxyUtils.encodeERC20ProxyData(zrxToken.address); + const encodedAssetData = assetProxyUtils.encodeERC20AssetData(zrxToken.address); const amount = new BigNumber(10); const numTransfers = 2; - const assetMetadata = _.times(numTransfers, () => encodedProxyMetadata); + const assetData = _.times(numTransfers, () => encodedAssetData); const fromAddresses = _.times(numTransfers, () => makerAddress); const toAddresses = _.times(numTransfers, () => takerAddress); const amounts = _.times(numTransfers, () => amount); const txHash = await erc20Proxy.batchTransferFrom.sendTransactionAsync( - assetMetadata, + assetData, fromAddresses, toAddresses, amounts, @@ -235,17 +229,17 @@ describe('Asset Transfer Proxies', () => { }); it('should throw if not called by an authorized address', async () => { - const encodedProxyMetadata = assetProxyUtils.encodeERC20ProxyData(zrxToken.address); + const encodedAssetData = assetProxyUtils.encodeERC20AssetData(zrxToken.address); const amount = new BigNumber(10); const numTransfers = 2; - const assetMetadata = _.times(numTransfers, () => encodedProxyMetadata); + const assetData = _.times(numTransfers, () => encodedAssetData); const fromAddresses = _.times(numTransfers, () => makerAddress); const toAddresses = _.times(numTransfers, () => takerAddress); const amounts = _.times(numTransfers, () => amount); return expectRevertOrAlwaysFailingTransactionAsync( erc20Proxy.batchTransferFrom.sendTransactionAsync( - assetMetadata, + encodedAssetData, fromAddresses, toAddresses, amounts, @@ -265,10 +259,7 @@ describe('Asset Transfer Proxies', () => { describe('transferFrom', () => { it('should successfully transfer tokens', async () => { // Construct metadata for ERC721 proxy - const encodedProxyMetadata = assetProxyUtils.encodeERC721ProxyData( - erc721Token.address, - erc721MakerTokenId, - ); + const encodedAssetData = assetProxyUtils.encodeERC721AssetData(erc721Token.address, erc721MakerTokenId); // Verify pre-condition const ownerMakerAsset = await erc721Token.ownerOf.callAsync(erc721MakerTokenId); expect(ownerMakerAsset).to.be.bignumber.equal(makerAddress); @@ -276,7 +267,7 @@ describe('Asset Transfer Proxies', () => { const amount = new BigNumber(1); await web3Wrapper.awaitTransactionSuccessAsync( await erc721Proxy.transferFrom.sendTransactionAsync( - encodedProxyMetadata, + encodedAssetData, makerAddress, takerAddress, amount, @@ -291,10 +282,7 @@ describe('Asset Transfer Proxies', () => { it('should call onERC721Received when transferring to a smart contract', async () => { // Construct metadata for ERC721 proxy - const encodedProxyMetadata = assetProxyUtils.encodeERC721ProxyData( - erc721Token.address, - erc721MakerTokenId, - ); + const encodedAssetData = assetProxyUtils.encodeERC721AssetData(erc721Token.address, erc721MakerTokenId); // Verify pre-condition const ownerMakerAsset = await erc721Token.ownerOf.callAsync(erc721MakerTokenId); expect(ownerMakerAsset).to.be.bignumber.equal(makerAddress); @@ -302,7 +290,7 @@ describe('Asset Transfer Proxies', () => { const erc20Balances = await erc20Wrapper.getBalancesAsync(); const amount = new BigNumber(1); const txHash = await erc721Proxy.transferFrom.sendTransactionAsync( - encodedProxyMetadata, + encodedAssetData, makerAddress, erc721Receiver.address, amount, @@ -327,7 +315,7 @@ describe('Asset Transfer Proxies', () => { it('should call onERC721Received when transferring to a smart contract and receive extra data', async () => { // Construct metadata for ERC721 proxy const data = ethUtil.bufferToHex(assetProxyUtils.encodeUint256(ZeroEx.generatePseudoRandomSalt())); - const encodedProxyMetadata = assetProxyUtils.encodeERC721ProxyData( + const encodedAssetData = assetProxyUtils.encodeERC721AssetData( erc721Token.address, erc721MakerTokenId, data, @@ -339,7 +327,7 @@ describe('Asset Transfer Proxies', () => { const erc20Balances = await erc20Wrapper.getBalancesAsync(); const amount = new BigNumber(1); const txHash = await erc721Proxy.transferFrom.sendTransactionAsync( - encodedProxyMetadata, + encodedAssetData, makerAddress, erc721Receiver.address, amount, @@ -363,10 +351,7 @@ describe('Asset Transfer Proxies', () => { it('should throw if receiving contract does not have onERC721Received', async () => { // Construct metadata for ERC721 proxy - const encodedProxyMetadata = assetProxyUtils.encodeERC721ProxyData( - erc721Token.address, - erc721MakerTokenId, - ); + const encodedAssetData = assetProxyUtils.encodeERC721AssetData(erc721Token.address, erc721MakerTokenId); // Verify pre-condition const ownerMakerAsset = await erc721Token.ownerOf.callAsync(erc721MakerTokenId); expect(ownerMakerAsset).to.be.bignumber.equal(makerAddress); @@ -375,7 +360,7 @@ describe('Asset Transfer Proxies', () => { const amount = new BigNumber(1); return expect( erc721Proxy.transferFrom.sendTransactionAsync( - encodedProxyMetadata, + encodedAssetData, makerAddress, erc20Proxy.address, // the ERC20 proxy does not have an ERC721 receiver amount, @@ -386,10 +371,7 @@ describe('Asset Transfer Proxies', () => { it('should throw if transferring 0 amount of a token', async () => { // Construct metadata for ERC721 proxy - const encodedProxyMetadata = assetProxyUtils.encodeERC721ProxyData( - erc721Token.address, - erc721MakerTokenId, - ); + const encodedAssetData = assetProxyUtils.encodeERC721AssetData(erc721Token.address, erc721MakerTokenId); // Verify pre-condition const ownerMakerAsset = await erc721Token.ownerOf.callAsync(erc721MakerTokenId); expect(ownerMakerAsset).to.be.bignumber.equal(makerAddress); @@ -397,7 +379,7 @@ describe('Asset Transfer Proxies', () => { const amount = new BigNumber(0); return expectRevertOrAlwaysFailingTransactionAsync( erc721Proxy.transferFrom.sendTransactionAsync( - encodedProxyMetadata, + encodedAssetData, makerAddress, takerAddress, amount, @@ -408,10 +390,7 @@ describe('Asset Transfer Proxies', () => { it('should throw if transferring > 1 amount of a token', async () => { // Construct metadata for ERC721 proxy - const encodedProxyMetadata = assetProxyUtils.encodeERC721ProxyData( - erc721Token.address, - erc721MakerTokenId, - ); + const encodedAssetData = assetProxyUtils.encodeERC721AssetData(erc721Token.address, erc721MakerTokenId); // Verify pre-condition const ownerMakerAsset = await erc721Token.ownerOf.callAsync(erc721MakerTokenId); expect(ownerMakerAsset).to.be.bignumber.equal(makerAddress); @@ -419,7 +398,7 @@ describe('Asset Transfer Proxies', () => { const amount = new BigNumber(500); return expectRevertOrAlwaysFailingTransactionAsync( erc721Proxy.transferFrom.sendTransactionAsync( - encodedProxyMetadata, + encodedAssetData, makerAddress, takerAddress, amount, @@ -430,10 +409,7 @@ describe('Asset Transfer Proxies', () => { it('should throw if allowances are too low', async () => { // Construct metadata for ERC721 proxy - const encodedProxyMetadata = assetProxyUtils.encodeERC721ProxyData( - erc721Token.address, - erc721MakerTokenId, - ); + const encodedAssetData = assetProxyUtils.encodeERC721AssetData(erc721Token.address, erc721MakerTokenId); // Remove transfer approval for makerAddress. await web3Wrapper.awaitTransactionSuccessAsync( await erc721Token.setApprovalForAll.sendTransactionAsync(erc721Proxy.address, false, { @@ -444,29 +420,20 @@ describe('Asset Transfer Proxies', () => { // Perform a transfer; expect this to fail. const amount = new BigNumber(1); return expectRevertOrAlwaysFailingTransactionAsync( - erc20Proxy.transferFrom.sendTransactionAsync( - encodedProxyMetadata, - makerAddress, - takerAddress, - amount, - { - from: notAuthorized, - }, - ), + erc20Proxy.transferFrom.sendTransactionAsync(encodedAssetData, makerAddress, takerAddress, amount, { + from: notAuthorized, + }), ); }); it('should throw if requesting address is not authorized', async () => { // Construct metadata for ERC721 proxy - const encodedProxyMetadata = assetProxyUtils.encodeERC721ProxyData( - erc721Token.address, - erc721MakerTokenId, - ); + const encodedAssetData = assetProxyUtils.encodeERC721AssetData(erc721Token.address, erc721MakerTokenId); // Perform a transfer from makerAddress to takerAddress const amount = new BigNumber(1); return expectRevertOrAlwaysFailingTransactionAsync( erc721Proxy.transferFrom.sendTransactionAsync( - encodedProxyMetadata, + encodedAssetData, makerAddress, takerAddress, amount, @@ -482,16 +449,16 @@ describe('Asset Transfer Proxies', () => { const [makerTokenIdA, makerTokenIdB] = erc721TokensById[makerAddress][erc721Token.address]; const numTransfers = 2; - const assetMetadata = [ - assetProxyUtils.encodeERC721ProxyData(erc721Token.address, makerTokenIdA), - assetProxyUtils.encodeERC721ProxyData(erc721Token.address, makerTokenIdB), + const assetData = [ + assetProxyUtils.encodeERC721AssetData(erc721Token.address, makerTokenIdA), + assetProxyUtils.encodeERC721AssetData(erc721Token.address, makerTokenIdB), ]; const fromAddresses = _.times(numTransfers, () => makerAddress); const toAddresses = _.times(numTransfers, () => takerAddress); const amounts = _.times(numTransfers, () => new BigNumber(1)); const txHash = await erc721Proxy.batchTransferFrom.sendTransactionAsync( - assetMetadata, + assetData, fromAddresses, toAddresses, amounts, @@ -514,9 +481,9 @@ describe('Asset Transfer Proxies', () => { const [makerTokenIdA, makerTokenIdB] = erc721TokensById[makerAddress][erc721Token.address]; const numTransfers = 2; - const assetMetadata = [ - assetProxyUtils.encodeERC721ProxyData(erc721Token.address, makerTokenIdA), - assetProxyUtils.encodeERC721ProxyData(erc721Token.address, makerTokenIdB), + const assetData = [ + assetProxyUtils.encodeERC721AssetData(erc721Token.address, makerTokenIdA), + assetProxyUtils.encodeERC721AssetData(erc721Token.address, makerTokenIdB), ]; const fromAddresses = _.times(numTransfers, () => makerAddress); const toAddresses = _.times(numTransfers, () => takerAddress); @@ -524,7 +491,7 @@ describe('Asset Transfer Proxies', () => { return expectRevertOrAlwaysFailingTransactionAsync( erc721Proxy.batchTransferFrom.sendTransactionAsync( - assetMetadata, + encodedAssetData, fromAddresses, toAddresses, amounts, diff --git a/packages/contracts/test/exchange/core.ts b/packages/contracts/test/exchange/core.ts index bee74cca8..8d3c3a940 100644 --- a/packages/contracts/test/exchange/core.ts +++ b/packages/contracts/test/exchange/core.ts @@ -87,7 +87,7 @@ describe('Exchange core', () => { artifacts.Exchange, provider, txDefaults, - assetProxyUtils.encodeERC20ProxyData(zrxToken.address), + assetProxyUtils.encodeERC20AssetData(zrxToken.address), ); exchangeWrapper = new ExchangeWrapper(exchange, provider); await exchangeWrapper.registerAssetProxyAsync(AssetProxyId.ERC20, erc20Proxy.address, owner); @@ -114,8 +114,8 @@ describe('Exchange core', () => { exchangeAddress: exchange.address, makerAddress, feeRecipientAddress, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultMakerAssetAddress), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultTakerAssetAddress), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultMakerAssetAddress), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultTakerAssetAddress), }; const privateKey = constants.TESTRPC_PRIVATE_KEYS[accounts.indexOf(makerAddress)]; orderFactory = new OrderFactory(privateKey, defaultOrderParams); @@ -711,8 +711,8 @@ describe('Exchange core', () => { signedOrder = orderFactory.newSignedOrder({ makerAssetAmount: new BigNumber(1), takerAssetAmount: new BigNumber(1), - makerAssetData: assetProxyUtils.encodeERC721ProxyData(erc721Token.address, makerAssetId), - takerAssetData: assetProxyUtils.encodeERC721ProxyData(erc721Token.address, takerAssetId), + makerAssetData: assetProxyUtils.encodeERC721AssetData(erc721Token.address, makerAssetId), + takerAssetData: assetProxyUtils.encodeERC721AssetData(erc721Token.address, takerAssetId), }); // Verify pre-conditions const initialOwnerMakerAsset = await erc721Token.ownerOf.callAsync(makerAssetId); @@ -737,8 +737,8 @@ describe('Exchange core', () => { signedOrder = orderFactory.newSignedOrder({ makerAssetAmount: new BigNumber(1), takerAssetAmount: new BigNumber(1), - makerAssetData: assetProxyUtils.encodeERC721ProxyData(erc721Token.address, makerAssetId), - takerAssetData: assetProxyUtils.encodeERC721ProxyData(erc721Token.address, takerAssetId), + makerAssetData: assetProxyUtils.encodeERC721AssetData(erc721Token.address, makerAssetId), + takerAssetData: assetProxyUtils.encodeERC721AssetData(erc721Token.address, takerAssetId), }); // Verify pre-conditions const initialOwnerMakerAsset = await erc721Token.ownerOf.callAsync(makerAssetId); @@ -759,8 +759,8 @@ describe('Exchange core', () => { signedOrder = orderFactory.newSignedOrder({ makerAssetAmount: new BigNumber(1), takerAssetAmount: new BigNumber(1), - makerAssetData: assetProxyUtils.encodeERC721ProxyData(erc721Token.address, makerAssetId), - takerAssetData: assetProxyUtils.encodeERC721ProxyData(erc721Token.address, takerAssetId), + makerAssetData: assetProxyUtils.encodeERC721AssetData(erc721Token.address, makerAssetId), + takerAssetData: assetProxyUtils.encodeERC721AssetData(erc721Token.address, takerAssetId), }); // Verify pre-conditions const initialOwnerMakerAsset = await erc721Token.ownerOf.callAsync(makerAssetId); @@ -781,8 +781,8 @@ describe('Exchange core', () => { signedOrder = orderFactory.newSignedOrder({ makerAssetAmount: new BigNumber(2), takerAssetAmount: new BigNumber(1), - makerAssetData: assetProxyUtils.encodeERC721ProxyData(erc721Token.address, makerAssetId), - takerAssetData: assetProxyUtils.encodeERC721ProxyData(erc721Token.address, takerAssetId), + makerAssetData: assetProxyUtils.encodeERC721AssetData(erc721Token.address, makerAssetId), + takerAssetData: assetProxyUtils.encodeERC721AssetData(erc721Token.address, takerAssetId), }); // Verify pre-conditions const initialOwnerMakerAsset = await erc721Token.ownerOf.callAsync(makerAssetId); @@ -803,8 +803,8 @@ describe('Exchange core', () => { signedOrder = orderFactory.newSignedOrder({ makerAssetAmount: new BigNumber(1), takerAssetAmount: new BigNumber(500), - makerAssetData: assetProxyUtils.encodeERC721ProxyData(erc721Token.address, makerAssetId), - takerAssetData: assetProxyUtils.encodeERC721ProxyData(erc721Token.address, takerAssetId), + makerAssetData: assetProxyUtils.encodeERC721AssetData(erc721Token.address, makerAssetId), + takerAssetData: assetProxyUtils.encodeERC721AssetData(erc721Token.address, takerAssetId), }); // Verify pre-conditions const initialOwnerMakerAsset = await erc721Token.ownerOf.callAsync(makerAssetId); @@ -825,8 +825,8 @@ describe('Exchange core', () => { signedOrder = orderFactory.newSignedOrder({ makerAssetAmount: new BigNumber(1), takerAssetAmount: new BigNumber(0), - makerAssetData: assetProxyUtils.encodeERC721ProxyData(erc721Token.address, makerAssetId), - takerAssetData: assetProxyUtils.encodeERC721ProxyData(erc721Token.address, takerAssetId), + makerAssetData: assetProxyUtils.encodeERC721AssetData(erc721Token.address, makerAssetId), + takerAssetData: assetProxyUtils.encodeERC721AssetData(erc721Token.address, takerAssetId), }); // Verify pre-conditions const initialOwnerMakerAsset = await erc721Token.ownerOf.callAsync(makerAssetId); @@ -845,9 +845,9 @@ describe('Exchange core', () => { const makerAssetId = erc721MakerAssetIds[0]; signedOrder = orderFactory.newSignedOrder({ makerAssetAmount: new BigNumber(1), - takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(100), 18), - makerAssetData: assetProxyUtils.encodeERC721ProxyData(erc721Token.address, makerAssetId), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultTakerAssetAddress), + takerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(100), 18), + makerAssetData: assetProxyUtils.encodeERC721AssetData(erc721Token.address, makerAssetId), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultTakerAssetAddress), }); // Verify pre-conditions const initialOwnerMakerAsset = await erc721Token.ownerOf.callAsync(makerAssetId); @@ -885,9 +885,9 @@ describe('Exchange core', () => { const takerAssetId = erc721TakerAssetIds[0]; signedOrder = orderFactory.newSignedOrder({ takerAssetAmount: new BigNumber(1), - makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(100), 18), - takerAssetData: assetProxyUtils.encodeERC721ProxyData(erc721Token.address, takerAssetId), - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultMakerAssetAddress), + makerAssetAmount: ZeroEx.toBaseUnitAmount(new BigNumber(100), 18), + takerAssetData: assetProxyUtils.encodeERC721AssetData(erc721Token.address, takerAssetId), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultMakerAssetAddress), }); // Verify pre-conditions const initialOwnerTakerAsset = await erc721Token.ownerOf.callAsync(takerAssetId); diff --git a/packages/contracts/test/exchange/dispatcher.ts b/packages/contracts/test/exchange/dispatcher.ts index 02d43a132..9e113e47d 100644 --- a/packages/contracts/test/exchange/dispatcher.ts +++ b/packages/contracts/test/exchange/dispatcher.ts @@ -275,13 +275,13 @@ describe('AssetProxyDispatcher', () => { constants.AWAIT_TRANSACTION_MINED_MS, ); // Construct metadata for ERC20 proxy - const encodedProxyMetadata = assetProxyUtils.encodeERC20ProxyData(zrxToken.address); + const encodedAssetData = assetProxyUtils.encodeERC20AssetData(zrxToken.address); // Perform a transfer from makerAddress to takerAddress const erc20Balances = await erc20Wrapper.getBalancesAsync(); const amount = new BigNumber(10); await web3Wrapper.awaitTransactionSuccessAsync( await assetProxyDispatcher.publicDispatchTransferFrom.sendTransactionAsync( - encodedProxyMetadata, + encodedAssetData, makerAddress, takerAddress, amount, @@ -301,12 +301,12 @@ describe('AssetProxyDispatcher', () => { it('should throw if dispatching to unregistered proxy', async () => { // Construct metadata for ERC20 proxy - const encodedProxyMetadata = assetProxyUtils.encodeERC20ProxyData(zrxToken.address); + const encodedAssetData = assetProxyUtils.encodeERC20AssetData(zrxToken.address); // Perform a transfer from makerAddress to takerAddress const amount = new BigNumber(10); return expectRevertOrAlwaysFailingTransactionAsync( assetProxyDispatcher.publicDispatchTransferFrom.sendTransactionAsync( - encodedProxyMetadata, + encodedAssetData, makerAddress, takerAddress, amount, diff --git a/packages/contracts/test/exchange/libs.ts b/packages/contracts/test/exchange/libs.ts index b12934014..eff05981d 100644 --- a/packages/contracts/test/exchange/libs.ts +++ b/packages/contracts/test/exchange/libs.ts @@ -38,8 +38,8 @@ describe('Exchange libs', () => { exchangeAddress: libs.address, makerAddress, feeRecipientAddress: addressUtils.generatePseudoRandomAddress(), - makerAssetData: assetProxyUtils.encodeERC20ProxyData(addressUtils.generatePseudoRandomAddress()), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(addressUtils.generatePseudoRandomAddress()), + makerAssetData: assetProxyUtils.encodeERC20AssetData(addressUtils.generatePseudoRandomAddress()), + takerAssetData: assetProxyUtils.encodeERC20AssetData(addressUtils.generatePseudoRandomAddress()), }; const privateKey = constants.TESTRPC_PRIVATE_KEYS[accounts.indexOf(makerAddress)]; orderFactory = new OrderFactory(privateKey, defaultOrderParams); diff --git a/packages/contracts/test/exchange/match_orders.ts b/packages/contracts/test/exchange/match_orders.ts index aab3308ae..f34cbee1b 100644 --- a/packages/contracts/test/exchange/match_orders.ts +++ b/packages/contracts/test/exchange/match_orders.ts @@ -96,7 +96,7 @@ describe('matchOrders', () => { artifacts.Exchange, provider, txDefaults, - assetProxyUtils.encodeERC20ProxyData(zrxToken.address), + assetProxyUtils.encodeERC20AssetData(zrxToken.address), ); exchangeWrapper = new ExchangeWrapper(exchange, provider); await exchangeWrapper.registerAssetProxyAsync(AssetProxyId.ERC20, erc20Proxy.address, owner); @@ -122,8 +122,8 @@ describe('matchOrders', () => { const defaultOrderParams = { ...constants.STATIC_ORDER_PARAMS, exchangeAddress: exchange.address, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress), }; const privateKeyLeft = constants.TESTRPC_PRIVATE_KEYS[accounts.indexOf(makerAddressLeft)]; orderFactoryLeft = new OrderFactory(privateKeyLeft, defaultOrderParams); @@ -148,16 +148,16 @@ describe('matchOrders', () => { // Create orders to match const signedOrderLeft = orderFactoryLeft.newSignedOrder({ makerAddress: makerAddressLeft, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress), makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(5), 18), takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), feeRecipientAddress: feeRecipientAddressLeft, }); const signedOrderRight = orderFactoryRight.newSignedOrder({ makerAddress: makerAddressRight, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress), makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18), feeRecipientAddress: feeRecipientAddressRight, @@ -182,16 +182,16 @@ describe('matchOrders', () => { // Create orders to match const signedOrderLeft = orderFactoryLeft.newSignedOrder({ makerAddress: makerAddressLeft, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress), makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(5), 18), takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), feeRecipientAddress: feeRecipientAddressLeft, }); const signedOrderRight = orderFactoryRight.newSignedOrder({ makerAddress: makerAddressRight, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress), makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(5), 18), feeRecipientAddress: feeRecipientAddressRight, @@ -227,16 +227,16 @@ describe('matchOrders', () => { // Create orders to match const signedOrderLeft = orderFactoryLeft.newSignedOrder({ makerAddress: makerAddressLeft, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress), makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(5), 18), takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), feeRecipientAddress: feeRecipientAddressLeft, }); const signedOrderRight = orderFactoryRight.newSignedOrder({ makerAddress: makerAddressRight, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress), makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(20), 18), takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(4), 18), feeRecipientAddress: feeRecipientAddressRight, @@ -261,16 +261,16 @@ describe('matchOrders', () => { // Create orders to match const signedOrderLeft = orderFactoryLeft.newSignedOrder({ makerAddress: makerAddressLeft, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress), makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(50), 18), takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(100), 18), feeRecipientAddress: feeRecipientAddressLeft, }); const signedOrderRight = orderFactoryRight.newSignedOrder({ makerAddress: makerAddressRight, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress), makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18), feeRecipientAddress: feeRecipientAddressRight, @@ -295,16 +295,16 @@ describe('matchOrders', () => { // Create orders to match const signedOrderLeft = orderFactoryLeft.newSignedOrder({ makerAddress: makerAddressLeft, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress), makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(50), 18), takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(100), 18), feeRecipientAddress: feeRecipientAddressLeft, }); const signedOrderRight = orderFactoryRight.newSignedOrder({ makerAddress: makerAddressRight, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress), makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18), feeRecipientAddress: feeRecipientAddressRight, @@ -334,8 +334,8 @@ describe('matchOrders', () => { // branch in the contract twice for this test. const signedOrderRight2 = orderFactoryRight.newSignedOrder({ makerAddress: makerAddressRight, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress), makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(100), 18), takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(50), 18), feeRecipientAddress: feeRecipientAddressRight, @@ -364,8 +364,8 @@ describe('matchOrders', () => { // Create orders to match const signedOrderLeft = orderFactoryLeft.newSignedOrder({ makerAddress: makerAddressLeft, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress), makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18), feeRecipientAddress: feeRecipientAddressLeft, @@ -373,8 +373,8 @@ describe('matchOrders', () => { const signedOrderRight = orderFactoryRight.newSignedOrder({ makerAddress: makerAddressRight, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress), makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(50), 18), takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(100), 18), feeRecipientAddress: feeRecipientAddressRight, @@ -404,8 +404,8 @@ describe('matchOrders', () => { // branch in the contract twice for this test. const signedOrderLeft2 = orderFactoryLeft.newSignedOrder({ makerAddress: makerAddressLeft, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress), makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(100), 18), takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(50), 18), feeRecipientAddress: feeRecipientAddressLeft, @@ -437,16 +437,16 @@ describe('matchOrders', () => { const feeRecipientAddress = feeRecipientAddressLeft; const signedOrderLeft = orderFactoryLeft.newSignedOrder({ makerAddress: makerAddressLeft, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress), makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(5), 18), takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), feeRecipientAddress, }); const signedOrderRight = orderFactoryRight.newSignedOrder({ makerAddress: makerAddressRight, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress), makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18), feeRecipientAddress, @@ -465,16 +465,16 @@ describe('matchOrders', () => { // Create orders to match const signedOrderLeft = orderFactoryLeft.newSignedOrder({ makerAddress: makerAddressLeft, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress), makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(5), 18), takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), feeRecipientAddress: feeRecipientAddressLeft, }); const signedOrderRight = orderFactoryRight.newSignedOrder({ makerAddress: makerAddressRight, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress), makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18), feeRecipientAddress: feeRecipientAddressRight, @@ -494,16 +494,16 @@ describe('matchOrders', () => { // Create orders to match const signedOrderLeft = orderFactoryLeft.newSignedOrder({ makerAddress: makerAddressLeft, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress), makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(5), 18), takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), feeRecipientAddress: feeRecipientAddressLeft, }); const signedOrderRight = orderFactoryRight.newSignedOrder({ makerAddress: makerAddressRight, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress), makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18), feeRecipientAddress: feeRecipientAddressRight, @@ -523,16 +523,16 @@ describe('matchOrders', () => { // Create orders to match const signedOrderLeft = orderFactoryLeft.newSignedOrder({ makerAddress: makerAddressLeft, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress), makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(5), 18), takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), feeRecipientAddress: feeRecipientAddressLeft, }); const signedOrderRight = orderFactoryRight.newSignedOrder({ makerAddress: makerAddressRight, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress), makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18), feeRecipientAddress: feeRecipientAddressRight, @@ -552,16 +552,16 @@ describe('matchOrders', () => { // Create orders to match const signedOrderLeft = orderFactoryLeft.newSignedOrder({ makerAddress: makerAddressLeft, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress), makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(5), 18), takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), feeRecipientAddress: feeRecipientAddressLeft, }); const signedOrderRight = orderFactoryRight.newSignedOrder({ makerAddress: makerAddressRight, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress), makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18), feeRecipientAddress: feeRecipientAddressRight, @@ -581,16 +581,16 @@ describe('matchOrders', () => { // Create orders to match const signedOrderLeft = orderFactoryLeft.newSignedOrder({ makerAddress: makerAddressLeft, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress), makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(5), 18), takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), feeRecipientAddress: makerAddressLeft, }); const signedOrderRight = orderFactoryRight.newSignedOrder({ makerAddress: makerAddressRight, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress), makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18), feeRecipientAddress: makerAddressRight, @@ -609,16 +609,16 @@ describe('matchOrders', () => { // Create orders to match const signedOrderLeft = orderFactoryLeft.newSignedOrder({ makerAddress: makerAddressLeft, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress), makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(5), 18), takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), feeRecipientAddress: feeRecipientAddressLeft, }); const signedOrderRight = orderFactoryRight.newSignedOrder({ makerAddress: makerAddressRight, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress), makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18), feeRecipientAddress: feeRecipientAddressRight, @@ -635,16 +635,16 @@ describe('matchOrders', () => { // Create orders to match const signedOrderLeft = orderFactoryLeft.newSignedOrder({ makerAddress: makerAddressLeft, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress), makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(5), 18), takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), feeRecipientAddress: feeRecipientAddressLeft, }); const signedOrderRight = orderFactoryRight.newSignedOrder({ makerAddress: makerAddressRight, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress), makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18), feeRecipientAddress: feeRecipientAddressRight, @@ -661,16 +661,16 @@ describe('matchOrders', () => { // Create orders to match const signedOrderLeft = orderFactoryLeft.newSignedOrder({ makerAddress: makerAddressLeft, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress), makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(5), 18), takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(100), 18), feeRecipientAddress: feeRecipientAddressLeft, }); const signedOrderRight = orderFactoryRight.newSignedOrder({ makerAddress: makerAddressRight, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress), makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(1), 18), takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(200), 18), feeRecipientAddress: feeRecipientAddressRight, @@ -691,16 +691,16 @@ describe('matchOrders', () => { // Create orders to match const signedOrderLeft = orderFactoryLeft.newSignedOrder({ makerAddress: makerAddressLeft, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress), makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(5), 18), takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), feeRecipientAddress: feeRecipientAddressLeft, }); const signedOrderRight = orderFactoryRight.newSignedOrder({ makerAddress: makerAddressRight, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress), makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18), feeRecipientAddress: feeRecipientAddressRight, @@ -721,16 +721,16 @@ describe('matchOrders', () => { // Create orders to match const signedOrderLeft = orderFactoryLeft.newSignedOrder({ makerAddress: makerAddressLeft, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress), makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(5), 18), takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), feeRecipientAddress: feeRecipientAddressLeft, }); const signedOrderRight = orderFactoryRight.newSignedOrder({ makerAddress: makerAddressRight, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress), makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18), feeRecipientAddress: feeRecipientAddressRight, @@ -752,16 +752,16 @@ describe('matchOrders', () => { const erc721TokenToTransfer = erc721LeftMakerAssetIds[0]; const signedOrderLeft = orderFactoryLeft.newSignedOrder({ makerAddress: makerAddressLeft, - makerAssetData: assetProxyUtils.encodeERC721ProxyData(defaultERC721AssetAddress, erc721TokenToTransfer), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), + makerAssetData: assetProxyUtils.encodeERC721AssetData(defaultERC721AssetAddress, erc721TokenToTransfer), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress), makerAssetAmount: new BigNumber(1), takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), feeRecipientAddress: feeRecipientAddressLeft, }); const signedOrderRight = orderFactoryRight.newSignedOrder({ makerAddress: makerAddressRight, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20TakerAssetAddress), - takerAssetData: assetProxyUtils.encodeERC721ProxyData(defaultERC721AssetAddress, erc721TokenToTransfer), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress), + takerAssetData: assetProxyUtils.encodeERC721AssetData(defaultERC721AssetAddress, erc721TokenToTransfer), makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), takerAssetAmount: new BigNumber(1), feeRecipientAddress: feeRecipientAddressRight, @@ -787,16 +787,16 @@ describe('matchOrders', () => { const erc721TokenToTransfer = erc721RightMakerAssetIds[0]; const signedOrderLeft = orderFactoryLeft.newSignedOrder({ makerAddress: makerAddressLeft, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), - takerAssetData: assetProxyUtils.encodeERC721ProxyData(defaultERC721AssetAddress, erc721TokenToTransfer), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress), + takerAssetData: assetProxyUtils.encodeERC721AssetData(defaultERC721AssetAddress, erc721TokenToTransfer), makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), takerAssetAmount: new BigNumber(1), feeRecipientAddress: feeRecipientAddressLeft, }); const signedOrderRight = orderFactoryRight.newSignedOrder({ makerAddress: makerAddressRight, - makerAssetData: assetProxyUtils.encodeERC721ProxyData(defaultERC721AssetAddress, erc721TokenToTransfer), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultERC20MakerAssetAddress), + makerAssetData: assetProxyUtils.encodeERC721AssetData(defaultERC721AssetAddress, erc721TokenToTransfer), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress), makerAssetAmount: new BigNumber(1), takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18), feeRecipientAddress: feeRecipientAddressRight, diff --git a/packages/contracts/test/exchange/signature_validator.ts b/packages/contracts/test/exchange/signature_validator.ts index 79db620b4..c39fd6ee4 100644 --- a/packages/contracts/test/exchange/signature_validator.ts +++ b/packages/contracts/test/exchange/signature_validator.ts @@ -42,8 +42,8 @@ describe('MixinSignatureValidator', () => { exchangeAddress: signatureValidator.address, makerAddress, feeRecipientAddress: addressUtils.generatePseudoRandomAddress(), - makerAssetData: assetProxyUtils.encodeERC20ProxyData(addressUtils.generatePseudoRandomAddress()), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(addressUtils.generatePseudoRandomAddress()), + makerAssetData: assetProxyUtils.encodeERC20AssetData(addressUtils.generatePseudoRandomAddress()), + takerAssetData: assetProxyUtils.encodeERC20AssetData(addressUtils.generatePseudoRandomAddress()), }; const privateKey = constants.TESTRPC_PRIVATE_KEYS[accounts.indexOf(makerAddress)]; orderFactory = new OrderFactory(privateKey, defaultOrderParams); diff --git a/packages/contracts/test/exchange/transactions.ts b/packages/contracts/test/exchange/transactions.ts index 7897fa558..8c5bc7bec 100644 --- a/packages/contracts/test/exchange/transactions.ts +++ b/packages/contracts/test/exchange/transactions.ts @@ -72,7 +72,7 @@ describe('Exchange transactions', () => { artifacts.Exchange, provider, txDefaults, - assetProxyUtils.encodeERC20ProxyData(zrxToken.address), + assetProxyUtils.encodeERC20AssetData(zrxToken.address), ); exchangeWrapper = new ExchangeWrapper(exchange, provider); await exchangeWrapper.registerAssetProxyAsync(AssetProxyId.ERC20, erc20Proxy.address, owner); @@ -91,8 +91,8 @@ describe('Exchange transactions', () => { exchangeAddress: exchange.address, makerAddress, feeRecipientAddress, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultMakerTokenAddress), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultTakerTokenAddress), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultMakerTokenAddress), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultTakerTokenAddress), }; makerPrivateKey = constants.TESTRPC_PRIVATE_KEYS[accounts.indexOf(makerAddress)]; takerPrivateKey = constants.TESTRPC_PRIVATE_KEYS[accounts.indexOf(takerAddress)]; diff --git a/packages/contracts/test/exchange/wrapper.ts b/packages/contracts/test/exchange/wrapper.ts index 258e1ff81..b66cff90a 100644 --- a/packages/contracts/test/exchange/wrapper.ts +++ b/packages/contracts/test/exchange/wrapper.ts @@ -81,7 +81,7 @@ describe('Exchange wrappers', () => { artifacts.Exchange, provider, txDefaults, - assetProxyUtils.encodeERC20ProxyData(zrxToken.address), + assetProxyUtils.encodeERC20AssetData(zrxToken.address), ); exchangeWrapper = new ExchangeWrapper(exchange, provider); await exchangeWrapper.registerAssetProxyAsync(AssetProxyId.ERC20, erc20Proxy.address, owner); @@ -108,8 +108,8 @@ describe('Exchange wrappers', () => { exchangeAddress: exchange.address, makerAddress, feeRecipientAddress, - makerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultMakerAssetAddress), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(defaultTakerAssetAddress), + makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultMakerAssetAddress), + takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultTakerAssetAddress), }; const privateKey = constants.TESTRPC_PRIVATE_KEYS[accounts.indexOf(makerAddress)]; orderFactory = new OrderFactory(privateKey, defaultOrderParams); @@ -304,7 +304,7 @@ describe('Exchange wrappers', () => { const signedOrder = orderFactory.newSignedOrder({ makerAssetAmount: makerZRXBalance, makerFee: new BigNumber(1), - makerAssetData: assetProxyUtils.encodeERC20ProxyData(zrxToken.address), + makerAssetData: assetProxyUtils.encodeERC20AssetData(zrxToken.address), }); await exchangeWrapper.fillOrderNoThrowAsync(signedOrder, takerAddress); const newBalances = await erc20Wrapper.getBalancesAsync(); @@ -316,7 +316,7 @@ describe('Exchange wrappers', () => { const signedOrder = orderFactory.newSignedOrder({ makerAssetAmount: new BigNumber(makerZRXAllowance), makerFee: new BigNumber(1), - makerAssetData: assetProxyUtils.encodeERC20ProxyData(zrxToken.address), + makerAssetData: assetProxyUtils.encodeERC20AssetData(zrxToken.address), }); await exchangeWrapper.fillOrderNoThrowAsync(signedOrder, takerAddress); const newBalances = await erc20Wrapper.getBalancesAsync(); @@ -328,7 +328,7 @@ describe('Exchange wrappers', () => { const signedOrder = orderFactory.newSignedOrder({ takerAssetAmount: takerZRXBalance, takerFee: new BigNumber(1), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(zrxToken.address), + takerAssetData: assetProxyUtils.encodeERC20AssetData(zrxToken.address), }); await exchangeWrapper.fillOrderNoThrowAsync(signedOrder, takerAddress); const newBalances = await erc20Wrapper.getBalancesAsync(); @@ -340,7 +340,7 @@ describe('Exchange wrappers', () => { const signedOrder = orderFactory.newSignedOrder({ takerAssetAmount: new BigNumber(takerZRXAllowance), takerFee: new BigNumber(1), - takerAssetData: assetProxyUtils.encodeERC20ProxyData(zrxToken.address), + takerAssetData: assetProxyUtils.encodeERC20AssetData(zrxToken.address), }); await exchangeWrapper.fillOrderNoThrowAsync(signedOrder, takerAddress); const newBalances = await erc20Wrapper.getBalancesAsync(); @@ -354,8 +354,8 @@ describe('Exchange wrappers', () => { const signedOrder = orderFactory.newSignedOrder({ makerAssetAmount: new BigNumber(1), takerAssetAmount: new BigNumber(1), - makerAssetData: assetProxyUtils.encodeERC721ProxyData(erc721Token.address, makerAssetId), - takerAssetData: assetProxyUtils.encodeERC721ProxyData(erc721Token.address, takerAssetId), + makerAssetData: assetProxyUtils.encodeERC721AssetData(erc721Token.address, makerAssetId), + takerAssetData: assetProxyUtils.encodeERC721AssetData(erc721Token.address, takerAssetId), }); // Verify pre-conditions const initialOwnerMakerAsset = await erc721Token.ownerOf.callAsync(makerAssetId); @@ -692,7 +692,7 @@ describe('Exchange wrappers', () => { signedOrders = [ orderFactory.newSignedOrder(), orderFactory.newSignedOrder({ - takerAssetData: assetProxyUtils.encodeERC20ProxyData(zrxToken.address), + takerAssetData: assetProxyUtils.encodeERC20AssetData(zrxToken.address), }), orderFactory.newSignedOrder(), ]; @@ -785,7 +785,7 @@ describe('Exchange wrappers', () => { signedOrders = [ orderFactory.newSignedOrder(), orderFactory.newSignedOrder({ - takerAssetData: assetProxyUtils.encodeERC20ProxyData(zrxToken.address), + takerAssetData: assetProxyUtils.encodeERC20AssetData(zrxToken.address), }), orderFactory.newSignedOrder(), ]; @@ -874,7 +874,7 @@ describe('Exchange wrappers', () => { signedOrders = [ orderFactory.newSignedOrder(), orderFactory.newSignedOrder({ - makerAssetData: assetProxyUtils.encodeERC20ProxyData(zrxToken.address), + makerAssetData: assetProxyUtils.encodeERC20AssetData(zrxToken.address), }), orderFactory.newSignedOrder(), ]; @@ -967,7 +967,7 @@ describe('Exchange wrappers', () => { signedOrders = [ orderFactory.newSignedOrder(), orderFactory.newSignedOrder({ - makerAssetData: assetProxyUtils.encodeERC20ProxyData(zrxToken.address), + makerAssetData: assetProxyUtils.encodeERC20AssetData(zrxToken.address), }), orderFactory.newSignedOrder(), ]; |