diff options
author | Fabio Berger <me@fabioberger.com> | 2018-06-26 14:07:37 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-06-26 14:07:37 +0800 |
commit | e051743a3d9b92c8a5b275dc5843b98c37830b8c (patch) | |
tree | bcf434332365afe773ab5f6cef2e6e42356e8258 /packages/contracts/test/exchange | |
parent | f811c07454c87775f18374e8d955583dc157627f (diff) | |
parent | cba92a01b6dee208b497817445b7ae4048e299c0 (diff) | |
download | dexon-0x-contracts-e051743a3d9b92c8a5b275dc5843b98c37830b8c.tar.gz dexon-0x-contracts-e051743a3d9b92c8a5b275dc5843b98c37830b8c.tar.zst dexon-0x-contracts-e051743a3d9b92c8a5b275dc5843b98c37830b8c.zip |
Merge branch 'v2-prototype' into refactor/check-revert-reasons
* v2-prototype: (21 commits)
Don't use variables for revert reasons
Add comments to dispatchTransferFrom
Document IAssetData
Compute bytes4 proxyid constants
Return inplace bytes in LibBytes.readBytesWithLength
Add Greg's documentation to MixinErc721Transfer
Add Greg's documentation to MixinErc20Transfer
Gas golf the transfer success logic
Optimize like in PR #767
Run prettier and fix linting errors
Fix tests
Update tests
Fix AssetProxyUtils
Update tests
Fix ERC721Proxy TokenId
Update AssetProxyUtils
Add IAssetData
WIP
ABI encoded asset data
Remove proxyId argument from dispatchTransferFrom
...
# Conflicts:
# packages/contracts/test/asset_proxy/proxies.ts
Diffstat (limited to 'packages/contracts/test/exchange')
-rw-r--r-- | packages/contracts/test/exchange/core.ts | 2 | ||||
-rw-r--r-- | packages/contracts/test/exchange/dispatcher.ts | 9 | ||||
-rw-r--r-- | packages/contracts/test/exchange/match_orders.ts | 2 | ||||
-rw-r--r-- | packages/contracts/test/exchange/transactions.ts | 2 | ||||
-rw-r--r-- | packages/contracts/test/exchange/wrapper.ts | 2 |
5 files changed, 7 insertions, 10 deletions
diff --git a/packages/contracts/test/exchange/core.ts b/packages/contracts/test/exchange/core.ts index 3b8a369b4..c83041638 100644 --- a/packages/contracts/test/exchange/core.ts +++ b/packages/contracts/test/exchange/core.ts @@ -89,7 +89,7 @@ describe('Exchange core', () => { artifacts.Exchange, provider, txDefaults, - zrxToken.address, + assetProxyUtils.encodeERC20AssetData(zrxToken.address), ); exchangeWrapper = new ExchangeWrapper(exchange, provider); await exchangeWrapper.registerAssetProxyAsync(AssetProxyId.ERC20, erc20Proxy.address, owner); diff --git a/packages/contracts/test/exchange/dispatcher.ts b/packages/contracts/test/exchange/dispatcher.ts index cf73d274b..495f6d3c8 100644 --- a/packages/contracts/test/exchange/dispatcher.ts +++ b/packages/contracts/test/exchange/dispatcher.ts @@ -279,14 +279,13 @@ describe('AssetProxyDispatcher', () => { ); // Construct metadata for ERC20 proxy const encodedAssetData = assetProxyUtils.encodeERC20AssetData(zrxToken.address); - const encodedAssetDataWithoutProxyId = encodedAssetData.slice(0, -2); + // Perform a transfer from makerAddress to takerAddress const erc20Balances = await erc20Wrapper.getBalancesAsync(); const amount = new BigNumber(10); await web3Wrapper.awaitTransactionSuccessAsync( await assetProxyDispatcher.publicDispatchTransferFrom.sendTransactionAsync( - encodedAssetDataWithoutProxyId, - AssetProxyId.ERC20, + encodedAssetData, makerAddress, takerAddress, amount, @@ -307,13 +306,11 @@ describe('AssetProxyDispatcher', () => { it('should throw if dispatching to unregistered proxy', async () => { // Construct metadata for ERC20 proxy const encodedAssetData = assetProxyUtils.encodeERC20AssetData(zrxToken.address); - const encodedAssetDataWithoutProxyId = encodedAssetData.slice(0, -2); // Perform a transfer from makerAddress to takerAddress const amount = new BigNumber(10); return expectRevertReasonOrAlwaysFailingTransactionAsync( assetProxyDispatcher.publicDispatchTransferFrom.sendTransactionAsync( - encodedAssetDataWithoutProxyId, - AssetProxyId.ERC20, + encodedAssetData, makerAddress, takerAddress, amount, diff --git a/packages/contracts/test/exchange/match_orders.ts b/packages/contracts/test/exchange/match_orders.ts index 324cf319f..6f4feb8b7 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, - zrxToken.address, + assetProxyUtils.encodeERC20AssetData(zrxToken.address), ); exchangeWrapper = new ExchangeWrapper(exchange, provider); await exchangeWrapper.registerAssetProxyAsync(AssetProxyId.ERC20, erc20Proxy.address, owner); diff --git a/packages/contracts/test/exchange/transactions.ts b/packages/contracts/test/exchange/transactions.ts index 8d4799109..44ed98c53 100644 --- a/packages/contracts/test/exchange/transactions.ts +++ b/packages/contracts/test/exchange/transactions.ts @@ -79,7 +79,7 @@ describe('Exchange transactions', () => { artifacts.Exchange, provider, txDefaults, - zrxToken.address, + assetProxyUtils.encodeERC20AssetData(zrxToken.address), ); exchangeWrapper = new ExchangeWrapper(exchange, provider); await exchangeWrapper.registerAssetProxyAsync(AssetProxyId.ERC20, erc20Proxy.address, owner); diff --git a/packages/contracts/test/exchange/wrapper.ts b/packages/contracts/test/exchange/wrapper.ts index 3ea197395..a4ba54904 100644 --- a/packages/contracts/test/exchange/wrapper.ts +++ b/packages/contracts/test/exchange/wrapper.ts @@ -80,7 +80,7 @@ describe('Exchange wrappers', () => { artifacts.Exchange, provider, txDefaults, - zrxToken.address, + assetProxyUtils.encodeERC20AssetData(zrxToken.address), ); exchangeWrapper = new ExchangeWrapper(exchange, provider); await exchangeWrapper.registerAssetProxyAsync(AssetProxyId.ERC20, erc20Proxy.address, owner); |