aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/test/exchange
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-06-26 14:13:59 +0800
committerFabio Berger <me@fabioberger.com>2018-06-26 14:13:59 +0800
commit9219f9d8ae2166c7c7b1d0a4ede78890094a3831 (patch)
tree85f1d4cb4b8a4dbcc8491c93cdbfafbf6cf00edc /packages/contracts/test/exchange
parentfb03003b3a9e7beb1054a50bad4320e60ca52e04 (diff)
parentcba92a01b6dee208b497817445b7ae4048e299c0 (diff)
downloaddexon-sol-tools-9219f9d8ae2166c7c7b1d0a4ede78890094a3831.tar
dexon-sol-tools-9219f9d8ae2166c7c7b1d0a4ede78890094a3831.tar.gz
dexon-sol-tools-9219f9d8ae2166c7c7b1d0a4ede78890094a3831.tar.bz2
dexon-sol-tools-9219f9d8ae2166c7c7b1d0a4ede78890094a3831.tar.lz
dexon-sol-tools-9219f9d8ae2166c7c7b1d0a4ede78890094a3831.tar.xz
dexon-sol-tools-9219f9d8ae2166c7c7b1d0a4ede78890094a3831.tar.zst
dexon-sol-tools-9219f9d8ae2166c7c7b1d0a4ede78890094a3831.zip
Merge branch 'v2-prototype' into feature/combinatorial-testing
* 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.ts2
-rw-r--r--packages/contracts/test/exchange/dispatcher.ts9
-rw-r--r--packages/contracts/test/exchange/match_orders.ts2
-rw-r--r--packages/contracts/test/exchange/transactions.ts2
-rw-r--r--packages/contracts/test/exchange/wrapper.ts2
5 files changed, 7 insertions, 10 deletions
diff --git a/packages/contracts/test/exchange/core.ts b/packages/contracts/test/exchange/core.ts
index 63cbc155a..52bddf996 100644
--- a/packages/contracts/test/exchange/core.ts
+++ b/packages/contracts/test/exchange/core.ts
@@ -88,7 +88,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 59d80c6d6..41ea88d4e 100644
--- a/packages/contracts/test/exchange/dispatcher.ts
+++ b/packages/contracts/test/exchange/dispatcher.ts
@@ -282,14 +282,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,
@@ -310,13 +309,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 044108bfb..7c4ad165e 100644
--- a/packages/contracts/test/exchange/match_orders.ts
+++ b/packages/contracts/test/exchange/match_orders.ts
@@ -99,7 +99,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 6f820e673..cfabe0435 100644
--- a/packages/contracts/test/exchange/transactions.ts
+++ b/packages/contracts/test/exchange/transactions.ts
@@ -82,7 +82,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 504b78f5c..7e3203291 100644
--- a/packages/contracts/test/exchange/wrapper.ts
+++ b/packages/contracts/test/exchange/wrapper.ts
@@ -83,7 +83,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);