From 63b2ae743bd6cb4e8759659bca09e4bbdcf0cd63 Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Thu, 21 Jun 2018 16:52:01 +0200
Subject: Add command to remove all node_modules, nested and hoisted

---
 package.json | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package.json b/package.json
index 11444d16d..3436f152b 100644
--- a/package.json
+++ b/package.json
@@ -25,6 +25,7 @@
         "build": "wsrun build $PKG --fast-exit -r --stages",
         "build:monorepo_scripts": "PKG=@0xproject/monorepo-scripts yarn build",
         "clean": "wsrun clean $PKG --fast-exit -r --parallel",
+        "remove_node_modules": "lerna clean --yes; rm -rf node_modules",
         "rebuild": "run-s clean build",
         "test": "wsrun test $PKG --fast-exit --serial --exclude-missing",
         "stage_docs": "wsrun docs:stage $PKG --fast-exit --parallel --exclude-missing",
-- 
cgit 


From eaabe1586374a25439c880ada348d87a5b3df740 Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Thu, 21 Jun 2018 16:53:05 +0200
Subject: Update core tests to actually check revert message

---
 packages/contracts/src/utils/assertions.ts | 12 +++++
 packages/contracts/src/utils/types.ts      | 32 +++++++++++
 packages/contracts/test/exchange/core.ts   | 87 ++++++++++++++++++------------
 3 files changed, 97 insertions(+), 34 deletions(-)

diff --git a/packages/contracts/src/utils/assertions.ts b/packages/contracts/src/utils/assertions.ts
index 615e648f3..29489e648 100644
--- a/packages/contracts/src/utils/assertions.ts
+++ b/packages/contracts/src/utils/assertions.ts
@@ -51,6 +51,18 @@ export function expectRevertOrAlwaysFailingTransactionAsync<T>(p: Promise<T>): P
     return expectRevertOrOtherErrorAsync(p, 'always failing transaction');
 }
 
+/**
+ * Rejects if the given Promise does not reject with the given revert reason or "always
+ * failing transaction" error.
+ * @param p the Promise which is expected to reject
+ * @param reason a specific revert reason
+ * @returns a new Promise which will reject if the conditions are not met and
+ * otherwise resolve with no value.
+ */
+export function expectRevertReasonOrAlwaysFailingTransactionAsync<T>(p: Promise<T>, reason: string): PromiseLike<void> {
+    return _expectEitherErrorAsync(p, 'always failing transaction', reason);
+}
+
 /**
  * Rejects if the given Promise does not reject with a "revert" or "Contract
  * call failed" error.
diff --git a/packages/contracts/src/utils/types.ts b/packages/contracts/src/utils/types.ts
index bb8c12088..da8ea588f 100644
--- a/packages/contracts/src/utils/types.ts
+++ b/packages/contracts/src/utils/types.ts
@@ -150,3 +150,35 @@ export interface MatchOrder {
     leftSignature: string;
     rightSignature: string;
 }
+
+export enum ContractLibErrors {
+    OrderUnfillable = 'ORDER_UNFILLABLE',
+    InvalidMaker = 'INVALID_MAKER',
+    InvalidTaker = 'INVALID_TAKER',
+    InvalidSender = 'INVALID_SENDER',
+    InvalidOrderSignature = 'INVALID_ORDER_SIGNATURE',
+    InvalidTakerAmount = 'INVALID_TAKER_AMOUNT',
+    RoundingError = 'ROUNDING_ERROR',
+    InvalidSignature = 'INVALID_SIGNATURE',
+    SignatureIllegal = 'SIGNATURE_ILLEGAL',
+    SignatureUnsupported = 'SIGNATURE_UNSUPPORTED',
+    InvalidNewOrderEpoch = 'INVALID_NEW_ORDER_EPOCH',
+    CompleteFillFailed = 'COMPLETE_FILL_FAILED',
+    NegativeSpreadRequired = 'NEGATIVE_SPREAD_REQUIRED',
+    ReentrancyIllegal = 'REENTRANCY_ILLEGAL',
+    InvalidTxHash = 'INVALID_TX_HASH',
+    InvalidTxSignature = 'INVALID_TX_SIGNATURE',
+    FailedExecution = 'FAILED_EXECUTION',
+    AssetProxyMismatch = 'ASSET_PROXY_MISMATCH',
+    AssetProxyIdMismatch = 'ASSET_PROXY_ID_MISMATCH',
+    LengthGreaterThan0Required = 'LENGTH_GREATER_THAN_0_REQUIRED',
+    Length1Required = 'LENGTH_1_REQUIRED',
+    Length66Required = 'LENGTH_66_REQUIRED',
+    InvalidAmount = 'INVALID_AMOUNT',
+    TransferFailed = 'TRANSFER_FAILED',
+    SenderNotAuthorized = 'SENDER_NOT_AUTHORIZED',
+    TargetNotAuthorized = 'TARGET_NOT_AUTHORIZED',
+    TargetAlreadyAuthorized = 'TARGET_ALREADY_AUTHORIZED',
+    IndexOutOfBounds = 'INDEX_OUT_OF_BOUNDS',
+    AuthorizedAddressMismatch = 'AUTHORIZED_ADDRESS_MISMATCH',
+}
diff --git a/packages/contracts/test/exchange/core.ts b/packages/contracts/test/exchange/core.ts
index ea37a1e99..e0a9d5b92 100644
--- a/packages/contracts/test/exchange/core.ts
+++ b/packages/contracts/test/exchange/core.ts
@@ -18,14 +18,17 @@ import {
     FillContractEventArgs,
 } from '../../src/generated_contract_wrappers/exchange';
 import { artifacts } from '../../src/utils/artifacts';
-import { expectRevertOrAlwaysFailingTransactionAsync } from '../../src/utils/assertions';
+import {
+    expectRevertOrAlwaysFailingTransactionAsync,
+    expectRevertReasonOrAlwaysFailingTransactionAsync,
+} from '../../src/utils/assertions';
 import { chaiSetup } from '../../src/utils/chai_setup';
 import { constants } from '../../src/utils/constants';
 import { ERC20Wrapper } from '../../src/utils/erc20_wrapper';
 import { ERC721Wrapper } from '../../src/utils/erc721_wrapper';
 import { ExchangeWrapper } from '../../src/utils/exchange_wrapper';
 import { OrderFactory } from '../../src/utils/order_factory';
-import { ERC20BalancesByOwner } from '../../src/utils/types';
+import { ContractLibErrors, ERC20BalancesByOwner } from '../../src/utils/types';
 import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper';
 
 chaiSetup.configure();
@@ -126,7 +129,7 @@ describe('Exchange core', () => {
     afterEach(async () => {
         await blockchainLifecycle.revertAsync();
     });
-    describe('fillOrder', () => {
+    describe.only('fillOrder', () => {
         beforeEach(async () => {
             erc20Balances = await erc20Wrapper.getBalancesAsync();
             signedOrder = orderFactory.newSignedOrder();
@@ -415,8 +418,9 @@ describe('Exchange core', () => {
                 makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(100), 18),
                 takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(200), 18),
             });
-            return expectRevertOrAlwaysFailingTransactionAsync(
+            return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.fillOrderAsync(signedOrder, takerAddress),
+                ContractLibErrors.InvalidTaker,
             );
         });
 
@@ -432,8 +436,9 @@ describe('Exchange core', () => {
             const invalidSigBuff = Buffer.concat([v, invalidR, invalidS, signatureType]);
             const invalidSigHex = `0x${invalidSigBuff.toString('hex')}`;
             signedOrder.signature = invalidSigHex;
-            return expectRevertOrAlwaysFailingTransactionAsync(
+            return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.fillOrderAsync(signedOrder, takerAddress),
+                ContractLibErrors.InvalidOrderSignature,
             );
         });
 
@@ -442,8 +447,9 @@ describe('Exchange core', () => {
                 makerAssetAmount: new BigNumber(0),
             });
 
-            return expectRevertOrAlwaysFailingTransactionAsync(
+            return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.fillOrderAsync(signedOrder, takerAddress),
+                ContractLibErrors.OrderUnfillable,
             );
         });
 
@@ -452,18 +458,20 @@ describe('Exchange core', () => {
                 takerAssetAmount: new BigNumber(0),
             });
 
-            return expectRevertOrAlwaysFailingTransactionAsync(
+            return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.fillOrderAsync(signedOrder, takerAddress),
+                ContractLibErrors.OrderUnfillable,
             );
         });
 
         it('should throw if takerAssetFillAmount is 0', async () => {
             signedOrder = orderFactory.newSignedOrder();
 
-            return expectRevertOrAlwaysFailingTransactionAsync(
+            return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.fillOrderAsync(signedOrder, takerAddress, {
                     takerAssetFillAmount: new BigNumber(0),
                 }),
+                ContractLibErrors.InvalidTakerAmount,
             );
         });
 
@@ -472,8 +480,9 @@ describe('Exchange core', () => {
                 makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(100000), 18),
             });
 
-            return expectRevertOrAlwaysFailingTransactionAsync(
+            return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.fillOrderAsync(signedOrder, takerAddress),
+                ContractLibErrors.TransferFailed,
             );
         });
 
@@ -481,8 +490,9 @@ describe('Exchange core', () => {
             signedOrder = orderFactory.newSignedOrder({
                 takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(100000), 18),
             });
-            return expectRevertOrAlwaysFailingTransactionAsync(
+            return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.fillOrderAsync(signedOrder, takerAddress),
+                ContractLibErrors.TransferFailed,
             );
         });
 
@@ -493,8 +503,9 @@ describe('Exchange core', () => {
                 }),
                 constants.AWAIT_TRANSACTION_MINED_MS,
             );
-            return expectRevertOrAlwaysFailingTransactionAsync(
+            return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.fillOrderAsync(signedOrder, takerAddress),
+                ContractLibErrors.TransferFailed,
             );
         });
 
@@ -505,8 +516,9 @@ describe('Exchange core', () => {
                 }),
                 constants.AWAIT_TRANSACTION_MINED_MS,
             );
-            return expectRevertOrAlwaysFailingTransactionAsync(
+            return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.fillOrderAsync(signedOrder, takerAddress),
+                ContractLibErrors.TransferFailed,
             );
         });
 
@@ -514,16 +526,18 @@ describe('Exchange core', () => {
             signedOrder = orderFactory.newSignedOrder({
                 expirationTimeSeconds: new BigNumber(Math.floor((Date.now() - 10000) / 1000)),
             });
-            return expectRevertOrAlwaysFailingTransactionAsync(
+            return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.fillOrderAsync(signedOrder, takerAddress),
+                ContractLibErrors.OrderUnfillable,
             );
         });
 
         it('should throw if no value is filled', async () => {
             signedOrder = orderFactory.newSignedOrder();
             await exchangeWrapper.fillOrderAsync(signedOrder, takerAddress);
-            return expectRevertOrAlwaysFailingTransactionAsync(
+            return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.fillOrderAsync(signedOrder, takerAddress),
+                ContractLibErrors.OrderUnfillable,
             );
         });
     });
@@ -545,8 +559,9 @@ describe('Exchange core', () => {
                 makerAssetAmount: new BigNumber(0),
             });
 
-            return expectRevertOrAlwaysFailingTransactionAsync(
+            return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.cancelOrderAsync(signedOrder, makerAddress),
+                ContractLibErrors.OrderUnfillable,
             );
         });
 
@@ -555,17 +570,19 @@ describe('Exchange core', () => {
                 takerAssetAmount: new BigNumber(0),
             });
 
-            return expectRevertOrAlwaysFailingTransactionAsync(
+            return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.cancelOrderAsync(signedOrder, makerAddress),
+                ContractLibErrors.OrderUnfillable,
             );
         });
 
         it('should be able to cancel a full order', async () => {
             await exchangeWrapper.cancelOrderAsync(signedOrder, makerAddress);
-            return expectRevertOrAlwaysFailingTransactionAsync(
+            return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.fillOrderAsync(signedOrder, takerAddress, {
                     takerAssetFillAmount: signedOrder.takerAssetAmount.div(2),
                 }),
+                ContractLibErrors.OrderUnfillable,
             );
         });
 
@@ -585,8 +602,9 @@ describe('Exchange core', () => {
 
         it('should throw if already cancelled', async () => {
             await exchangeWrapper.cancelOrderAsync(signedOrder, makerAddress);
-            return expectRevertOrAlwaysFailingTransactionAsync(
+            return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.cancelOrderAsync(signedOrder, makerAddress),
+                ContractLibErrors.OrderUnfillable,
             );
         });
 
@@ -594,8 +612,9 @@ describe('Exchange core', () => {
             signedOrder = orderFactory.newSignedOrder({
                 expirationTimeSeconds: new BigNumber(Math.floor((Date.now() - 10000) / 1000)),
             });
-            return expectRevertOrAlwaysFailingTransactionAsync(
+            return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.cancelOrderAsync(signedOrder, makerAddress),
+                ContractLibErrors.OrderUnfillable,
             );
         });
 
@@ -611,10 +630,11 @@ describe('Exchange core', () => {
             });
 
             const fillTakerAssetAmount2 = new BigNumber(1);
-            return expectRevertOrAlwaysFailingTransactionAsync(
+            return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.fillOrderAsync(signedOrder, takerAddress, {
                     takerAssetFillAmount: fillTakerAssetAmount2,
                 }),
+                ContractLibErrors.RoundingError,
             );
         });
     });
@@ -624,16 +644,18 @@ describe('Exchange core', () => {
             const orderEpoch = new BigNumber(1);
             await exchangeWrapper.cancelOrdersUpToAsync(orderEpoch, makerAddress);
             const lesserOrderEpoch = new BigNumber(0);
-            return expectRevertOrAlwaysFailingTransactionAsync(
+            return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.cancelOrdersUpToAsync(lesserOrderEpoch, makerAddress),
+                ContractLibErrors.InvalidNewOrderEpoch,
             );
         });
 
         it('should fail to set orderEpoch equal to existing orderEpoch', async () => {
             const orderEpoch = new BigNumber(1);
             await exchangeWrapper.cancelOrdersUpToAsync(orderEpoch, makerAddress);
-            return expectRevertOrAlwaysFailingTransactionAsync(
+            return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.cancelOrdersUpToAsync(orderEpoch, makerAddress),
+                ContractLibErrors.InvalidNewOrderEpoch,
             );
         });
 
@@ -791,8 +813,9 @@ describe('Exchange core', () => {
             expect(initialOwnerTakerAsset).to.be.bignumber.equal(takerAddress);
             // Call Exchange
             const takerAssetFillAmount = signedOrder.takerAssetAmount;
-            return expectRevertOrAlwaysFailingTransactionAsync(
+            return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.fillOrderAsync(signedOrder, takerAddress, { takerAssetFillAmount }),
+                ContractLibErrors.OrderUnfillable,
             );
         });
 
@@ -813,30 +836,26 @@ describe('Exchange core', () => {
             expect(initialOwnerTakerAsset).to.be.bignumber.equal(takerAddress);
             // Call Exchange
             const takerAssetFillAmount = signedOrder.takerAssetAmount;
-            return expectRevertOrAlwaysFailingTransactionAsync(
+            return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.fillOrderAsync(signedOrder, takerAddress, { takerAssetFillAmount }),
+                ContractLibErrors.OrderUnfillable,
             );
         });
 
         it('should throw on partial fill', async () => {
             // Construct Exchange parameters
             const makerAssetId = erc721MakerAssetIds[0];
-            const takerAssetId = erc721TakerAssetIds[0];
             signedOrder = orderFactory.newSignedOrder({
                 makerAssetAmount: new BigNumber(1),
-                takerAssetAmount: new BigNumber(0),
+                takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(100), 18),
                 makerAssetData: assetProxyUtils.encodeERC721AssetData(erc721Token.address, makerAssetId),
-                takerAssetData: assetProxyUtils.encodeERC721AssetData(erc721Token.address, takerAssetId),
+                takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultTakerAssetAddress),
             });
-            // Verify pre-conditions
-            const initialOwnerMakerAsset = await erc721Token.ownerOf.callAsync(makerAssetId);
-            expect(initialOwnerMakerAsset).to.be.bignumber.equal(makerAddress);
-            const initialOwnerTakerAsset = await erc721Token.ownerOf.callAsync(takerAssetId);
-            expect(initialOwnerTakerAsset).to.be.bignumber.equal(takerAddress);
             // Call Exchange
-            const takerAssetFillAmount = signedOrder.takerAssetAmount;
-            return expectRevertOrAlwaysFailingTransactionAsync(
+            const takerAssetFillAmount = signedOrder.takerAssetAmount.div(2);
+            return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.fillOrderAsync(signedOrder, takerAddress, { takerAssetFillAmount }),
+                ContractLibErrors.RoundingError,
             );
         });
 
-- 
cgit 


From 8ff7b2405f4592614aebfa4abeb0ed9ab6c02d6b Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Thu, 21 Jun 2018 16:53:14 +0200
Subject: Update yarn.lock

---
 yarn.lock | 173 ++++++++++++++++++++++++--------------------------------------
 1 file changed, 68 insertions(+), 105 deletions(-)

diff --git a/yarn.lock b/yarn.lock
index fdb0d53e1..157b168b6 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2563,12 +2563,6 @@ commander@2.13.0, commander@~2.13.0:
   version "2.13.0"
   resolved "https://registry.yarnpkg.com/commander/-/commander-2.13.0.tgz#6964bca67685df7c1f1430c584f07d7597885b9c"
 
-commander@2.9.0:
-  version "2.9.0"
-  resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4"
-  dependencies:
-    graceful-readlink ">= 1.0.0"
-
 commander@^2.12.1, commander@^2.8.1, commander@^2.9.0:
   version "2.15.1"
   resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f"
@@ -3234,12 +3228,6 @@ debug@2.2.0:
   dependencies:
     ms "0.7.1"
 
-debug@2.6.0:
-  version "2.6.0"
-  resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.0.tgz#bc596bcabe7617f11d9fa15361eded5608b8499b"
-  dependencies:
-    ms "0.7.2"
-
 debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.6, debug@^2.6.8:
   version "2.6.9"
   resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
@@ -3509,10 +3497,6 @@ detect-node@^2.0.3:
   version "2.0.3"
   resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.0.3.tgz#a2033c09cc8e158d37748fbde7507832bd6ce127"
 
-diff@3.2.0:
-  version "3.2.0"
-  resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9"
-
 diff@3.3.1:
   version "3.3.1"
   resolved "https://registry.yarnpkg.com/diff/-/diff-3.3.1.tgz#aa8567a6eed03c531fc89d3f711cd0e5259dec75"
@@ -3950,6 +3934,18 @@ eth-block-tracker@^2.2.2, eth-block-tracker@^2.3.0:
     pify "^2.3.0"
     tape "^4.6.3"
 
+eth-block-tracker@^3.0.0:
+  version "3.0.1"
+  resolved "https://registry.yarnpkg.com/eth-block-tracker/-/eth-block-tracker-3.0.1.tgz#95cd5e763c7293e0b1b2790a2a39ac2ac188a5e1"
+  dependencies:
+    eth-query "^2.1.0"
+    ethereumjs-tx "^1.3.3"
+    ethereumjs-util "^5.1.3"
+    ethjs-util "^0.1.3"
+    json-rpc-engine "^3.6.0"
+    pify "^2.3.0"
+    tape "^4.6.3"
+
 eth-json-rpc-infura@^3.1.0:
   version "3.1.0"
   resolved "https://registry.yarnpkg.com/eth-json-rpc-infura/-/eth-json-rpc-infura-3.1.0.tgz#01b955a04d1a827b14c6cdc8a78b3a025d06a183"
@@ -4084,7 +4080,7 @@ ethereumjs-blockstream@^2.0.6:
     source-map-support "0.4.14"
     uuid "3.0.1"
 
-ethereumjs-tx@0xProject/ethereumjs-tx#fake-tx-include-signature-by-default, ethereumjs-tx@^1.0.0, ethereumjs-tx@^1.1.1, ethereumjs-tx@^1.2.0, ethereumjs-tx@^1.2.2, ethereumjs-tx@^1.3.0, ethereumjs-tx@^1.3.3:
+ethereumjs-tx@0xProject/ethereumjs-tx#fake-tx-include-signature-by-default, ethereumjs-tx@^1.0.0, ethereumjs-tx@^1.1.1, ethereumjs-tx@^1.2.0, ethereumjs-tx@^1.2.2, ethereumjs-tx@^1.3.3:
   version "1.3.4"
   resolved "https://codeload.github.com/0xProject/ethereumjs-tx/tar.gz/5f0a610849de09f922f8ccee5af1aae4bec36e51"
   dependencies:
@@ -4113,9 +4109,21 @@ ethereumjs-util@^4.0.1, ethereumjs-util@^4.4.0:
     rlp "^2.0.0"
     secp256k1 "^3.0.1"
 
-ethereumjs-vm@2.3.3:
-  version "2.3.3"
-  resolved "https://registry.yarnpkg.com/ethereumjs-vm/-/ethereumjs-vm-2.3.3.tgz#05719139e0c4a59e829022964a6048b17d2d84b0"
+ethereumjs-util@^5.2.0:
+  version "5.2.0"
+  resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz#3e0c0d1741471acf1036052d048623dee54ad642"
+  dependencies:
+    bn.js "^4.11.0"
+    create-hash "^1.1.2"
+    ethjs-util "^0.1.3"
+    keccak "^1.0.2"
+    rlp "^2.0.0"
+    safe-buffer "^5.1.1"
+    secp256k1 "^3.0.1"
+
+ethereumjs-vm@2.3.5:
+  version "2.3.5"
+  resolved "https://registry.yarnpkg.com/ethereumjs-vm/-/ethereumjs-vm-2.3.5.tgz#e69306737b8a7ea80c633ceb9b7dd561897007de"
   dependencies:
     async "^2.1.2"
     async-eventemitter "^0.2.2"
@@ -4840,8 +4848,8 @@ ganache-cli@^6.1.0:
     webpack-cli "^2.0.9"
 
 ganache-core@0xProject/ganache-core:
-  version "2.1.0"
-  resolved "https://codeload.github.com/0xProject/ganache-core/tar.gz/a5bf2cdd541beed1bae5a6e7bbab22541345dd42"
+  version "2.1.2"
+  resolved "https://codeload.github.com/0xProject/ganache-core/tar.gz/88ce33a4c33a5737ffb84af9bb8affaa4e8bf3a5"
   dependencies:
     abstract-leveldown "^3.0.0"
     async "^2.5.0"
@@ -4852,9 +4860,9 @@ ganache-core@0xProject/ganache-core:
     clone "^2.1.1"
     ethereumjs-account "~2.0.4"
     ethereumjs-block "~1.2.2"
-    ethereumjs-tx "^1.3.0"
-    ethereumjs-util "^5.1.5"
-    ethereumjs-vm "2.3.3"
+    ethereumjs-tx "0xProject/ethereumjs-tx#fake-tx-include-signature-by-default"
+    ethereumjs-util "^5.2.0"
+    ethereumjs-vm "2.3.5"
     ethereumjs-wallet "~0.6.0"
     fake-merkle-patricia-tree "~1.0.1"
     heap "~0.2.6"
@@ -4864,16 +4872,15 @@ ganache-core@0xProject/ganache-core:
     localstorage-down "^0.6.7"
     lodash "^4.17.5"
     merkle-patricia-tree "^2.2.0"
-    mocha "~3.3.0"
     pify "^3.0.0"
     prepend-file "^1.3.1"
     seedrandom "~2.4.2"
     shebang-loader "0.0.1"
-    solc "0.4.18"
+    solc "0.4.24"
     temp "^0.8.3"
     tmp "0.0.31"
-    web3 "^1.0.0-beta.30"
-    web3-provider-engine "^13.6.5"
+    web3 "^1.0.0-beta.34"
+    web3-provider-engine "^14.0.6"
     websocket "^1.0.24"
     yargs "^7.0.2"
 
@@ -5083,17 +5090,6 @@ glob2base@^0.0.12:
   dependencies:
     find-index "^0.1.1"
 
-glob@7.1.1:
-  version "7.1.1"
-  resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8"
-  dependencies:
-    fs.realpath "^1.0.0"
-    inflight "^1.0.4"
-    inherits "2"
-    minimatch "^3.0.2"
-    once "^1.3.0"
-    path-is-absolute "^1.0.0"
-
 glob@7.1.2, glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.0.6, glob@^7.1.1, glob@^7.1.2, glob@~7.1.2:
   version "7.1.2"
   resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15"
@@ -5299,10 +5295,6 @@ growl@1.10.3:
   version "1.10.3"
   resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.3.tgz#1926ba90cf3edfe2adb4927f5880bc22c66c790f"
 
-growl@1.9.2:
-  version "1.9.2"
-  resolved "https://registry.yarnpkg.com/growl/-/growl-1.9.2.tgz#0ea7743715db8d8de2c5ede1775e1b45ac85c02f"
-
 gud@^1.0.0:
   version "1.0.0"
   resolved "https://registry.npmjs.org/gud/-/gud-1.0.0.tgz#a489581b17e6a70beca9abe3ae57de7a499852c0"
@@ -6565,7 +6557,7 @@ json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.0, json-stringify-safe@~5.0
   version "5.0.1"
   resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"
 
-json3@3.3.2, json3@^3.3.2:
+json3@^3.3.2:
   version "3.3.2"
   resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1"
 
@@ -6999,21 +6991,10 @@ lodash-es@^4.17.5, lodash-es@^4.2.1:
   version "4.17.8"
   resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.8.tgz#6fa8c8c5d337481df0bdf1c0d899d42473121e45"
 
-lodash._baseassign@^3.0.0:
-  version "3.2.0"
-  resolved "https://registry.yarnpkg.com/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz#8c38a099500f215ad09e59f1722fd0c52bfe0a4e"
-  dependencies:
-    lodash._basecopy "^3.0.0"
-    lodash.keys "^3.0.0"
-
 lodash._basecopy@^3.0.0:
   version "3.0.1"
   resolved "https://registry.yarnpkg.com/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz#8da0e6a876cf344c0ad8a54882111dd3c5c7ca36"
 
-lodash._basecreate@^3.0.0:
-  version "3.0.3"
-  resolved "https://registry.yarnpkg.com/lodash._basecreate/-/lodash._basecreate-3.0.3.tgz#1bc661614daa7fc311b7d03bf16806a0213cf821"
-
 lodash._basetostring@^3.0.0:
   version "3.0.1"
   resolved "https://registry.yarnpkg.com/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz#d1861d877f824a52f669832dcaf3ee15566a07d5"
@@ -7067,14 +7048,6 @@ lodash.camelcase@^4.3.0:
   version "4.3.0"
   resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6"
 
-lodash.create@3.1.1:
-  version "3.1.1"
-  resolved "https://registry.yarnpkg.com/lodash.create/-/lodash.create-3.1.1.tgz#d7f2849f0dbda7e04682bb8cd72ab022461debe7"
-  dependencies:
-    lodash._baseassign "^3.0.0"
-    lodash._basecreate "^3.0.0"
-    lodash._isiterateecall "^3.0.0"
-
 lodash.deburr@^3.0.0:
   version "3.2.0"
   resolved "https://registry.yarnpkg.com/lodash.deburr/-/lodash.deburr-3.2.0.tgz#6da8f54334a366a7cf4c4c76ef8d80aa1b365ed5"
@@ -7700,22 +7673,6 @@ mocha@^4.0.1:
     mkdirp "0.5.1"
     supports-color "4.4.0"
 
-mocha@~3.3.0:
-  version "3.3.0"
-  resolved "https://registry.yarnpkg.com/mocha/-/mocha-3.3.0.tgz#d29b7428d3f52c82e2e65df1ecb7064e1aabbfb5"
-  dependencies:
-    browser-stdout "1.3.0"
-    commander "2.9.0"
-    debug "2.6.0"
-    diff "3.2.0"
-    escape-string-regexp "1.0.5"
-    glob "7.1.1"
-    growl "1.9.2"
-    json3 "3.3.2"
-    lodash.create "3.1.1"
-    mkdirp "0.5.1"
-    supports-color "3.1.2"
-
 mock-fs@^4.1.0:
   version "4.4.2"
   resolved "https://registry.yarnpkg.com/mock-fs/-/mock-fs-4.4.2.tgz#09dec5313f97095a450be6aa2ad8ab6738d63d6b"
@@ -7751,10 +7708,6 @@ ms@0.7.1:
   version "0.7.1"
   resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098"
 
-ms@0.7.2:
-  version "0.7.2"
-  resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.2.tgz#ae25cf2512b3885a1d95d7f037868d8431124765"
-
 ms@2.0.0:
   version "2.0.0"
   resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
@@ -10672,9 +10625,9 @@ sockjs@0.3.19:
     faye-websocket "^0.10.0"
     uuid "^3.0.1"
 
-solc@0.4.18:
-  version "0.4.18"
-  resolved "https://registry.yarnpkg.com/solc/-/solc-0.4.18.tgz#83ac6d871dd16a9710e67dbb76dad7f614100702"
+solc@0.4.24, solc@^0.4.24:
+  version "0.4.24"
+  resolved "https://registry.yarnpkg.com/solc/-/solc-0.4.24.tgz#354f14b269b38cbaa82a47d1ff151723502b954e"
   dependencies:
     fs-extra "^0.30.0"
     memorystream "^0.3.1"
@@ -10702,16 +10655,6 @@ solc@^0.4.23:
     semver "^5.3.0"
     yargs "^4.7.1"
 
-solc@^0.4.24:
-  version "0.4.24"
-  resolved "https://registry.yarnpkg.com/solc/-/solc-0.4.24.tgz#354f14b269b38cbaa82a47d1ff151723502b954e"
-  dependencies:
-    fs-extra "^0.30.0"
-    memorystream "^0.3.1"
-    require-from-string "^1.1.0"
-    semver "^5.3.0"
-    yargs "^4.7.1"
-
 solidity-parser-antlr@^0.2.12:
   version "0.2.12"
   resolved "https://registry.yarnpkg.com/solidity-parser-antlr/-/solidity-parser-antlr-0.2.12.tgz#1154f183d5cdda2c7677549ee584dbdb7fb2269c"
@@ -11209,12 +11152,6 @@ stylis@^3.5.0:
   version "3.5.0"
   resolved "https://registry.npmjs.org/stylis/-/stylis-3.5.0.tgz#016fa239663d77f868fef5b67cf201c4b7c701e1"
 
-supports-color@3.1.2:
-  version "3.1.2"
-  resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.1.2.tgz#72a262894d9d408b956ca05ff37b2ed8a6e2a2d5"
-  dependencies:
-    has-flag "^1.0.0"
-
 supports-color@4.4.0:
   version "4.4.0"
   resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.4.0.tgz#883f7ddabc165142b2a61427f3352ded195d1a3e"
@@ -12547,7 +12484,7 @@ web3-net@1.0.0-beta.34:
     web3-core-method "1.0.0-beta.34"
     web3-utils "1.0.0-beta.34"
 
-web3-provider-engine@^13.3.2, web3-provider-engine@^13.6.5:
+web3-provider-engine@^13.3.2:
   version "13.8.0"
   resolved "https://registry.yarnpkg.com/web3-provider-engine/-/web3-provider-engine-13.8.0.tgz#4c7c1ad2af5f1fe10343b8a65495879a2f9c00df"
   dependencies:
@@ -12597,6 +12534,32 @@ web3-provider-engine@^14.0.4:
     xhr "^2.2.0"
     xtend "^4.0.1"
 
+web3-provider-engine@^14.0.6:
+  version "14.0.6"
+  resolved "https://registry.yarnpkg.com/web3-provider-engine/-/web3-provider-engine-14.0.6.tgz#cbdd66fe20c0136a3a495cbe40d18b6c4160d5f0"
+  dependencies:
+    async "^2.5.0"
+    backoff "^2.5.0"
+    clone "^2.0.0"
+    cross-fetch "^2.1.0"
+    eth-block-tracker "^3.0.0"
+    eth-json-rpc-infura "^3.1.0"
+    eth-sig-util "^1.4.2"
+    ethereumjs-block "^1.2.2"
+    ethereumjs-tx "^1.2.0"
+    ethereumjs-util "^5.1.5"
+    ethereumjs-vm "^2.3.4"
+    json-rpc-error "^2.0.0"
+    json-stable-stringify "^1.0.1"
+    promise-to-callback "^1.0.0"
+    readable-stream "^2.2.9"
+    request "^2.67.0"
+    semaphore "^1.0.3"
+    tape "^4.4.0"
+    ws "^5.1.1"
+    xhr "^2.2.0"
+    xtend "^4.0.1"
+
 web3-providers-http@1.0.0-beta.34:
   version "1.0.0-beta.34"
   resolved "https://registry.yarnpkg.com/web3-providers-http/-/web3-providers-http-1.0.0-beta.34.tgz#e561b52bbb43766282007d40285bfe3550c27e7a"
@@ -12667,7 +12630,7 @@ web3@^0.20.0:
     xhr2 "*"
     xmlhttprequest "*"
 
-web3@^1.0.0-beta.30:
+web3@^1.0.0-beta.34:
   version "1.0.0-beta.34"
   resolved "https://registry.yarnpkg.com/web3/-/web3-1.0.0-beta.34.tgz#347e561b784098cb5563315f490479a1d91f2ab1"
   dependencies:
-- 
cgit 


From 5706b29c8c52f70a76e39b583ded931c847c9236 Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Thu, 21 Jun 2018 17:06:44 +0200
Subject: remove .only

---
 packages/contracts/test/exchange/core.ts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/packages/contracts/test/exchange/core.ts b/packages/contracts/test/exchange/core.ts
index e0a9d5b92..fe8a8203a 100644
--- a/packages/contracts/test/exchange/core.ts
+++ b/packages/contracts/test/exchange/core.ts
@@ -129,7 +129,7 @@ describe('Exchange core', () => {
     afterEach(async () => {
         await blockchainLifecycle.revertAsync();
     });
-    describe.only('fillOrder', () => {
+    describe('fillOrder', () => {
         beforeEach(async () => {
             erc20Balances = await erc20Wrapper.getBalancesAsync();
             signedOrder = orderFactory.newSignedOrder();
-- 
cgit 


From 7869c19245c4f5c69bda8726b66df405aca8754c Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Thu, 21 Jun 2018 17:23:42 +0200
Subject: Change revert reason in ownable to be similar to all other revert
 reasons

---
 packages/contracts/src/contracts/current/utils/Ownable/Ownable.sol | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/packages/contracts/src/contracts/current/utils/Ownable/Ownable.sol b/packages/contracts/src/contracts/current/utils/Ownable/Ownable.sol
index 296c6c856..048fdb46f 100644
--- a/packages/contracts/src/contracts/current/utils/Ownable/Ownable.sol
+++ b/packages/contracts/src/contracts/current/utils/Ownable/Ownable.sol
@@ -22,7 +22,7 @@ contract Ownable is IOwnable {
     modifier onlyOwner() {
         require(
             msg.sender == owner,
-            "Only contract owner is allowed to call this method."
+            'ONLY_CONTRACT_OWNER'
         );
         _;
     }
-- 
cgit 


From ada5428df7f056293d826d28362f8be08874771c Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Thu, 21 Jun 2018 17:23:59 +0200
Subject: Check revert reasons in Authorizable tests

---
 packages/contracts/src/utils/types.ts               |  1 +
 packages/contracts/test/asset_proxy/authorizable.ts | 20 ++++++++++++++------
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/packages/contracts/src/utils/types.ts b/packages/contracts/src/utils/types.ts
index da8ea588f..db590213c 100644
--- a/packages/contracts/src/utils/types.ts
+++ b/packages/contracts/src/utils/types.ts
@@ -181,4 +181,5 @@ export enum ContractLibErrors {
     TargetAlreadyAuthorized = 'TARGET_ALREADY_AUTHORIZED',
     IndexOutOfBounds = 'INDEX_OUT_OF_BOUNDS',
     AuthorizedAddressMismatch = 'AUTHORIZED_ADDRESS_MISMATCH',
+    OnlyContractOwner = 'ONLY_CONTRACT_OWNER',
 }
diff --git a/packages/contracts/test/asset_proxy/authorizable.ts b/packages/contracts/test/asset_proxy/authorizable.ts
index 347d060d6..9896895bd 100644
--- a/packages/contracts/test/asset_proxy/authorizable.ts
+++ b/packages/contracts/test/asset_proxy/authorizable.ts
@@ -4,16 +4,20 @@ import 'make-promises-safe';
 
 import { MixinAuthorizableContract } from '../../src/generated_contract_wrappers/mixin_authorizable';
 import { artifacts } from '../../src/utils/artifacts';
-import { expectRevertOrAlwaysFailingTransactionAsync } from '../../src/utils/assertions';
+import {
+    expectRevertOrAlwaysFailingTransactionAsync,
+    expectRevertReasonOrAlwaysFailingTransactionAsync,
+} from '../../src/utils/assertions';
 import { chaiSetup } from '../../src/utils/chai_setup';
 import { constants } from '../../src/utils/constants';
+import { ContractLibErrors } from '../../src/utils/types';
 import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper';
 
 chaiSetup.configure();
 const expect = chai.expect;
 const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
 
-describe('Authorizable', () => {
+describe.only('Authorizable', () => {
     let owner: string;
     let notOwner: string;
     let address: string;
@@ -43,8 +47,9 @@ describe('Authorizable', () => {
     });
     describe('addAuthorizedAddress', () => {
         it('should throw if not called by owner', async () => {
-            return expectRevertOrAlwaysFailingTransactionAsync(
+            return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 authorizable.addAuthorizedAddress.sendTransactionAsync(notOwner, { from: notOwner }),
+                ContractLibErrors.OnlyContractOwner,
             );
         });
         it('should allow owner to add an authorized address', async () => {
@@ -60,8 +65,9 @@ describe('Authorizable', () => {
                 await authorizable.addAuthorizedAddress.sendTransactionAsync(address, { from: owner }),
                 constants.AWAIT_TRANSACTION_MINED_MS,
             );
-            return expectRevertOrAlwaysFailingTransactionAsync(
+            return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 authorizable.addAuthorizedAddress.sendTransactionAsync(address, { from: owner }),
+                ContractLibErrors.TargetAlreadyAuthorized,
             );
         });
     });
@@ -72,10 +78,11 @@ describe('Authorizable', () => {
                 await authorizable.addAuthorizedAddress.sendTransactionAsync(address, { from: owner }),
                 constants.AWAIT_TRANSACTION_MINED_MS,
             );
-            return expectRevertOrAlwaysFailingTransactionAsync(
+            return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 authorizable.removeAuthorizedAddress.sendTransactionAsync(address, {
                     from: notOwner,
                 }),
+                ContractLibErrors.OnlyContractOwner,
             );
         });
 
@@ -95,10 +102,11 @@ describe('Authorizable', () => {
         });
 
         it('should throw if owner attempts to remove an address that is not authorized', async () => {
-            return expectRevertOrAlwaysFailingTransactionAsync(
+            return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 authorizable.removeAuthorizedAddress.sendTransactionAsync(address, {
                     from: owner,
                 }),
+                ContractLibErrors.TargetNotAuthorized,
             );
         });
     });
-- 
cgit 


From 323e8756ba7ff0d5d0b2a80fcc5a66deaef02de5 Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Thu, 21 Jun 2018 17:27:26 +0200
Subject: remove only

---
 packages/contracts/test/asset_proxy/authorizable.ts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/packages/contracts/test/asset_proxy/authorizable.ts b/packages/contracts/test/asset_proxy/authorizable.ts
index 9896895bd..5807e646e 100644
--- a/packages/contracts/test/asset_proxy/authorizable.ts
+++ b/packages/contracts/test/asset_proxy/authorizable.ts
@@ -17,7 +17,7 @@ chaiSetup.configure();
 const expect = chai.expect;
 const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
 
-describe.only('Authorizable', () => {
+describe('Authorizable', () => {
     let owner: string;
     let notOwner: string;
     let address: string;
-- 
cgit 


From a0b225b8b17b60fe073da6a2744cfd35d32a54a5 Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Thu, 21 Jun 2018 17:43:48 +0200
Subject: Test revert reasons in proxy tests

---
 packages/contracts/test/asset_proxy/proxies.ts | 34 +++++++++++++++++---------
 1 file changed, 23 insertions(+), 11 deletions(-)

diff --git a/packages/contracts/test/asset_proxy/proxies.ts b/packages/contracts/test/asset_proxy/proxies.ts
index 2c27f7382..2c1f52973 100644
--- a/packages/contracts/test/asset_proxy/proxies.ts
+++ b/packages/contracts/test/asset_proxy/proxies.ts
@@ -15,12 +15,16 @@ import { DummyERC721TokenContract } from '../../src/generated_contract_wrappers/
 import { ERC20ProxyContract } from '../../src/generated_contract_wrappers/e_r_c20_proxy';
 import { ERC721ProxyContract } from '../../src/generated_contract_wrappers/e_r_c721_proxy';
 import { artifacts } from '../../src/utils/artifacts';
-import { expectRevertOrAlwaysFailingTransactionAsync } from '../../src/utils/assertions';
+import {
+    expectRevertOrAlwaysFailingTransactionAsync,
+    expectRevertReasonOrAlwaysFailingTransactionAsync,
+} from '../../src/utils/assertions';
 import { chaiSetup } from '../../src/utils/chai_setup';
 import { constants } from '../../src/utils/constants';
 import { ERC20Wrapper } from '../../src/utils/erc20_wrapper';
 import { ERC721Wrapper } from '../../src/utils/erc721_wrapper';
 import { LogDecoder } from '../../src/utils/log_decoder';
+import { ContractLibErrors } from '../../src/utils/types';
 import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper';
 
 chaiSetup.configure();
@@ -160,14 +164,15 @@ describe('Asset Transfer Proxies', () => {
                     constants.AWAIT_TRANSACTION_MINED_MS,
                 );
                 // Perform a transfer; expect this to fail.
-                return expectRevertOrAlwaysFailingTransactionAsync(
+                return expectRevertReasonOrAlwaysFailingTransactionAsync(
                     erc20Proxy.transferFrom.sendTransactionAsync(
                         encodedAssetData,
                         makerAddress,
                         takerAddress,
                         transferAmount,
-                        { from: notAuthorized },
+                        { from: exchangeAddress },
                     ),
+                    ContractLibErrors.TransferFailed,
                 );
             });
 
@@ -177,7 +182,7 @@ describe('Asset Transfer Proxies', () => {
                 const encodedAssetDataWithoutProxyId = encodedAssetData.slice(0, -2);
                 // Perform a transfer from makerAddress to takerAddress
                 const amount = new BigNumber(10);
-                return expectRevertOrAlwaysFailingTransactionAsync(
+                return expectRevertReasonOrAlwaysFailingTransactionAsync(
                     erc20Proxy.transferFrom.sendTransactionAsync(
                         encodedAssetDataWithoutProxyId,
                         makerAddress,
@@ -187,6 +192,7 @@ describe('Asset Transfer Proxies', () => {
                             from: notAuthorized,
                         },
                     ),
+                    ContractLibErrors.SenderNotAuthorized,
                 );
             });
         });
@@ -236,10 +242,11 @@ describe('Asset Transfer Proxies', () => {
                 const toAddresses = _.times(numTransfers, () => takerAddress);
                 const amounts = _.times(numTransfers, () => amount);
 
-                return expectRevertOrAlwaysFailingTransactionAsync(
+                return expectRevertReasonOrAlwaysFailingTransactionAsync(
                     erc20Proxy.batchTransferFrom.sendTransactionAsync(assetData, fromAddresses, toAddresses, amounts, {
                         from: notAuthorized,
                     }),
+                    ContractLibErrors.SenderNotAuthorized,
                 );
             });
         });
@@ -377,7 +384,7 @@ describe('Asset Transfer Proxies', () => {
                 expect(ownerMakerAsset).to.be.bignumber.equal(makerAddress);
                 // Perform a transfer from makerAddress to takerAddress
                 const amount = new BigNumber(0);
-                return expectRevertOrAlwaysFailingTransactionAsync(
+                return expectRevertReasonOrAlwaysFailingTransactionAsync(
                     erc721Proxy.transferFrom.sendTransactionAsync(
                         encodedAssetDataWithoutProxyId,
                         makerAddress,
@@ -385,6 +392,7 @@ describe('Asset Transfer Proxies', () => {
                         amount,
                         { from: exchangeAddress },
                     ),
+                    ContractLibErrors.InvalidAmount,
                 );
             });
 
@@ -397,7 +405,7 @@ describe('Asset Transfer Proxies', () => {
                 expect(ownerMakerAsset).to.be.bignumber.equal(makerAddress);
                 // Perform a transfer from makerAddress to takerAddress
                 const amount = new BigNumber(500);
-                return expectRevertOrAlwaysFailingTransactionAsync(
+                return expectRevertReasonOrAlwaysFailingTransactionAsync(
                     erc721Proxy.transferFrom.sendTransactionAsync(
                         encodedAssetDataWithoutProxyId,
                         makerAddress,
@@ -405,6 +413,7 @@ describe('Asset Transfer Proxies', () => {
                         amount,
                         { from: exchangeAddress },
                     ),
+                    ContractLibErrors.InvalidAmount,
                 );
             });
 
@@ -421,16 +430,17 @@ describe('Asset Transfer Proxies', () => {
                 );
                 // Perform a transfer; expect this to fail.
                 const amount = new BigNumber(1);
-                return expectRevertOrAlwaysFailingTransactionAsync(
+                return expectRevertReasonOrAlwaysFailingTransactionAsync(
                     erc20Proxy.transferFrom.sendTransactionAsync(
                         encodedAssetDataWithoutProxyId,
                         makerAddress,
                         takerAddress,
                         amount,
                         {
-                            from: notAuthorized,
+                            from: exchangeAddress,
                         },
                     ),
+                    ContractLibErrors.TransferFailed,
                 );
             });
 
@@ -440,7 +450,7 @@ describe('Asset Transfer Proxies', () => {
                 const encodedAssetDataWithoutProxyId = encodedAssetData.slice(0, -2);
                 // Perform a transfer from makerAddress to takerAddress
                 const amount = new BigNumber(1);
-                return expectRevertOrAlwaysFailingTransactionAsync(
+                return expectRevertReasonOrAlwaysFailingTransactionAsync(
                     erc721Proxy.transferFrom.sendTransactionAsync(
                         encodedAssetDataWithoutProxyId,
                         makerAddress,
@@ -448,6 +458,7 @@ describe('Asset Transfer Proxies', () => {
                         amount,
                         { from: notAuthorized },
                     ),
+                    ContractLibErrors.SenderNotAuthorized,
                 );
             });
         });
@@ -498,10 +509,11 @@ describe('Asset Transfer Proxies', () => {
                 const toAddresses = _.times(numTransfers, () => takerAddress);
                 const amounts = _.times(numTransfers, () => new BigNumber(1));
 
-                return expectRevertOrAlwaysFailingTransactionAsync(
+                return expectRevertReasonOrAlwaysFailingTransactionAsync(
                     erc721Proxy.batchTransferFrom.sendTransactionAsync(assetData, fromAddresses, toAddresses, amounts, {
                         from: notAuthorized,
                     }),
+                    ContractLibErrors.SenderNotAuthorized,
                 );
             });
         });
-- 
cgit 


From d8df6968d39f87771c3544c80d2e1842e718090b Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Fri, 22 Jun 2018 10:37:25 +0200
Subject: remove unused import

---
 packages/contracts/test/asset_proxy/authorizable.ts | 1 -
 1 file changed, 1 deletion(-)

diff --git a/packages/contracts/test/asset_proxy/authorizable.ts b/packages/contracts/test/asset_proxy/authorizable.ts
index 5807e646e..3eaef3142 100644
--- a/packages/contracts/test/asset_proxy/authorizable.ts
+++ b/packages/contracts/test/asset_proxy/authorizable.ts
@@ -5,7 +5,6 @@ import 'make-promises-safe';
 import { MixinAuthorizableContract } from '../../src/generated_contract_wrappers/mixin_authorizable';
 import { artifacts } from '../../src/utils/artifacts';
 import {
-    expectRevertOrAlwaysFailingTransactionAsync,
     expectRevertReasonOrAlwaysFailingTransactionAsync,
 } from '../../src/utils/assertions';
 import { chaiSetup } from '../../src/utils/chai_setup';
-- 
cgit 


From a30107ab867964d371b2d5fc6791c7b1963f1c7b Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Fri, 22 Jun 2018 10:38:08 +0200
Subject: Check revert reason in dispatcher tests

---
 packages/contracts/test/exchange/core.ts       |  3 ++-
 packages/contracts/test/exchange/dispatcher.ts | 15 +++++++++++----
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/packages/contracts/test/exchange/core.ts b/packages/contracts/test/exchange/core.ts
index fe8a8203a..b4649378e 100644
--- a/packages/contracts/test/exchange/core.ts
+++ b/packages/contracts/test/exchange/core.ts
@@ -549,8 +549,9 @@ describe('Exchange core', () => {
         });
 
         it('should throw if not sent by maker', async () => {
-            return expectRevertOrAlwaysFailingTransactionAsync(
+            return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.cancelOrderAsync(signedOrder, takerAddress),
+                ContractLibErrors.InvalidMaker,
             );
         });
 
diff --git a/packages/contracts/test/exchange/dispatcher.ts b/packages/contracts/test/exchange/dispatcher.ts
index abbfd7ac7..299950603 100644
--- a/packages/contracts/test/exchange/dispatcher.ts
+++ b/packages/contracts/test/exchange/dispatcher.ts
@@ -9,11 +9,15 @@ import { ERC20ProxyContract } from '../../src/generated_contract_wrappers/e_r_c2
 import { ERC721ProxyContract } from '../../src/generated_contract_wrappers/e_r_c721_proxy';
 import { TestAssetProxyDispatcherContract } from '../../src/generated_contract_wrappers/test_asset_proxy_dispatcher';
 import { artifacts } from '../../src/utils/artifacts';
-import { expectRevertOrAlwaysFailingTransactionAsync } from '../../src/utils/assertions';
+import {
+    expectRevertOrAlwaysFailingTransactionAsync,
+    expectRevertReasonOrAlwaysFailingTransactionAsync,
+} from '../../src/utils/assertions';
 import { chaiSetup } from '../../src/utils/chai_setup';
 import { constants } from '../../src/utils/constants';
 import { ERC20Wrapper } from '../../src/utils/erc20_wrapper';
 import { ERC721Wrapper } from '../../src/utils/erc721_wrapper';
+import { ContractLibErrors } from '../../src/utils/types';
 import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper';
 
 chaiSetup.configure();
@@ -175,13 +179,14 @@ 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 constants.NULL_ADDRESS
-            return expectRevertOrAlwaysFailingTransactionAsync(
+            return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 assetProxyDispatcher.registerAssetProxy.sendTransactionAsync(
                     AssetProxyId.ERC20,
                     erc20Proxy.address,
                     constants.NULL_ADDRESS,
                     { from: owner },
                 ),
+                ContractLibErrors.AssetProxyMismatch,
             );
         });
 
@@ -216,25 +221,27 @@ describe('AssetProxyDispatcher', () => {
 
         it('should throw if requesting address is not owner', async () => {
             const prevProxyAddress = constants.NULL_ADDRESS;
-            return expectRevertOrAlwaysFailingTransactionAsync(
+            return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 assetProxyDispatcher.registerAssetProxy.sendTransactionAsync(
                     AssetProxyId.ERC20,
                     erc20Proxy.address,
                     prevProxyAddress,
                     { from: notOwner },
                 ),
+                ContractLibErrors.OnlyContractOwner,
             );
         });
 
         it('should throw if attempting to register a proxy to the incorrect id', async () => {
             const prevProxyAddress = constants.NULL_ADDRESS;
-            return expectRevertOrAlwaysFailingTransactionAsync(
+            return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 assetProxyDispatcher.registerAssetProxy.sendTransactionAsync(
                     AssetProxyId.ERC721,
                     erc20Proxy.address,
                     prevProxyAddress,
                     { from: owner },
                 ),
+                ContractLibErrors.AssetProxyIdMismatch,
             );
         });
     });
-- 
cgit 


From 018cc14a875ac4afe205e5b3e884b649661013d8 Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Fri, 22 Jun 2018 10:47:38 +0200
Subject: Fix expected version in test

---
 packages/web3-wrapper/test/web3_wrapper_test.ts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/packages/web3-wrapper/test/web3_wrapper_test.ts b/packages/web3-wrapper/test/web3_wrapper_test.ts
index 2bf3badaa..35eab3aa2 100644
--- a/packages/web3-wrapper/test/web3_wrapper_test.ts
+++ b/packages/web3-wrapper/test/web3_wrapper_test.ts
@@ -26,7 +26,7 @@ describe('Web3Wrapper tests', () => {
     describe('#getNodeVersionAsync', () => {
         it('gets the node version', async () => {
             const nodeVersion = await web3Wrapper.getNodeVersionAsync();
-            const NODE_VERSION = 'EthereumJS TestRPC/v2.1.0/ethereum-js';
+            const NODE_VERSION = 'EthereumJS TestRPC/v2.1.2/ethereum-js';
             expect(nodeVersion).to.be.equal(NODE_VERSION);
         });
     });
-- 
cgit 


From 76fd7f47ebfb48d04faece04af0db3ab5277d864 Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Fri, 22 Jun 2018 14:13:44 +0200
Subject: Fix tests

---
 packages/contracts/test/exchange/core.ts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/packages/contracts/test/exchange/core.ts b/packages/contracts/test/exchange/core.ts
index 32b3fffd4..d35ff7dee 100644
--- a/packages/contracts/test/exchange/core.ts
+++ b/packages/contracts/test/exchange/core.ts
@@ -817,7 +817,7 @@ describe('Exchange core', () => {
             const takerAssetFillAmount = signedOrder.takerAssetAmount;
             return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.fillOrderAsync(signedOrder, takerAddress, { takerAssetFillAmount }),
-                ContractLibErrors.OrderUnfillable,
+                ContractLibErrors.InvalidAmount,
             );
         });
 
@@ -840,7 +840,7 @@ describe('Exchange core', () => {
             const takerAssetFillAmount = signedOrder.takerAssetAmount;
             return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.fillOrderAsync(signedOrder, takerAddress, { takerAssetFillAmount }),
-                ContractLibErrors.OrderUnfillable,
+                ContractLibErrors.InvalidAmount,
             );
         });
 
-- 
cgit 


From daa50442c90f30ce7a873bf228875241a083bba5 Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Fri, 22 Jun 2018 14:28:01 +0200
Subject: Add revert reason checks to match_orders tests

---
 packages/contracts/test/exchange/match_orders.ts | 25 +++++++++++++++++-------
 1 file changed, 18 insertions(+), 7 deletions(-)

diff --git a/packages/contracts/test/exchange/match_orders.ts b/packages/contracts/test/exchange/match_orders.ts
index b8dca04fd..6cc0631fe 100644
--- a/packages/contracts/test/exchange/match_orders.ts
+++ b/packages/contracts/test/exchange/match_orders.ts
@@ -12,7 +12,9 @@ import { ERC20ProxyContract } from '../../src/generated_contract_wrappers/e_r_c2
 import { ERC721ProxyContract } from '../../src/generated_contract_wrappers/e_r_c721_proxy';
 import { ExchangeContract } from '../../src/generated_contract_wrappers/exchange';
 import { artifacts } from '../../src/utils/artifacts';
-import { expectRevertOrAlwaysFailingTransactionAsync } from '../../src/utils/assertions';
+import {
+    expectRevertReasonOrAlwaysFailingTransactionAsync,
+} from '../../src/utils/assertions';
 import { chaiSetup } from '../../src/utils/chai_setup';
 import { constants } from '../../src/utils/constants';
 import { ERC20Wrapper } from '../../src/utils/erc20_wrapper';
@@ -20,7 +22,7 @@ import { ERC721Wrapper } from '../../src/utils/erc721_wrapper';
 import { ExchangeWrapper } from '../../src/utils/exchange_wrapper';
 import { MatchOrderTester } from '../../src/utils/match_order_tester';
 import { OrderFactory } from '../../src/utils/order_factory';
-import { ERC20BalancesByOwner, ERC721TokenIdsByOwner, OrderInfo, OrderStatus } from '../../src/utils/types';
+import { ContractLibErrors, ERC20BalancesByOwner, ERC721TokenIdsByOwner, OrderInfo, OrderStatus } from '../../src/utils/types';
 import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper';
 
 chaiSetup.configure();
@@ -598,8 +600,9 @@ describe('matchOrders', () => {
             // Cancel left order
             await exchangeWrapper.cancelOrderAsync(signedOrderLeft, signedOrderLeft.makerAddress);
             // Match orders
-            return expectRevertOrAlwaysFailingTransactionAsync(
+            return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.matchOrdersAsync(signedOrderLeft, signedOrderRight, takerAddress),
+                ContractLibErrors.OrderUnfillable,
             );
         });
 
@@ -622,8 +625,9 @@ describe('matchOrders', () => {
             // Cancel right order
             await exchangeWrapper.cancelOrderAsync(signedOrderRight, signedOrderRight.makerAddress);
             // Match orders
-            return expectRevertOrAlwaysFailingTransactionAsync(
+            return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.matchOrdersAsync(signedOrderLeft, signedOrderRight, takerAddress),
+                ContractLibErrors.OrderUnfillable,
             );
         });
 
@@ -644,7 +648,7 @@ describe('matchOrders', () => {
                 feeRecipientAddress: feeRecipientAddressRight,
             });
             // Match orders
-            return expectRevertOrAlwaysFailingTransactionAsync(
+            return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 matchOrderTester.matchOrdersAndVerifyBalancesAsync(
                     signedOrderLeft,
                     signedOrderRight,
@@ -652,6 +656,7 @@ describe('matchOrders', () => {
                     erc20BalancesByOwner,
                     erc721TokenIdsByOwner,
                 ),
+                ContractLibErrors.NegativeSpreadRequired,
             );
         });
 
@@ -672,7 +677,7 @@ describe('matchOrders', () => {
                 feeRecipientAddress: feeRecipientAddressRight,
             });
             // Match orders
-            return expectRevertOrAlwaysFailingTransactionAsync(
+            return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 matchOrderTester.matchOrdersAndVerifyBalancesAsync(
                     signedOrderLeft,
                     signedOrderRight,
@@ -680,6 +685,11 @@ describe('matchOrders', () => {
                     erc20BalancesByOwner,
                     erc721TokenIdsByOwner,
                 ),
+                // We are assuming assetData fields of the right order are the
+                // reverse of the left order, rather than checking equality. This
+                // saves a bunch of gas, but as a result if the assetData fields are
+                // off then the failure ends up happening at signature validation
+                ContractLibErrors.InvalidSignature,
             );
         });
 
@@ -702,7 +712,7 @@ describe('matchOrders', () => {
                 feeRecipientAddress: feeRecipientAddressRight,
             });
             // Match orders
-            return expectRevertOrAlwaysFailingTransactionAsync(
+            return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 matchOrderTester.matchOrdersAndVerifyBalancesAsync(
                     signedOrderLeft,
                     signedOrderRight,
@@ -710,6 +720,7 @@ describe('matchOrders', () => {
                     erc20BalancesByOwner,
                     erc721TokenIdsByOwner,
                 ),
+                ContractLibErrors.InvalidSignature,
             );
         });
 
-- 
cgit 


From 914b00936199526f67398d5b9823f893f1773cdd Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Fri, 22 Jun 2018 17:12:17 +0200
Subject: Change Whitelist error messages to conform to rest and added revert
 reason checks to transactions tests

---
 .../contracts/current/test/Whitelist/Whitelist.sol | 10 +++---
 packages/contracts/src/utils/types.ts              |  2 ++
 packages/contracts/test/exchange/transactions.ts   | 40 +++++++++++++---------
 3 files changed, 31 insertions(+), 21 deletions(-)

diff --git a/packages/contracts/src/contracts/current/test/Whitelist/Whitelist.sol b/packages/contracts/src/contracts/current/test/Whitelist/Whitelist.sol
index d35815474..8b52858b1 100644
--- a/packages/contracts/src/contracts/current/test/Whitelist/Whitelist.sol
+++ b/packages/contracts/src/contracts/current/test/Whitelist/Whitelist.sol
@@ -23,13 +23,13 @@ import "../../protocol/Exchange/interfaces/IExchange.sol";
 import "../../protocol/Exchange/libs/LibOrder.sol";
 import "../../utils/Ownable/Ownable.sol";
 
-contract Whitelist is 
+contract Whitelist is
     Ownable
 {
     // Revert reasons
-    string constant MAKER_NOT_WHITELISTED = "Maker address not whitelisted.";
-    string constant TAKER_NOT_WHITELISTED = "Taker address not whitelisted.";
-    string constant INVALID_SENDER = "Sender must equal transaction origin.";
+    string constant MAKER_NOT_WHITELISTED = "MAKER_NOT_WHITELISTED"; // Maker address not whitelisted.
+    string constant TAKER_NOT_WHITELISTED = "TAKER_NOT_WHITELISTED"; // Taker address not whitelisted.
+    string constant INVALID_SENDER = "INVALID_SENDER"; // Sender must equal transaction origin.
 
     // Mapping of address => whitelist status.
     mapping (address => bool) public isWhitelisted;
@@ -77,7 +77,7 @@ contract Whitelist is
         public
     {
         address takerAddress = msg.sender;
-    
+
         // This contract must be the entry point for the transaction.
         require(
             takerAddress == tx.origin,
diff --git a/packages/contracts/src/utils/types.ts b/packages/contracts/src/utils/types.ts
index 24183b549..c1eb72099 100644
--- a/packages/contracts/src/utils/types.ts
+++ b/packages/contracts/src/utils/types.ts
@@ -183,4 +183,6 @@ export enum ContractLibErrors {
     IndexOutOfBounds = 'INDEX_OUT_OF_BOUNDS',
     AuthorizedAddressMismatch = 'AUTHORIZED_ADDRESS_MISMATCH',
     OnlyContractOwner = 'ONLY_CONTRACT_OWNER',
+    MakerNotWhitelisted = 'MAKER_NOT_WHITELISTED',
+    TakerNotWhitelisted = 'TAKER_NOT_WHITELISTED',
 }
diff --git a/packages/contracts/test/exchange/transactions.ts b/packages/contracts/test/exchange/transactions.ts
index 9a625880c..958a6dce8 100644
--- a/packages/contracts/test/exchange/transactions.ts
+++ b/packages/contracts/test/exchange/transactions.ts
@@ -10,7 +10,9 @@ import { ExchangeContract } from '../../src/generated_contract_wrappers/exchange
 import { ExchangeWrapperContract } from '../../src/generated_contract_wrappers/exchange_wrapper';
 import { WhitelistContract } from '../../src/generated_contract_wrappers/whitelist';
 import { artifacts } from '../../src/utils/artifacts';
-import { expectRevertOrAlwaysFailingTransactionAsync } from '../../src/utils/assertions';
+import {
+    expectRevertReasonOrAlwaysFailingTransactionAsync,
+} from '../../src/utils/assertions';
 import { chaiSetup } from '../../src/utils/chai_setup';
 import { constants } from '../../src/utils/constants';
 import { ERC20Wrapper } from '../../src/utils/erc20_wrapper';
@@ -18,7 +20,7 @@ import { ExchangeWrapper } from '../../src/utils/exchange_wrapper';
 import { OrderFactory } from '../../src/utils/order_factory';
 import { orderUtils } from '../../src/utils/order_utils';
 import { TransactionFactory } from '../../src/utils/transaction_factory';
-import { ERC20BalancesByOwner, SignedTransaction } from '../../src/utils/types';
+import { ContractLibErrors, ERC20BalancesByOwner, SignedTransaction } from '../../src/utils/types';
 import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper';
 
 chaiSetup.configure();
@@ -59,6 +61,12 @@ describe('Exchange transactions', () => {
     after(async () => {
         await blockchainLifecycle.revertAsync();
     });
+    beforeEach(async () => {
+        await blockchainLifecycle.startAsync();
+    });
+    afterEach(async () => {
+        await blockchainLifecycle.revertAsync();
+    });
     before(async () => {
         const accounts = await web3Wrapper.getAvailableAddressesAsync();
         const usedAddresses = ([owner, senderAddress, makerAddress, takerAddress, feeRecipientAddress] = accounts);
@@ -101,13 +109,6 @@ describe('Exchange transactions', () => {
         makerTransactionFactory = new TransactionFactory(makerPrivateKey, exchange.address);
         takerTransactionFactory = new TransactionFactory(takerPrivateKey, exchange.address);
     });
-    beforeEach(async () => {
-        await blockchainLifecycle.startAsync();
-    });
-    afterEach(async () => {
-        await blockchainLifecycle.revertAsync();
-    });
-
     describe('executeTransaction', () => {
         describe('fillOrder', () => {
             let takerAssetFillAmount: BigNumber;
@@ -126,8 +127,9 @@ describe('Exchange transactions', () => {
             });
 
             it('should throw if not called by specified sender', async () => {
-                return expectRevertOrAlwaysFailingTransactionAsync(
+                return expectRevertReasonOrAlwaysFailingTransactionAsync(
                     exchangeWrapper.executeTransactionAsync(signedTx, takerAddress),
+                    ContractLibErrors.FailedExecution,
                 );
             });
 
@@ -168,8 +170,9 @@ describe('Exchange transactions', () => {
 
             it('should throw if the a 0x transaction with the same transactionHash has already been executed', async () => {
                 await exchangeWrapper.executeTransactionAsync(signedTx, senderAddress);
-                return expectRevertOrAlwaysFailingTransactionAsync(
+                return expectRevertReasonOrAlwaysFailingTransactionAsync(
                     exchangeWrapper.executeTransactionAsync(signedTx, senderAddress),
+                    ContractLibErrors.InvalidTxHash,
                 );
             });
 
@@ -187,15 +190,17 @@ describe('Exchange transactions', () => {
             });
 
             it('should throw if not called by specified sender', async () => {
-                return expectRevertOrAlwaysFailingTransactionAsync(
+                return expectRevertReasonOrAlwaysFailingTransactionAsync(
                     exchangeWrapper.executeTransactionAsync(signedTx, makerAddress),
+                    ContractLibErrors.FailedExecution,
                 );
             });
 
             it('should cancel the order when signed by maker and called by sender', async () => {
                 await exchangeWrapper.executeTransactionAsync(signedTx, senderAddress);
-                return expectRevertOrAlwaysFailingTransactionAsync(
+                return expectRevertReasonOrAlwaysFailingTransactionAsync(
                     exchangeWrapper.fillOrderAsync(signedOrder, senderAddress),
+                    ContractLibErrors.OrderUnfillable,
                 );
             });
         });
@@ -238,7 +243,7 @@ describe('Exchange transactions', () => {
                     signedOrder.signature,
                 );
                 const signedFillTx = takerTransactionFactory.newSignedTransaction(fillData);
-                return expectRevertOrAlwaysFailingTransactionAsync(
+                return expectRevertReasonOrAlwaysFailingTransactionAsync(
                     exchangeWrapperContract.fillOrder.sendTransactionAsync(
                         orderWithoutExchangeAddress,
                         takerAssetFillAmount,
@@ -247,6 +252,7 @@ describe('Exchange transactions', () => {
                         signedFillTx.signature,
                         { from: takerAddress },
                     ),
+                    ContractLibErrors.FailedExecution,
                 );
             });
 
@@ -357,7 +363,7 @@ describe('Exchange transactions', () => {
             orderWithoutExchangeAddress = orderUtils.getOrderWithoutExchangeAddress(signedOrder);
             const takerAssetFillAmount = signedOrder.takerAssetAmount;
             const salt = generatePseudoRandomSalt();
-            return expectRevertOrAlwaysFailingTransactionAsync(
+            return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 whitelist.fillOrderIfWhitelisted.sendTransactionAsync(
                     orderWithoutExchangeAddress,
                     takerAssetFillAmount,
@@ -365,6 +371,7 @@ describe('Exchange transactions', () => {
                     signedOrder.signature,
                     { from: takerAddress },
                 ),
+                ContractLibErrors.MakerNotWhitelisted,
             );
         });
 
@@ -378,7 +385,7 @@ describe('Exchange transactions', () => {
             orderWithoutExchangeAddress = orderUtils.getOrderWithoutExchangeAddress(signedOrder);
             const takerAssetFillAmount = signedOrder.takerAssetAmount;
             const salt = generatePseudoRandomSalt();
-            return expectRevertOrAlwaysFailingTransactionAsync(
+            return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 whitelist.fillOrderIfWhitelisted.sendTransactionAsync(
                     orderWithoutExchangeAddress,
                     takerAssetFillAmount,
@@ -386,6 +393,7 @@ describe('Exchange transactions', () => {
                     signedOrder.signature,
                     { from: takerAddress },
                 ),
+                ContractLibErrors.TakerNotWhitelisted,
             );
         });
 
-- 
cgit 


From 8b4077d7dea335ce6daa0f37717100bec1fe9ed1 Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Fri, 22 Jun 2018 17:12:31 +0200
Subject: Fix tests

---
 packages/contracts/test/exchange/match_orders.ts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/packages/contracts/test/exchange/match_orders.ts b/packages/contracts/test/exchange/match_orders.ts
index 6cc0631fe..9d2378dc8 100644
--- a/packages/contracts/test/exchange/match_orders.ts
+++ b/packages/contracts/test/exchange/match_orders.ts
@@ -689,7 +689,7 @@ describe('matchOrders', () => {
                 // reverse of the left order, rather than checking equality. This
                 // saves a bunch of gas, but as a result if the assetData fields are
                 // off then the failure ends up happening at signature validation
-                ContractLibErrors.InvalidSignature,
+                ContractLibErrors.InvalidOrderSignature,
             );
         });
 
@@ -720,7 +720,7 @@ describe('matchOrders', () => {
                     erc20BalancesByOwner,
                     erc721TokenIdsByOwner,
                 ),
-                ContractLibErrors.InvalidSignature,
+                ContractLibErrors.InvalidOrderSignature,
             );
         });
 
-- 
cgit 


From 4c14372b4afd9473a9b86c83dfcda076027a2e6c Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Fri, 22 Jun 2018 17:12:52 +0200
Subject: Add revert reason checks to wrapper tests

---
 packages/contracts/test/exchange/wrapper.ts | 29 +++++++++++++++++++----------
 1 file changed, 19 insertions(+), 10 deletions(-)

diff --git a/packages/contracts/test/exchange/wrapper.ts b/packages/contracts/test/exchange/wrapper.ts
index 703f644b8..3d7465659 100644
--- a/packages/contracts/test/exchange/wrapper.ts
+++ b/packages/contracts/test/exchange/wrapper.ts
@@ -12,14 +12,16 @@ import { ERC20ProxyContract } from '../../src/generated_contract_wrappers/e_r_c2
 import { ERC721ProxyContract } from '../../src/generated_contract_wrappers/e_r_c721_proxy';
 import { ExchangeContract } from '../../src/generated_contract_wrappers/exchange';
 import { artifacts } from '../../src/utils/artifacts';
-import { expectRevertOrAlwaysFailingTransactionAsync } from '../../src/utils/assertions';
+import {
+    expectRevertReasonOrAlwaysFailingTransactionAsync,
+} from '../../src/utils/assertions';
 import { chaiSetup } from '../../src/utils/chai_setup';
 import { constants } from '../../src/utils/constants';
 import { ERC20Wrapper } from '../../src/utils/erc20_wrapper';
 import { ERC721Wrapper } from '../../src/utils/erc721_wrapper';
 import { ExchangeWrapper } from '../../src/utils/exchange_wrapper';
 import { OrderFactory } from '../../src/utils/order_factory';
-import { ERC20BalancesByOwner } from '../../src/utils/types';
+import { ContractLibErrors, ERC20BalancesByOwner } from '../../src/utils/types';
 import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper';
 
 chaiSetup.configure();
@@ -165,13 +167,14 @@ describe('Exchange wrappers', () => {
             );
         });
 
-        it('should throw if an signedOrder is expired', async () => {
+        it('should throw if a signedOrder is expired', async () => {
             const signedOrder = orderFactory.newSignedOrder({
                 expirationTimeSeconds: new BigNumber(Math.floor((Date.now() - 10000) / 1000)),
             });
 
-            return expectRevertOrAlwaysFailingTransactionAsync(
+            return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.fillOrKillOrderAsync(signedOrder, takerAddress),
+                ContractLibErrors.OrderUnfillable,
             );
         });
 
@@ -182,8 +185,9 @@ describe('Exchange wrappers', () => {
                 takerAssetFillAmount: signedOrder.takerAssetAmount.div(2),
             });
 
-            return expectRevertOrAlwaysFailingTransactionAsync(
+            return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.fillOrKillOrderAsync(signedOrder, takerAddress),
+                ContractLibErrors.CompleteFillFailed,
             );
         });
     });
@@ -494,10 +498,11 @@ describe('Exchange wrappers', () => {
 
                 await exchangeWrapper.fillOrKillOrderAsync(signedOrders[0], takerAddress);
 
-                return expectRevertOrAlwaysFailingTransactionAsync(
+                return expectRevertReasonOrAlwaysFailingTransactionAsync(
                     exchangeWrapper.batchFillOrKillOrdersAsync(signedOrders, takerAddress, {
                         takerAssetFillAmounts,
                     }),
+                    ContractLibErrors.OrderUnfillable,
                 );
             });
         });
@@ -687,7 +692,7 @@ describe('Exchange wrappers', () => {
                 expect(newBalances).to.be.deep.equal(erc20Balances);
             });
 
-            it('should throw when an signedOrder does not use the same takerAssetAddress', async () => {
+            it('should throw when a signedOrder does not use the same takerAssetAddress', async () => {
                 signedOrders = [
                     orderFactory.newSignedOrder(),
                     orderFactory.newSignedOrder({
@@ -696,10 +701,13 @@ describe('Exchange wrappers', () => {
                     orderFactory.newSignedOrder(),
                 ];
 
-                return expectRevertOrAlwaysFailingTransactionAsync(
+                return expectRevertReasonOrAlwaysFailingTransactionAsync(
                     exchangeWrapper.marketSellOrdersAsync(signedOrders, takerAddress, {
                         takerAssetFillAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(1000), 18),
                     }),
+                    // We simply use the takerAssetData from the first order for all orders.
+                    // If they are not the same, the contract throws when validating the order signature
+                    ContractLibErrors.InvalidOrderSignature,
                 );
             });
         });
@@ -902,7 +910,7 @@ describe('Exchange wrappers', () => {
                 expect(newBalances).to.be.deep.equal(erc20Balances);
             });
 
-            it('should throw when an signedOrder does not use the same makerAssetAddress', async () => {
+            it('should throw when a signedOrder does not use the same makerAssetAddress', async () => {
                 signedOrders = [
                     orderFactory.newSignedOrder(),
                     orderFactory.newSignedOrder({
@@ -911,10 +919,11 @@ describe('Exchange wrappers', () => {
                     orderFactory.newSignedOrder(),
                 ];
 
-                return expectRevertOrAlwaysFailingTransactionAsync(
+                return expectRevertReasonOrAlwaysFailingTransactionAsync(
                     exchangeWrapper.marketBuyOrdersAsync(signedOrders, takerAddress, {
                         makerAssetFillAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(1000), 18),
                     }),
+                    ContractLibErrors.InvalidOrderSignature,
                 );
             });
         });
-- 
cgit 


From 59d3a219937a80fa6f8d6096e9a54534103c0cd7 Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Fri, 22 Jun 2018 17:39:41 +0200
Subject: Fix test now that contract reverts with message

---
 packages/contracts/src/utils/types.ts          | 1 +
 packages/contracts/test/exchange/dispatcher.ts | 8 +++-----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/packages/contracts/src/utils/types.ts b/packages/contracts/src/utils/types.ts
index c1eb72099..43c9109e7 100644
--- a/packages/contracts/src/utils/types.ts
+++ b/packages/contracts/src/utils/types.ts
@@ -185,4 +185,5 @@ export enum ContractLibErrors {
     OnlyContractOwner = 'ONLY_CONTRACT_OWNER',
     MakerNotWhitelisted = 'MAKER_NOT_WHITELISTED',
     TakerNotWhitelisted = 'TAKER_NOT_WHITELISTED',
+    AssetProxyDoesNotExist = 'ASSET_PROXY_DOES_NOT_EXIST',
 }
diff --git a/packages/contracts/test/exchange/dispatcher.ts b/packages/contracts/test/exchange/dispatcher.ts
index 299950603..d463f6c35 100644
--- a/packages/contracts/test/exchange/dispatcher.ts
+++ b/packages/contracts/test/exchange/dispatcher.ts
@@ -9,10 +9,7 @@ import { ERC20ProxyContract } from '../../src/generated_contract_wrappers/e_r_c2
 import { ERC721ProxyContract } from '../../src/generated_contract_wrappers/e_r_c721_proxy';
 import { TestAssetProxyDispatcherContract } from '../../src/generated_contract_wrappers/test_asset_proxy_dispatcher';
 import { artifacts } from '../../src/utils/artifacts';
-import {
-    expectRevertOrAlwaysFailingTransactionAsync,
-    expectRevertReasonOrAlwaysFailingTransactionAsync,
-} from '../../src/utils/assertions';
+import { expectRevertReasonOrAlwaysFailingTransactionAsync } from '../../src/utils/assertions';
 import { chaiSetup } from '../../src/utils/chai_setup';
 import { constants } from '../../src/utils/constants';
 import { ERC20Wrapper } from '../../src/utils/erc20_wrapper';
@@ -314,7 +311,7 @@ describe('AssetProxyDispatcher', () => {
             const encodedAssetDataWithoutProxyId = encodedAssetData.slice(0, -2);
             // Perform a transfer from makerAddress to takerAddress
             const amount = new BigNumber(10);
-            return expectRevertOrAlwaysFailingTransactionAsync(
+            return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 assetProxyDispatcher.publicDispatchTransferFrom.sendTransactionAsync(
                     encodedAssetDataWithoutProxyId,
                     AssetProxyId.ERC20,
@@ -323,6 +320,7 @@ describe('AssetProxyDispatcher', () => {
                     amount,
                     { from: owner },
                 ),
+                ContractLibErrors.AssetProxyDoesNotExist,
             );
         });
     });
-- 
cgit 


From ba14850c9a3f774169db1b67446618bb84daae54 Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Fri, 22 Jun 2018 18:35:35 +0200
Subject: Standardize ERC20 error strings given convention

---
 .../contracts/src/contracts/current/tokens/ERC20Token/ERC20Token.sol | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/packages/contracts/src/contracts/current/tokens/ERC20Token/ERC20Token.sol b/packages/contracts/src/contracts/current/tokens/ERC20Token/ERC20Token.sol
index f0bcdafef..b6961a6ec 100644
--- a/packages/contracts/src/contracts/current/tokens/ERC20Token/ERC20Token.sol
+++ b/packages/contracts/src/contracts/current/tokens/ERC20Token/ERC20Token.sol
@@ -23,8 +23,8 @@ import "./IERC20Token.sol";
 
 contract ERC20Token is IERC20Token {
 
-    string constant INSUFFICIENT_BALANCE = "Insufficient balance to complete transfer.";
-    string constant INSUFFICIENT_ALLOWANCE = "Insufficient allowance to complete transfer.";
+    string constant INSUFFICIENT_BALANCE = "ERC20_INSUFFICIENT_BALANCE";
+    string constant INSUFFICIENT_ALLOWANCE = "ERC20_INSUFFICIENT_ALLOWANCE";
     string constant OVERFLOW = "Transfer would result in an overflow.";
 
     mapping (address => uint256) balances;
@@ -97,4 +97,3 @@ contract ERC20Token is IERC20Token {
         return allowed[_owner][_spender];
     }
 }
-
-- 
cgit 


From 0e7c254b938045f0c6e0a57c78bb1db8a23557b6 Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Fri, 22 Jun 2018 18:36:15 +0200
Subject: Move constants over to ContractLibError enum and update all tests

---
 packages/contracts/src/utils/constants.ts          | 13 -------
 packages/contracts/src/utils/types.ts              | 12 +++++-
 .../contracts/test/exchange/signature_validator.ts |  9 +++--
 packages/contracts/test/libraries/lib_bytes.ts     | 45 +++++++++++-----------
 .../contracts/test/unlimited_allowance_token.ts    |  7 ++--
 5 files changed, 42 insertions(+), 44 deletions(-)

diff --git a/packages/contracts/src/utils/constants.ts b/packages/contracts/src/utils/constants.ts
index f21b8c7a0..2b2bd2425 100644
--- a/packages/contracts/src/utils/constants.ts
+++ b/packages/contracts/src/utils/constants.ts
@@ -19,19 +19,6 @@ const TESTRPC_PRIVATE_KEYS_STRINGS = [
 export const constants = {
     INVALID_OPCODE: 'invalid opcode',
     REVERT: 'revert',
-    LIB_BYTES_GREATER_THAN_ZERO_LENGTH_REQUIRED: 'GREATER_THAN_ZERO_LENGTH_REQUIRED',
-    LIB_BYTES_GREATER_OR_EQUAL_TO_4_LENGTH_REQUIRED: 'GREATER_OR_EQUAL_TO_4_LENGTH_REQUIRED',
-    LIB_BYTES_GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED: 'GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED',
-    LIB_BYTES_GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED: 'GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED',
-    LIB_BYTES_GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED: 'GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED',
-    LIB_BYTES_GREATER_OR_EQUAL_TO_SOURCE_BYTES_LENGTH_REQUIRED: 'GREATER_OR_EQUAL_TO_SOURCE_BYTES_LENGTH_REQUIRED',
-    ERC20_INSUFFICIENT_BALANCE: 'Insufficient balance to complete transfer.',
-    ERC20_INSUFFICIENT_ALLOWANCE: 'Insufficient allowance to complete transfer.',
-    EXCHANGE_LENGTH_GREATER_THAN_0_REQUIRED: 'LENGTH_GREATER_THAN_0_REQUIRED',
-    EXCHANGE_SIGNATURE_UNSUPPORTED: 'SIGNATURE_UNSUPPORTED',
-    EXCHANGE_SIGNATURE_ILLEGAL: 'SIGNATURE_ILLEGAL',
-    EXCHANGE_LENGTH_0_REQUIRED: 'LENGTH_0_REQUIRED',
-    EXCHANGE_LENGTH_65_REQUIRED: 'LENGTH_65_REQUIRED',
     TESTRPC_NETWORK_ID: 50,
     // Note(albrow): In practice V8 and most other engines limit the minimum
     // interval for setInterval to 10ms. We still set it to 0 here in order to
diff --git a/packages/contracts/src/utils/types.ts b/packages/contracts/src/utils/types.ts
index 43c9109e7..f65a9858b 100644
--- a/packages/contracts/src/utils/types.ts
+++ b/packages/contracts/src/utils/types.ts
@@ -173,8 +173,8 @@ export enum ContractLibErrors {
     AssetProxyMismatch = 'ASSET_PROXY_MISMATCH',
     AssetProxyIdMismatch = 'ASSET_PROXY_ID_MISMATCH',
     LengthGreaterThan0Required = 'LENGTH_GREATER_THAN_0_REQUIRED',
-    Length1Required = 'LENGTH_1_REQUIRED',
-    Length66Required = 'LENGTH_66_REQUIRED',
+    ExchangeLength0Required = 'LENGTH_0_REQUIRED',
+    ExchangeLength65Required = 'LENGTH_65_REQUIRED',
     InvalidAmount = 'INVALID_AMOUNT',
     TransferFailed = 'TRANSFER_FAILED',
     SenderNotAuthorized = 'SENDER_NOT_AUTHORIZED',
@@ -186,4 +186,12 @@ export enum ContractLibErrors {
     MakerNotWhitelisted = 'MAKER_NOT_WHITELISTED',
     TakerNotWhitelisted = 'TAKER_NOT_WHITELISTED',
     AssetProxyDoesNotExist = 'ASSET_PROXY_DOES_NOT_EXIST',
+    LibBytesGreaterThanZeroLengthRequired = 'GREATER_THAN_ZERO_LENGTH_REQUIRED',
+    LibBytesGreaterOrEqualTo4LengthRequired = 'GREATER_OR_EQUAL_TO_4_LENGTH_REQUIRED',
+    LibBytesGreaterOrEqualTo20LengthRequired = 'GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED',
+    LibBytesGreaterOrEqualTo32LengthRequired = 'GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED',
+    LibBytesGreaterOrEqualToNestedBytesLengthRequired = 'GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED',
+    LibBytesGreaterOrEqualToSourceBytesLengthRequired = 'GREATER_OR_EQUAL_TO_SOURCE_BYTES_LENGTH_REQUIRED',
+    Erc20InsufficientBalance = 'ERC20_INSUFFICIENT_BALANCE',
+    Erc20InsufficientAllowance = 'ERC20_INSUFFICIENT_ALLOWANCE',
 }
diff --git a/packages/contracts/test/exchange/signature_validator.ts b/packages/contracts/test/exchange/signature_validator.ts
index 8e221e3f1..d53e0758e 100644
--- a/packages/contracts/test/exchange/signature_validator.ts
+++ b/packages/contracts/test/exchange/signature_validator.ts
@@ -18,6 +18,7 @@ import { chaiSetup } from '../../src/utils/chai_setup';
 import { constants } from '../../src/utils/constants';
 import { LogDecoder } from '../../src/utils/log_decoder';
 import { OrderFactory } from '../../src/utils/order_factory';
+import { ContractLibErrors } from '../../src/utils/types';
 import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper';
 
 chaiSetup.configure();
@@ -107,7 +108,7 @@ describe('MixinSignatureValidator', () => {
                     signedOrder.makerAddress,
                     emptySignature,
                 ),
-                constants.EXCHANGE_LENGTH_GREATER_THAN_0_REQUIRED,
+                ContractLibErrors.LengthGreaterThan0Required,
             );
         });
 
@@ -121,7 +122,7 @@ describe('MixinSignatureValidator', () => {
                     signedOrder.makerAddress,
                     unsupportedSignatureHex,
                 ),
-                constants.EXCHANGE_SIGNATURE_UNSUPPORTED,
+                ContractLibErrors.SignatureUnsupported,
             );
         });
 
@@ -134,7 +135,7 @@ describe('MixinSignatureValidator', () => {
                     signedOrder.makerAddress,
                     unsupportedSignatureHex,
                 ),
-                constants.EXCHANGE_SIGNATURE_ILLEGAL,
+                ContractLibErrors.SignatureIllegal,
             );
         });
 
@@ -161,7 +162,7 @@ describe('MixinSignatureValidator', () => {
                     signedOrder.makerAddress,
                     signatureHex,
                 ),
-                constants.EXCHANGE_LENGTH_0_REQUIRED,
+                ContractLibErrors.ExchangeLength0Required,
             );
         });
 
diff --git a/packages/contracts/test/libraries/lib_bytes.ts b/packages/contracts/test/libraries/lib_bytes.ts
index a31a4789c..2d54596d5 100644
--- a/packages/contracts/test/libraries/lib_bytes.ts
+++ b/packages/contracts/test/libraries/lib_bytes.ts
@@ -11,6 +11,7 @@ import { artifacts } from '../../src/utils/artifacts';
 import { expectRevertOrOtherErrorAsync } from '../../src/utils/assertions';
 import { chaiSetup } from '../../src/utils/chai_setup';
 import { constants } from '../../src/utils/constants';
+import { ContractLibErrors } from '../../src/utils/types';
 import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper';
 
 chaiSetup.configure();
@@ -95,7 +96,7 @@ describe('LibBytes', () => {
         it('should revert if length is 0', async () => {
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicPopLastByte.callAsync(constants.NULL_BYTES),
-                constants.LIB_BYTES_GREATER_THAN_ZERO_LENGTH_REQUIRED,
+                ContractLibErrors.LibBytesGreaterThanZeroLengthRequired,
             );
         });
         it('should pop the last byte from the input and return it', async () => {
@@ -111,7 +112,7 @@ describe('LibBytes', () => {
         it('should revert if length is less than 20', async () => {
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicPopLast20Bytes.callAsync(byteArrayShorterThan20Bytes),
-                constants.LIB_BYTES_GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED,
+                ContractLibErrors.LibBytesGreaterOrEqualTo20LengthRequired
             );
         });
         it('should pop the last 20 bytes from the input and return it', async () => {
@@ -172,7 +173,7 @@ describe('LibBytes', () => {
         it('should revert if dest is shorter than source', async () => {
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicDeepCopyBytes.callAsync(byteArrayShorterThan32Bytes, byteArrayLongerThan32Bytes),
-                constants.LIB_BYTES_GREATER_OR_EQUAL_TO_SOURCE_BYTES_LENGTH_REQUIRED,
+                ContractLibErrors.LibBytesGreaterOrEqualToSourceBytesLengthRequired
             );
         });
         it('should overwrite dest with source if source and dest have equal length', async () => {
@@ -225,7 +226,7 @@ describe('LibBytes', () => {
             const offset = new BigNumber(0);
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicReadAddress.callAsync(shortByteArray, offset),
-                constants.LIB_BYTES_GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED,
+                ContractLibErrors.LibBytesGreaterOrEqualTo20LengthRequired,
             );
         });
         it('should fail if the length between the offset and end of the byte array is too short to hold an address', async () => {
@@ -233,7 +234,7 @@ describe('LibBytes', () => {
             const badOffset = new BigNumber(ethUtil.toBuffer(byteArray).byteLength);
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicReadAddress.callAsync(byteArray, badOffset),
-                constants.LIB_BYTES_GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED,
+                ContractLibErrors.LibBytesGreaterOrEqualTo20LengthRequired,
             );
         });
     });
@@ -269,7 +270,7 @@ describe('LibBytes', () => {
             const offset = new BigNumber(0);
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicWriteAddress.callAsync(byteArrayShorterThan20Bytes, offset, testAddress),
-                constants.LIB_BYTES_GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED,
+                ContractLibErrors.LibBytesGreaterOrEqualTo20LengthRequired,
             );
         });
         it('should fail if the length between the offset and end of the byte array is too short to hold an address', async () => {
@@ -277,7 +278,7 @@ describe('LibBytes', () => {
             const badOffset = new BigNumber(ethUtil.toBuffer(byteArray).byteLength);
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicWriteAddress.callAsync(byteArray, badOffset, testAddress),
-                constants.LIB_BYTES_GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED,
+                ContractLibErrors.LibBytesGreaterOrEqualTo20LengthRequired,
             );
         });
     });
@@ -301,14 +302,14 @@ describe('LibBytes', () => {
             const offset = new BigNumber(0);
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicReadBytes32.callAsync(byteArrayShorterThan32Bytes, offset),
-                constants.LIB_BYTES_GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED,
+                ContractLibErrors.LibBytesGreaterOrEqualTo32LengthRequired,
             );
         });
         it('should fail if the length between the offset and end of the byte array is too short to hold a bytes32', async () => {
             const badOffset = new BigNumber(ethUtil.toBuffer(testBytes32).byteLength);
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicReadBytes32.callAsync(testBytes32, badOffset),
-                constants.LIB_BYTES_GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED,
+                ContractLibErrors.LibBytesGreaterOrEqualTo32LengthRequired,
             );
         });
     });
@@ -344,7 +345,7 @@ describe('LibBytes', () => {
             const offset = new BigNumber(0);
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicWriteBytes32.callAsync(byteArrayShorterThan32Bytes, offset, testBytes32),
-                constants.LIB_BYTES_GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED,
+                ContractLibErrors.LibBytesGreaterOrEqualTo32LengthRequired,
             );
         });
         it('should fail if the length between the offset and end of the byte array is too short to hold a bytes32', async () => {
@@ -352,7 +353,7 @@ describe('LibBytes', () => {
             const badOffset = new BigNumber(ethUtil.toBuffer(byteArray).byteLength);
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicWriteBytes32.callAsync(byteArray, badOffset, testBytes32),
-                constants.LIB_BYTES_GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED,
+                ContractLibErrors.LibBytesGreaterOrEqualTo32LengthRequired,
             );
         });
     });
@@ -380,7 +381,7 @@ describe('LibBytes', () => {
             const offset = new BigNumber(0);
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicReadUint256.callAsync(byteArrayShorterThan32Bytes, offset),
-                constants.LIB_BYTES_GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED,
+                ContractLibErrors.LibBytesGreaterOrEqualTo32LengthRequired,
             );
         });
         it('should fail if the length between the offset and end of the byte array is too short to hold a uint256', async () => {
@@ -390,7 +391,7 @@ describe('LibBytes', () => {
             const badOffset = new BigNumber(testUint256AsBuffer.byteLength);
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicReadUint256.callAsync(byteArray, badOffset),
-                constants.LIB_BYTES_GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED,
+                ContractLibErrors.LibBytesGreaterOrEqualTo32LengthRequired,
             );
         });
     });
@@ -430,7 +431,7 @@ describe('LibBytes', () => {
             const offset = new BigNumber(0);
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicWriteUint256.callAsync(byteArrayShorterThan32Bytes, offset, testUint256),
-                constants.LIB_BYTES_GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED,
+                ContractLibErrors.LibBytesGreaterOrEqualTo32LengthRequired,
             );
         });
         it('should fail if the length between the offset and end of the byte array is too short to hold a uint256', async () => {
@@ -438,7 +439,7 @@ describe('LibBytes', () => {
             const badOffset = new BigNumber(ethUtil.toBuffer(byteArray).byteLength);
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicWriteUint256.callAsync(byteArray, badOffset, testUint256),
-                constants.LIB_BYTES_GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED,
+                ContractLibErrors.LibBytesGreaterOrEqualTo32LengthRequired,
             );
         });
     });
@@ -449,7 +450,7 @@ describe('LibBytes', () => {
             const byteArrayLessThan4Bytes = '0x010101';
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicReadFirst4.callAsync(byteArrayLessThan4Bytes),
-                constants.LIB_BYTES_GREATER_OR_EQUAL_TO_4_LENGTH_REQUIRED,
+                ContractLibErrors.LibBytesGreaterOrEqualTo4LengthRequired,
             );
         });
         it('should return the first 4 bytes of a byte array of arbitrary length', async () => {
@@ -504,28 +505,28 @@ describe('LibBytes', () => {
             const offset = new BigNumber(0);
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicReadBytes.callAsync(byteArrayShorterThan32Bytes, offset),
-                constants.LIB_BYTES_GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED,
+                ContractLibErrors.LibBytesGreaterOrEqualTo32LengthRequired,
             );
         });
         it('should fail if we store a nested byte array length, without a nested byte array', async () => {
             const offset = new BigNumber(0);
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicReadBytes.callAsync(testBytes32, offset),
-                constants.LIB_BYTES_GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED,
+                ContractLibErrors.LibBytesGreaterOrEqualToNestedBytesLengthRequired,
             );
         });
         it('should fail if the length between the offset and end of the byte array is too short to hold the length of a nested byte array', async () => {
             const badOffset = new BigNumber(ethUtil.toBuffer(byteArrayShorterThan32Bytes).byteLength);
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicReadBytes.callAsync(byteArrayShorterThan32Bytes, badOffset),
-                constants.LIB_BYTES_GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED,
+                ContractLibErrors.LibBytesGreaterOrEqualTo32LengthRequired,
             );
         });
         it('should fail if the length between the offset and end of the byte array is too short to hold the nested byte array', async () => {
             const badOffset = new BigNumber(ethUtil.toBuffer(testBytes32).byteLength);
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicReadBytes.callAsync(testBytes32, badOffset),
-                constants.LIB_BYTES_GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED,
+                ContractLibErrors.LibBytesGreaterOrEqualTo32LengthRequired,
             );
         });
     });
@@ -605,7 +606,7 @@ describe('LibBytes', () => {
             const emptyByteArray = ethUtil.bufferToHex(new Buffer(1));
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicWriteBytes.callAsync(emptyByteArray, offset, longData),
-                constants.LIB_BYTES_GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED,
+                ContractLibErrors.LibBytesGreaterOrEqualToNestedBytesLengthRequired,
             );
         });
         it('should fail if the length between the offset and end of the byte array is too short to hold the length of a nested byte array)', async () => {
@@ -613,7 +614,7 @@ describe('LibBytes', () => {
             const badOffset = new BigNumber(ethUtil.toBuffer(shortTestBytesAsBuffer).byteLength);
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicWriteBytes.callAsync(emptyByteArray, badOffset, shortData),
-                constants.LIB_BYTES_GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED,
+                ContractLibErrors.LibBytesGreaterOrEqualToNestedBytesLengthRequired,
             );
         });
     });
diff --git a/packages/contracts/test/unlimited_allowance_token.ts b/packages/contracts/test/unlimited_allowance_token.ts
index 7132c57bf..b7d7acd48 100644
--- a/packages/contracts/test/unlimited_allowance_token.ts
+++ b/packages/contracts/test/unlimited_allowance_token.ts
@@ -7,6 +7,7 @@ import { artifacts } from '../src/utils/artifacts';
 import { expectRevertOrOtherErrorAsync } from '../src/utils/assertions';
 import { chaiSetup } from '../src/utils/chai_setup';
 import { constants } from '../src/utils/constants';
+import { ContractLibErrors } from '../src/utils/types';
 import { provider, txDefaults, web3Wrapper } from '../src/utils/web3_wrapper';
 
 chaiSetup.configure();
@@ -55,7 +56,7 @@ describe('UnlimitedAllowanceToken', () => {
             const amountToTransfer = ownerBalance.plus(1);
             return expectRevertOrOtherErrorAsync(
                 token.transfer.callAsync(spender, amountToTransfer, { from: owner }),
-                constants.ERC20_INSUFFICIENT_BALANCE,
+                ContractLibErrors.Erc20InsufficientBalance,
             );
         });
 
@@ -96,7 +97,7 @@ describe('UnlimitedAllowanceToken', () => {
                 token.transferFrom.callAsync(owner, spender, amountToTransfer, {
                     from: spender,
                 }),
-                constants.ERC20_INSUFFICIENT_BALANCE,
+                ContractLibErrors.Erc20InsufficientBalance,
             );
         });
 
@@ -112,7 +113,7 @@ describe('UnlimitedAllowanceToken', () => {
                 token.transferFrom.callAsync(owner, spender, amountToTransfer, {
                     from: spender,
                 }),
-                constants.ERC20_INSUFFICIENT_ALLOWANCE,
+                ContractLibErrors.Erc20InsufficientAllowance,
             );
         });
 
-- 
cgit 


From 7a216901bec6f7f3640d41fb90dcc49ed673cc6f Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Fri, 22 Jun 2018 18:41:55 +0200
Subject: Remove revert reason 'Exchange' prefix

---
 packages/contracts/src/utils/types.ts                   | 4 ++--
 packages/contracts/test/exchange/signature_validator.ts | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/packages/contracts/src/utils/types.ts b/packages/contracts/src/utils/types.ts
index f65a9858b..b3da040c3 100644
--- a/packages/contracts/src/utils/types.ts
+++ b/packages/contracts/src/utils/types.ts
@@ -173,8 +173,8 @@ export enum ContractLibErrors {
     AssetProxyMismatch = 'ASSET_PROXY_MISMATCH',
     AssetProxyIdMismatch = 'ASSET_PROXY_ID_MISMATCH',
     LengthGreaterThan0Required = 'LENGTH_GREATER_THAN_0_REQUIRED',
-    ExchangeLength0Required = 'LENGTH_0_REQUIRED',
-    ExchangeLength65Required = 'LENGTH_65_REQUIRED',
+    Length0Required = 'LENGTH_0_REQUIRED',
+    Length65Required = 'LENGTH_65_REQUIRED',
     InvalidAmount = 'INVALID_AMOUNT',
     TransferFailed = 'TRANSFER_FAILED',
     SenderNotAuthorized = 'SENDER_NOT_AUTHORIZED',
diff --git a/packages/contracts/test/exchange/signature_validator.ts b/packages/contracts/test/exchange/signature_validator.ts
index d53e0758e..e3442a4c2 100644
--- a/packages/contracts/test/exchange/signature_validator.ts
+++ b/packages/contracts/test/exchange/signature_validator.ts
@@ -162,7 +162,7 @@ describe('MixinSignatureValidator', () => {
                     signedOrder.makerAddress,
                     signatureHex,
                 ),
-                ContractLibErrors.ExchangeLength0Required,
+                ContractLibErrors.Length0Required,
             );
         });
 
-- 
cgit 


From 4409f11b24324e23ee2f53436c0226028820e96d Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Fri, 22 Jun 2018 18:45:45 +0200
Subject: Rename ContractLibErrors to RevertReasons

---
 packages/contracts/src/utils/types.ts              |  2 +-
 .../contracts/test/asset_proxy/authorizable.ts     | 10 ++---
 packages/contracts/test/asset_proxy/proxies.ts     | 18 ++++----
 packages/contracts/test/exchange/core.ts           | 48 +++++++++++-----------
 packages/contracts/test/exchange/dispatcher.ts     | 10 ++---
 packages/contracts/test/exchange/match_orders.ts   | 12 +++---
 .../contracts/test/exchange/signature_validator.ts | 10 ++---
 packages/contracts/test/exchange/transactions.ts   | 16 ++++----
 packages/contracts/test/exchange/wrapper.ts        | 12 +++---
 packages/contracts/test/libraries/lib_bytes.ts     | 46 ++++++++++-----------
 .../contracts/test/unlimited_allowance_token.ts    |  8 ++--
 11 files changed, 96 insertions(+), 96 deletions(-)

diff --git a/packages/contracts/src/utils/types.ts b/packages/contracts/src/utils/types.ts
index b3da040c3..03eb5c9b2 100644
--- a/packages/contracts/src/utils/types.ts
+++ b/packages/contracts/src/utils/types.ts
@@ -152,7 +152,7 @@ export interface MatchOrder {
     rightSignature: string;
 }
 
-export enum ContractLibErrors {
+export enum RevertReasons {
     OrderUnfillable = 'ORDER_UNFILLABLE',
     InvalidMaker = 'INVALID_MAKER',
     InvalidTaker = 'INVALID_TAKER',
diff --git a/packages/contracts/test/asset_proxy/authorizable.ts b/packages/contracts/test/asset_proxy/authorizable.ts
index 1ebb094a1..267444ee6 100644
--- a/packages/contracts/test/asset_proxy/authorizable.ts
+++ b/packages/contracts/test/asset_proxy/authorizable.ts
@@ -8,7 +8,7 @@ import {
 } from '../../src/utils/assertions';
 import { chaiSetup } from '../../src/utils/chai_setup';
 import { constants } from '../../src/utils/constants';
-import { ContractLibErrors } from '../../src/utils/types';
+import { RevertReasons } from '../../src/utils/types';
 import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper';
 
 chaiSetup.configure();
@@ -47,7 +47,7 @@ describe('Authorizable', () => {
         it('should throw if not called by owner', async () => {
             return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 authorizable.addAuthorizedAddress.sendTransactionAsync(notOwner, { from: notOwner }),
-                ContractLibErrors.OnlyContractOwner,
+                RevertReasons.OnlyContractOwner,
             );
         });
         it('should allow owner to add an authorized address', async () => {
@@ -65,7 +65,7 @@ describe('Authorizable', () => {
             );
             return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 authorizable.addAuthorizedAddress.sendTransactionAsync(address, { from: owner }),
-                ContractLibErrors.TargetAlreadyAuthorized,
+                RevertReasons.TargetAlreadyAuthorized,
             );
         });
     });
@@ -80,7 +80,7 @@ describe('Authorizable', () => {
                 authorizable.removeAuthorizedAddress.sendTransactionAsync(address, {
                     from: notOwner,
                 }),
-                ContractLibErrors.OnlyContractOwner,
+                RevertReasons.OnlyContractOwner,
             );
         });
 
@@ -104,7 +104,7 @@ describe('Authorizable', () => {
                 authorizable.removeAuthorizedAddress.sendTransactionAsync(address, {
                     from: owner,
                 }),
-                ContractLibErrors.TargetNotAuthorized,
+                RevertReasons.TargetNotAuthorized,
             );
         });
     });
diff --git a/packages/contracts/test/asset_proxy/proxies.ts b/packages/contracts/test/asset_proxy/proxies.ts
index 2c1f52973..0429a3137 100644
--- a/packages/contracts/test/asset_proxy/proxies.ts
+++ b/packages/contracts/test/asset_proxy/proxies.ts
@@ -24,7 +24,7 @@ import { constants } from '../../src/utils/constants';
 import { ERC20Wrapper } from '../../src/utils/erc20_wrapper';
 import { ERC721Wrapper } from '../../src/utils/erc721_wrapper';
 import { LogDecoder } from '../../src/utils/log_decoder';
-import { ContractLibErrors } from '../../src/utils/types';
+import { RevertReasons } from '../../src/utils/types';
 import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper';
 
 chaiSetup.configure();
@@ -172,7 +172,7 @@ describe('Asset Transfer Proxies', () => {
                         transferAmount,
                         { from: exchangeAddress },
                     ),
-                    ContractLibErrors.TransferFailed,
+                    RevertReasons.TransferFailed,
                 );
             });
 
@@ -192,7 +192,7 @@ describe('Asset Transfer Proxies', () => {
                             from: notAuthorized,
                         },
                     ),
-                    ContractLibErrors.SenderNotAuthorized,
+                    RevertReasons.SenderNotAuthorized,
                 );
             });
         });
@@ -246,7 +246,7 @@ describe('Asset Transfer Proxies', () => {
                     erc20Proxy.batchTransferFrom.sendTransactionAsync(assetData, fromAddresses, toAddresses, amounts, {
                         from: notAuthorized,
                     }),
-                    ContractLibErrors.SenderNotAuthorized,
+                    RevertReasons.SenderNotAuthorized,
                 );
             });
         });
@@ -392,7 +392,7 @@ describe('Asset Transfer Proxies', () => {
                         amount,
                         { from: exchangeAddress },
                     ),
-                    ContractLibErrors.InvalidAmount,
+                    RevertReasons.InvalidAmount,
                 );
             });
 
@@ -413,7 +413,7 @@ describe('Asset Transfer Proxies', () => {
                         amount,
                         { from: exchangeAddress },
                     ),
-                    ContractLibErrors.InvalidAmount,
+                    RevertReasons.InvalidAmount,
                 );
             });
 
@@ -440,7 +440,7 @@ describe('Asset Transfer Proxies', () => {
                             from: exchangeAddress,
                         },
                     ),
-                    ContractLibErrors.TransferFailed,
+                    RevertReasons.TransferFailed,
                 );
             });
 
@@ -458,7 +458,7 @@ describe('Asset Transfer Proxies', () => {
                         amount,
                         { from: notAuthorized },
                     ),
-                    ContractLibErrors.SenderNotAuthorized,
+                    RevertReasons.SenderNotAuthorized,
                 );
             });
         });
@@ -513,7 +513,7 @@ describe('Asset Transfer Proxies', () => {
                     erc721Proxy.batchTransferFrom.sendTransactionAsync(assetData, fromAddresses, toAddresses, amounts, {
                         from: notAuthorized,
                     }),
-                    ContractLibErrors.SenderNotAuthorized,
+                    RevertReasons.SenderNotAuthorized,
                 );
             });
         });
diff --git a/packages/contracts/test/exchange/core.ts b/packages/contracts/test/exchange/core.ts
index d35ff7dee..7d4539ae6 100644
--- a/packages/contracts/test/exchange/core.ts
+++ b/packages/contracts/test/exchange/core.ts
@@ -27,7 +27,7 @@ import { ERC20Wrapper } from '../../src/utils/erc20_wrapper';
 import { ERC721Wrapper } from '../../src/utils/erc721_wrapper';
 import { ExchangeWrapper } from '../../src/utils/exchange_wrapper';
 import { OrderFactory } from '../../src/utils/order_factory';
-import { ContractLibErrors, ERC20BalancesByOwner } from '../../src/utils/types';
+import { RevertReasons, ERC20BalancesByOwner } from '../../src/utils/types';
 import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper';
 
 chaiSetup.configure();
@@ -420,7 +420,7 @@ describe('Exchange core', () => {
             });
             return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.fillOrderAsync(signedOrder, takerAddress),
-                ContractLibErrors.InvalidTaker,
+                RevertReasons.InvalidTaker,
             );
         });
 
@@ -438,7 +438,7 @@ describe('Exchange core', () => {
             signedOrder.signature = invalidSigHex;
             return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.fillOrderAsync(signedOrder, takerAddress),
-                ContractLibErrors.InvalidOrderSignature,
+                RevertReasons.InvalidOrderSignature,
             );
         });
 
@@ -449,7 +449,7 @@ describe('Exchange core', () => {
 
             return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.fillOrderAsync(signedOrder, takerAddress),
-                ContractLibErrors.OrderUnfillable,
+                RevertReasons.OrderUnfillable,
             );
         });
 
@@ -460,7 +460,7 @@ describe('Exchange core', () => {
 
             return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.fillOrderAsync(signedOrder, takerAddress),
-                ContractLibErrors.OrderUnfillable,
+                RevertReasons.OrderUnfillable,
             );
         });
 
@@ -471,7 +471,7 @@ describe('Exchange core', () => {
                 exchangeWrapper.fillOrderAsync(signedOrder, takerAddress, {
                     takerAssetFillAmount: new BigNumber(0),
                 }),
-                ContractLibErrors.InvalidTakerAmount,
+                RevertReasons.InvalidTakerAmount,
             );
         });
 
@@ -482,7 +482,7 @@ describe('Exchange core', () => {
 
             return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.fillOrderAsync(signedOrder, takerAddress),
-                ContractLibErrors.TransferFailed,
+                RevertReasons.TransferFailed,
             );
         });
 
@@ -492,7 +492,7 @@ describe('Exchange core', () => {
             });
             return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.fillOrderAsync(signedOrder, takerAddress),
-                ContractLibErrors.TransferFailed,
+                RevertReasons.TransferFailed,
             );
         });
 
@@ -505,7 +505,7 @@ describe('Exchange core', () => {
             );
             return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.fillOrderAsync(signedOrder, takerAddress),
-                ContractLibErrors.TransferFailed,
+                RevertReasons.TransferFailed,
             );
         });
 
@@ -518,7 +518,7 @@ describe('Exchange core', () => {
             );
             return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.fillOrderAsync(signedOrder, takerAddress),
-                ContractLibErrors.TransferFailed,
+                RevertReasons.TransferFailed,
             );
         });
 
@@ -528,7 +528,7 @@ describe('Exchange core', () => {
             });
             return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.fillOrderAsync(signedOrder, takerAddress),
-                ContractLibErrors.OrderUnfillable,
+                RevertReasons.OrderUnfillable,
             );
         });
 
@@ -537,7 +537,7 @@ describe('Exchange core', () => {
             await exchangeWrapper.fillOrderAsync(signedOrder, takerAddress);
             return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.fillOrderAsync(signedOrder, takerAddress),
-                ContractLibErrors.OrderUnfillable,
+                RevertReasons.OrderUnfillable,
             );
         });
     });
@@ -551,7 +551,7 @@ describe('Exchange core', () => {
         it('should throw if not sent by maker', async () => {
             return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.cancelOrderAsync(signedOrder, takerAddress),
-                ContractLibErrors.InvalidMaker,
+                RevertReasons.InvalidMaker,
             );
         });
 
@@ -562,7 +562,7 @@ describe('Exchange core', () => {
 
             return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.cancelOrderAsync(signedOrder, makerAddress),
-                ContractLibErrors.OrderUnfillable,
+                RevertReasons.OrderUnfillable,
             );
         });
 
@@ -573,7 +573,7 @@ describe('Exchange core', () => {
 
             return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.cancelOrderAsync(signedOrder, makerAddress),
-                ContractLibErrors.OrderUnfillable,
+                RevertReasons.OrderUnfillable,
             );
         });
 
@@ -583,7 +583,7 @@ describe('Exchange core', () => {
                 exchangeWrapper.fillOrderAsync(signedOrder, takerAddress, {
                     takerAssetFillAmount: signedOrder.takerAssetAmount.div(2),
                 }),
-                ContractLibErrors.OrderUnfillable,
+                RevertReasons.OrderUnfillable,
             );
         });
 
@@ -606,7 +606,7 @@ describe('Exchange core', () => {
             await exchangeWrapper.cancelOrderAsync(signedOrder, makerAddress);
             return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.cancelOrderAsync(signedOrder, makerAddress),
-                ContractLibErrors.OrderUnfillable,
+                RevertReasons.OrderUnfillable,
             );
         });
 
@@ -616,7 +616,7 @@ describe('Exchange core', () => {
             });
             return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.cancelOrderAsync(signedOrder, makerAddress),
-                ContractLibErrors.OrderUnfillable,
+                RevertReasons.OrderUnfillable,
             );
         });
 
@@ -636,7 +636,7 @@ describe('Exchange core', () => {
                 exchangeWrapper.fillOrderAsync(signedOrder, takerAddress, {
                     takerAssetFillAmount: fillTakerAssetAmount2,
                 }),
-                ContractLibErrors.RoundingError,
+                RevertReasons.RoundingError,
             );
         });
     });
@@ -648,7 +648,7 @@ describe('Exchange core', () => {
             const lesserOrderEpoch = new BigNumber(0);
             return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.cancelOrdersUpToAsync(lesserOrderEpoch, makerAddress),
-                ContractLibErrors.InvalidNewOrderEpoch,
+                RevertReasons.InvalidNewOrderEpoch,
             );
         });
 
@@ -657,7 +657,7 @@ describe('Exchange core', () => {
             await exchangeWrapper.cancelOrdersUpToAsync(orderEpoch, makerAddress);
             return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.cancelOrdersUpToAsync(orderEpoch, makerAddress),
-                ContractLibErrors.InvalidNewOrderEpoch,
+                RevertReasons.InvalidNewOrderEpoch,
             );
         });
 
@@ -817,7 +817,7 @@ describe('Exchange core', () => {
             const takerAssetFillAmount = signedOrder.takerAssetAmount;
             return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.fillOrderAsync(signedOrder, takerAddress, { takerAssetFillAmount }),
-                ContractLibErrors.InvalidAmount,
+                RevertReasons.InvalidAmount,
             );
         });
 
@@ -840,7 +840,7 @@ describe('Exchange core', () => {
             const takerAssetFillAmount = signedOrder.takerAssetAmount;
             return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.fillOrderAsync(signedOrder, takerAddress, { takerAssetFillAmount }),
-                ContractLibErrors.InvalidAmount,
+                RevertReasons.InvalidAmount,
             );
         });
 
@@ -857,7 +857,7 @@ describe('Exchange core', () => {
             const takerAssetFillAmount = signedOrder.takerAssetAmount.div(2);
             return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.fillOrderAsync(signedOrder, takerAddress, { takerAssetFillAmount }),
-                ContractLibErrors.RoundingError,
+                RevertReasons.RoundingError,
             );
         });
 
diff --git a/packages/contracts/test/exchange/dispatcher.ts b/packages/contracts/test/exchange/dispatcher.ts
index d463f6c35..8bf1b3d37 100644
--- a/packages/contracts/test/exchange/dispatcher.ts
+++ b/packages/contracts/test/exchange/dispatcher.ts
@@ -14,7 +14,7 @@ import { chaiSetup } from '../../src/utils/chai_setup';
 import { constants } from '../../src/utils/constants';
 import { ERC20Wrapper } from '../../src/utils/erc20_wrapper';
 import { ERC721Wrapper } from '../../src/utils/erc721_wrapper';
-import { ContractLibErrors } from '../../src/utils/types';
+import { RevertReasons } from '../../src/utils/types';
 import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper';
 
 chaiSetup.configure();
@@ -183,7 +183,7 @@ describe('AssetProxyDispatcher', () => {
                     constants.NULL_ADDRESS,
                     { from: owner },
                 ),
-                ContractLibErrors.AssetProxyMismatch,
+                RevertReasons.AssetProxyMismatch,
             );
         });
 
@@ -225,7 +225,7 @@ describe('AssetProxyDispatcher', () => {
                     prevProxyAddress,
                     { from: notOwner },
                 ),
-                ContractLibErrors.OnlyContractOwner,
+                RevertReasons.OnlyContractOwner,
             );
         });
 
@@ -238,7 +238,7 @@ describe('AssetProxyDispatcher', () => {
                     prevProxyAddress,
                     { from: owner },
                 ),
-                ContractLibErrors.AssetProxyIdMismatch,
+                RevertReasons.AssetProxyIdMismatch,
             );
         });
     });
@@ -320,7 +320,7 @@ describe('AssetProxyDispatcher', () => {
                     amount,
                     { from: owner },
                 ),
-                ContractLibErrors.AssetProxyDoesNotExist,
+                RevertReasons.AssetProxyDoesNotExist,
             );
         });
     });
diff --git a/packages/contracts/test/exchange/match_orders.ts b/packages/contracts/test/exchange/match_orders.ts
index 9d2378dc8..0f7cd32fd 100644
--- a/packages/contracts/test/exchange/match_orders.ts
+++ b/packages/contracts/test/exchange/match_orders.ts
@@ -22,7 +22,7 @@ import { ERC721Wrapper } from '../../src/utils/erc721_wrapper';
 import { ExchangeWrapper } from '../../src/utils/exchange_wrapper';
 import { MatchOrderTester } from '../../src/utils/match_order_tester';
 import { OrderFactory } from '../../src/utils/order_factory';
-import { ContractLibErrors, ERC20BalancesByOwner, ERC721TokenIdsByOwner, OrderInfo, OrderStatus } from '../../src/utils/types';
+import { RevertReasons, ERC20BalancesByOwner, ERC721TokenIdsByOwner, OrderInfo, OrderStatus } from '../../src/utils/types';
 import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper';
 
 chaiSetup.configure();
@@ -602,7 +602,7 @@ describe('matchOrders', () => {
             // Match orders
             return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.matchOrdersAsync(signedOrderLeft, signedOrderRight, takerAddress),
-                ContractLibErrors.OrderUnfillable,
+                RevertReasons.OrderUnfillable,
             );
         });
 
@@ -627,7 +627,7 @@ describe('matchOrders', () => {
             // Match orders
             return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.matchOrdersAsync(signedOrderLeft, signedOrderRight, takerAddress),
-                ContractLibErrors.OrderUnfillable,
+                RevertReasons.OrderUnfillable,
             );
         });
 
@@ -656,7 +656,7 @@ describe('matchOrders', () => {
                     erc20BalancesByOwner,
                     erc721TokenIdsByOwner,
                 ),
-                ContractLibErrors.NegativeSpreadRequired,
+                RevertReasons.NegativeSpreadRequired,
             );
         });
 
@@ -689,7 +689,7 @@ describe('matchOrders', () => {
                 // reverse of the left order, rather than checking equality. This
                 // saves a bunch of gas, but as a result if the assetData fields are
                 // off then the failure ends up happening at signature validation
-                ContractLibErrors.InvalidOrderSignature,
+                RevertReasons.InvalidOrderSignature,
             );
         });
 
@@ -720,7 +720,7 @@ describe('matchOrders', () => {
                     erc20BalancesByOwner,
                     erc721TokenIdsByOwner,
                 ),
-                ContractLibErrors.InvalidOrderSignature,
+                RevertReasons.InvalidOrderSignature,
             );
         });
 
diff --git a/packages/contracts/test/exchange/signature_validator.ts b/packages/contracts/test/exchange/signature_validator.ts
index e3442a4c2..f829e0820 100644
--- a/packages/contracts/test/exchange/signature_validator.ts
+++ b/packages/contracts/test/exchange/signature_validator.ts
@@ -18,7 +18,7 @@ import { chaiSetup } from '../../src/utils/chai_setup';
 import { constants } from '../../src/utils/constants';
 import { LogDecoder } from '../../src/utils/log_decoder';
 import { OrderFactory } from '../../src/utils/order_factory';
-import { ContractLibErrors } from '../../src/utils/types';
+import { RevertReasons } from '../../src/utils/types';
 import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper';
 
 chaiSetup.configure();
@@ -108,7 +108,7 @@ describe('MixinSignatureValidator', () => {
                     signedOrder.makerAddress,
                     emptySignature,
                 ),
-                ContractLibErrors.LengthGreaterThan0Required,
+                RevertReasons.LengthGreaterThan0Required,
             );
         });
 
@@ -122,7 +122,7 @@ describe('MixinSignatureValidator', () => {
                     signedOrder.makerAddress,
                     unsupportedSignatureHex,
                 ),
-                ContractLibErrors.SignatureUnsupported,
+                RevertReasons.SignatureUnsupported,
             );
         });
 
@@ -135,7 +135,7 @@ describe('MixinSignatureValidator', () => {
                     signedOrder.makerAddress,
                     unsupportedSignatureHex,
                 ),
-                ContractLibErrors.SignatureIllegal,
+                RevertReasons.SignatureIllegal,
             );
         });
 
@@ -162,7 +162,7 @@ describe('MixinSignatureValidator', () => {
                     signedOrder.makerAddress,
                     signatureHex,
                 ),
-                ContractLibErrors.Length0Required,
+                RevertReasons.Length0Required,
             );
         });
 
diff --git a/packages/contracts/test/exchange/transactions.ts b/packages/contracts/test/exchange/transactions.ts
index 958a6dce8..c2a70de26 100644
--- a/packages/contracts/test/exchange/transactions.ts
+++ b/packages/contracts/test/exchange/transactions.ts
@@ -20,7 +20,7 @@ import { ExchangeWrapper } from '../../src/utils/exchange_wrapper';
 import { OrderFactory } from '../../src/utils/order_factory';
 import { orderUtils } from '../../src/utils/order_utils';
 import { TransactionFactory } from '../../src/utils/transaction_factory';
-import { ContractLibErrors, ERC20BalancesByOwner, SignedTransaction } from '../../src/utils/types';
+import { RevertReasons, ERC20BalancesByOwner, SignedTransaction } from '../../src/utils/types';
 import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper';
 
 chaiSetup.configure();
@@ -129,7 +129,7 @@ describe('Exchange transactions', () => {
             it('should throw if not called by specified sender', async () => {
                 return expectRevertReasonOrAlwaysFailingTransactionAsync(
                     exchangeWrapper.executeTransactionAsync(signedTx, takerAddress),
-                    ContractLibErrors.FailedExecution,
+                    RevertReasons.FailedExecution,
                 );
             });
 
@@ -172,7 +172,7 @@ describe('Exchange transactions', () => {
                 await exchangeWrapper.executeTransactionAsync(signedTx, senderAddress);
                 return expectRevertReasonOrAlwaysFailingTransactionAsync(
                     exchangeWrapper.executeTransactionAsync(signedTx, senderAddress),
-                    ContractLibErrors.InvalidTxHash,
+                    RevertReasons.InvalidTxHash,
                 );
             });
 
@@ -192,7 +192,7 @@ describe('Exchange transactions', () => {
             it('should throw if not called by specified sender', async () => {
                 return expectRevertReasonOrAlwaysFailingTransactionAsync(
                     exchangeWrapper.executeTransactionAsync(signedTx, makerAddress),
-                    ContractLibErrors.FailedExecution,
+                    RevertReasons.FailedExecution,
                 );
             });
 
@@ -200,7 +200,7 @@ describe('Exchange transactions', () => {
                 await exchangeWrapper.executeTransactionAsync(signedTx, senderAddress);
                 return expectRevertReasonOrAlwaysFailingTransactionAsync(
                     exchangeWrapper.fillOrderAsync(signedOrder, senderAddress),
-                    ContractLibErrors.OrderUnfillable,
+                    RevertReasons.OrderUnfillable,
                 );
             });
         });
@@ -252,7 +252,7 @@ describe('Exchange transactions', () => {
                         signedFillTx.signature,
                         { from: takerAddress },
                     ),
-                    ContractLibErrors.FailedExecution,
+                    RevertReasons.FailedExecution,
                 );
             });
 
@@ -371,7 +371,7 @@ describe('Exchange transactions', () => {
                     signedOrder.signature,
                     { from: takerAddress },
                 ),
-                ContractLibErrors.MakerNotWhitelisted,
+                RevertReasons.MakerNotWhitelisted,
             );
         });
 
@@ -393,7 +393,7 @@ describe('Exchange transactions', () => {
                     signedOrder.signature,
                     { from: takerAddress },
                 ),
-                ContractLibErrors.TakerNotWhitelisted,
+                RevertReasons.TakerNotWhitelisted,
             );
         });
 
diff --git a/packages/contracts/test/exchange/wrapper.ts b/packages/contracts/test/exchange/wrapper.ts
index 3d7465659..26bdc24d0 100644
--- a/packages/contracts/test/exchange/wrapper.ts
+++ b/packages/contracts/test/exchange/wrapper.ts
@@ -21,7 +21,7 @@ import { ERC20Wrapper } from '../../src/utils/erc20_wrapper';
 import { ERC721Wrapper } from '../../src/utils/erc721_wrapper';
 import { ExchangeWrapper } from '../../src/utils/exchange_wrapper';
 import { OrderFactory } from '../../src/utils/order_factory';
-import { ContractLibErrors, ERC20BalancesByOwner } from '../../src/utils/types';
+import { RevertReasons, ERC20BalancesByOwner } from '../../src/utils/types';
 import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper';
 
 chaiSetup.configure();
@@ -174,7 +174,7 @@ describe('Exchange wrappers', () => {
 
             return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.fillOrKillOrderAsync(signedOrder, takerAddress),
-                ContractLibErrors.OrderUnfillable,
+                RevertReasons.OrderUnfillable,
             );
         });
 
@@ -187,7 +187,7 @@ describe('Exchange wrappers', () => {
 
             return expectRevertReasonOrAlwaysFailingTransactionAsync(
                 exchangeWrapper.fillOrKillOrderAsync(signedOrder, takerAddress),
-                ContractLibErrors.CompleteFillFailed,
+                RevertReasons.CompleteFillFailed,
             );
         });
     });
@@ -502,7 +502,7 @@ describe('Exchange wrappers', () => {
                     exchangeWrapper.batchFillOrKillOrdersAsync(signedOrders, takerAddress, {
                         takerAssetFillAmounts,
                     }),
-                    ContractLibErrors.OrderUnfillable,
+                    RevertReasons.OrderUnfillable,
                 );
             });
         });
@@ -707,7 +707,7 @@ describe('Exchange wrappers', () => {
                     }),
                     // We simply use the takerAssetData from the first order for all orders.
                     // If they are not the same, the contract throws when validating the order signature
-                    ContractLibErrors.InvalidOrderSignature,
+                    RevertReasons.InvalidOrderSignature,
                 );
             });
         });
@@ -923,7 +923,7 @@ describe('Exchange wrappers', () => {
                     exchangeWrapper.marketBuyOrdersAsync(signedOrders, takerAddress, {
                         makerAssetFillAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(1000), 18),
                     }),
-                    ContractLibErrors.InvalidOrderSignature,
+                    RevertReasons.InvalidOrderSignature,
                 );
             });
         });
diff --git a/packages/contracts/test/libraries/lib_bytes.ts b/packages/contracts/test/libraries/lib_bytes.ts
index 2d54596d5..bc1856b40 100644
--- a/packages/contracts/test/libraries/lib_bytes.ts
+++ b/packages/contracts/test/libraries/lib_bytes.ts
@@ -11,7 +11,7 @@ import { artifacts } from '../../src/utils/artifacts';
 import { expectRevertOrOtherErrorAsync } from '../../src/utils/assertions';
 import { chaiSetup } from '../../src/utils/chai_setup';
 import { constants } from '../../src/utils/constants';
-import { ContractLibErrors } from '../../src/utils/types';
+import { RevertReasons } from '../../src/utils/types';
 import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper';
 
 chaiSetup.configure();
@@ -96,7 +96,7 @@ describe('LibBytes', () => {
         it('should revert if length is 0', async () => {
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicPopLastByte.callAsync(constants.NULL_BYTES),
-                ContractLibErrors.LibBytesGreaterThanZeroLengthRequired,
+                RevertReasons.LibBytesGreaterThanZeroLengthRequired,
             );
         });
         it('should pop the last byte from the input and return it', async () => {
@@ -112,7 +112,7 @@ describe('LibBytes', () => {
         it('should revert if length is less than 20', async () => {
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicPopLast20Bytes.callAsync(byteArrayShorterThan20Bytes),
-                ContractLibErrors.LibBytesGreaterOrEqualTo20LengthRequired
+                RevertReasons.LibBytesGreaterOrEqualTo20LengthRequired
             );
         });
         it('should pop the last 20 bytes from the input and return it', async () => {
@@ -173,7 +173,7 @@ describe('LibBytes', () => {
         it('should revert if dest is shorter than source', async () => {
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicDeepCopyBytes.callAsync(byteArrayShorterThan32Bytes, byteArrayLongerThan32Bytes),
-                ContractLibErrors.LibBytesGreaterOrEqualToSourceBytesLengthRequired
+                RevertReasons.LibBytesGreaterOrEqualToSourceBytesLengthRequired
             );
         });
         it('should overwrite dest with source if source and dest have equal length', async () => {
@@ -226,7 +226,7 @@ describe('LibBytes', () => {
             const offset = new BigNumber(0);
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicReadAddress.callAsync(shortByteArray, offset),
-                ContractLibErrors.LibBytesGreaterOrEqualTo20LengthRequired,
+                RevertReasons.LibBytesGreaterOrEqualTo20LengthRequired,
             );
         });
         it('should fail if the length between the offset and end of the byte array is too short to hold an address', async () => {
@@ -234,7 +234,7 @@ describe('LibBytes', () => {
             const badOffset = new BigNumber(ethUtil.toBuffer(byteArray).byteLength);
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicReadAddress.callAsync(byteArray, badOffset),
-                ContractLibErrors.LibBytesGreaterOrEqualTo20LengthRequired,
+                RevertReasons.LibBytesGreaterOrEqualTo20LengthRequired,
             );
         });
     });
@@ -270,7 +270,7 @@ describe('LibBytes', () => {
             const offset = new BigNumber(0);
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicWriteAddress.callAsync(byteArrayShorterThan20Bytes, offset, testAddress),
-                ContractLibErrors.LibBytesGreaterOrEqualTo20LengthRequired,
+                RevertReasons.LibBytesGreaterOrEqualTo20LengthRequired,
             );
         });
         it('should fail if the length between the offset and end of the byte array is too short to hold an address', async () => {
@@ -278,7 +278,7 @@ describe('LibBytes', () => {
             const badOffset = new BigNumber(ethUtil.toBuffer(byteArray).byteLength);
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicWriteAddress.callAsync(byteArray, badOffset, testAddress),
-                ContractLibErrors.LibBytesGreaterOrEqualTo20LengthRequired,
+                RevertReasons.LibBytesGreaterOrEqualTo20LengthRequired,
             );
         });
     });
@@ -302,14 +302,14 @@ describe('LibBytes', () => {
             const offset = new BigNumber(0);
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicReadBytes32.callAsync(byteArrayShorterThan32Bytes, offset),
-                ContractLibErrors.LibBytesGreaterOrEqualTo32LengthRequired,
+                RevertReasons.LibBytesGreaterOrEqualTo32LengthRequired,
             );
         });
         it('should fail if the length between the offset and end of the byte array is too short to hold a bytes32', async () => {
             const badOffset = new BigNumber(ethUtil.toBuffer(testBytes32).byteLength);
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicReadBytes32.callAsync(testBytes32, badOffset),
-                ContractLibErrors.LibBytesGreaterOrEqualTo32LengthRequired,
+                RevertReasons.LibBytesGreaterOrEqualTo32LengthRequired,
             );
         });
     });
@@ -345,7 +345,7 @@ describe('LibBytes', () => {
             const offset = new BigNumber(0);
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicWriteBytes32.callAsync(byteArrayShorterThan32Bytes, offset, testBytes32),
-                ContractLibErrors.LibBytesGreaterOrEqualTo32LengthRequired,
+                RevertReasons.LibBytesGreaterOrEqualTo32LengthRequired,
             );
         });
         it('should fail if the length between the offset and end of the byte array is too short to hold a bytes32', async () => {
@@ -353,7 +353,7 @@ describe('LibBytes', () => {
             const badOffset = new BigNumber(ethUtil.toBuffer(byteArray).byteLength);
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicWriteBytes32.callAsync(byteArray, badOffset, testBytes32),
-                ContractLibErrors.LibBytesGreaterOrEqualTo32LengthRequired,
+                RevertReasons.LibBytesGreaterOrEqualTo32LengthRequired,
             );
         });
     });
@@ -381,7 +381,7 @@ describe('LibBytes', () => {
             const offset = new BigNumber(0);
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicReadUint256.callAsync(byteArrayShorterThan32Bytes, offset),
-                ContractLibErrors.LibBytesGreaterOrEqualTo32LengthRequired,
+                RevertReasons.LibBytesGreaterOrEqualTo32LengthRequired,
             );
         });
         it('should fail if the length between the offset and end of the byte array is too short to hold a uint256', async () => {
@@ -391,7 +391,7 @@ describe('LibBytes', () => {
             const badOffset = new BigNumber(testUint256AsBuffer.byteLength);
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicReadUint256.callAsync(byteArray, badOffset),
-                ContractLibErrors.LibBytesGreaterOrEqualTo32LengthRequired,
+                RevertReasons.LibBytesGreaterOrEqualTo32LengthRequired,
             );
         });
     });
@@ -431,7 +431,7 @@ describe('LibBytes', () => {
             const offset = new BigNumber(0);
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicWriteUint256.callAsync(byteArrayShorterThan32Bytes, offset, testUint256),
-                ContractLibErrors.LibBytesGreaterOrEqualTo32LengthRequired,
+                RevertReasons.LibBytesGreaterOrEqualTo32LengthRequired,
             );
         });
         it('should fail if the length between the offset and end of the byte array is too short to hold a uint256', async () => {
@@ -439,7 +439,7 @@ describe('LibBytes', () => {
             const badOffset = new BigNumber(ethUtil.toBuffer(byteArray).byteLength);
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicWriteUint256.callAsync(byteArray, badOffset, testUint256),
-                ContractLibErrors.LibBytesGreaterOrEqualTo32LengthRequired,
+                RevertReasons.LibBytesGreaterOrEqualTo32LengthRequired,
             );
         });
     });
@@ -450,7 +450,7 @@ describe('LibBytes', () => {
             const byteArrayLessThan4Bytes = '0x010101';
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicReadFirst4.callAsync(byteArrayLessThan4Bytes),
-                ContractLibErrors.LibBytesGreaterOrEqualTo4LengthRequired,
+                RevertReasons.LibBytesGreaterOrEqualTo4LengthRequired,
             );
         });
         it('should return the first 4 bytes of a byte array of arbitrary length', async () => {
@@ -505,28 +505,28 @@ describe('LibBytes', () => {
             const offset = new BigNumber(0);
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicReadBytes.callAsync(byteArrayShorterThan32Bytes, offset),
-                ContractLibErrors.LibBytesGreaterOrEqualTo32LengthRequired,
+                RevertReasons.LibBytesGreaterOrEqualTo32LengthRequired,
             );
         });
         it('should fail if we store a nested byte array length, without a nested byte array', async () => {
             const offset = new BigNumber(0);
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicReadBytes.callAsync(testBytes32, offset),
-                ContractLibErrors.LibBytesGreaterOrEqualToNestedBytesLengthRequired,
+                RevertReasons.LibBytesGreaterOrEqualToNestedBytesLengthRequired,
             );
         });
         it('should fail if the length between the offset and end of the byte array is too short to hold the length of a nested byte array', async () => {
             const badOffset = new BigNumber(ethUtil.toBuffer(byteArrayShorterThan32Bytes).byteLength);
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicReadBytes.callAsync(byteArrayShorterThan32Bytes, badOffset),
-                ContractLibErrors.LibBytesGreaterOrEqualTo32LengthRequired,
+                RevertReasons.LibBytesGreaterOrEqualTo32LengthRequired,
             );
         });
         it('should fail if the length between the offset and end of the byte array is too short to hold the nested byte array', async () => {
             const badOffset = new BigNumber(ethUtil.toBuffer(testBytes32).byteLength);
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicReadBytes.callAsync(testBytes32, badOffset),
-                ContractLibErrors.LibBytesGreaterOrEqualTo32LengthRequired,
+                RevertReasons.LibBytesGreaterOrEqualTo32LengthRequired,
             );
         });
     });
@@ -606,7 +606,7 @@ describe('LibBytes', () => {
             const emptyByteArray = ethUtil.bufferToHex(new Buffer(1));
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicWriteBytes.callAsync(emptyByteArray, offset, longData),
-                ContractLibErrors.LibBytesGreaterOrEqualToNestedBytesLengthRequired,
+                RevertReasons.LibBytesGreaterOrEqualToNestedBytesLengthRequired,
             );
         });
         it('should fail if the length between the offset and end of the byte array is too short to hold the length of a nested byte array)', async () => {
@@ -614,7 +614,7 @@ describe('LibBytes', () => {
             const badOffset = new BigNumber(ethUtil.toBuffer(shortTestBytesAsBuffer).byteLength);
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicWriteBytes.callAsync(emptyByteArray, badOffset, shortData),
-                ContractLibErrors.LibBytesGreaterOrEqualToNestedBytesLengthRequired,
+                RevertReasons.LibBytesGreaterOrEqualToNestedBytesLengthRequired,
             );
         });
     });
diff --git a/packages/contracts/test/unlimited_allowance_token.ts b/packages/contracts/test/unlimited_allowance_token.ts
index b7d7acd48..9f52232e2 100644
--- a/packages/contracts/test/unlimited_allowance_token.ts
+++ b/packages/contracts/test/unlimited_allowance_token.ts
@@ -7,7 +7,7 @@ import { artifacts } from '../src/utils/artifacts';
 import { expectRevertOrOtherErrorAsync } from '../src/utils/assertions';
 import { chaiSetup } from '../src/utils/chai_setup';
 import { constants } from '../src/utils/constants';
-import { ContractLibErrors } from '../src/utils/types';
+import { RevertReasons } from '../src/utils/types';
 import { provider, txDefaults, web3Wrapper } from '../src/utils/web3_wrapper';
 
 chaiSetup.configure();
@@ -56,7 +56,7 @@ describe('UnlimitedAllowanceToken', () => {
             const amountToTransfer = ownerBalance.plus(1);
             return expectRevertOrOtherErrorAsync(
                 token.transfer.callAsync(spender, amountToTransfer, { from: owner }),
-                ContractLibErrors.Erc20InsufficientBalance,
+                RevertReasons.Erc20InsufficientBalance,
             );
         });
 
@@ -97,7 +97,7 @@ describe('UnlimitedAllowanceToken', () => {
                 token.transferFrom.callAsync(owner, spender, amountToTransfer, {
                     from: spender,
                 }),
-                ContractLibErrors.Erc20InsufficientBalance,
+                RevertReasons.Erc20InsufficientBalance,
             );
         });
 
@@ -113,7 +113,7 @@ describe('UnlimitedAllowanceToken', () => {
                 token.transferFrom.callAsync(owner, spender, amountToTransfer, {
                     from: spender,
                 }),
-                ContractLibErrors.Erc20InsufficientAllowance,
+                RevertReasons.Erc20InsufficientAllowance,
             );
         });
 
-- 
cgit 


From 1e03fbe1a8aba1c5a8b358272de81a09a201eec9 Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Fri, 22 Jun 2018 18:50:02 +0200
Subject: Fix prettier

---
 packages/contracts/test/asset_proxy/authorizable.ts |  4 +---
 packages/contracts/test/exchange/match_orders.ts    | 12 ++++++++----
 packages/contracts/test/exchange/transactions.ts    |  4 +---
 packages/contracts/test/exchange/wrapper.ts         |  4 +---
 packages/contracts/test/libraries/lib_bytes.ts      |  4 ++--
 5 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/packages/contracts/test/asset_proxy/authorizable.ts b/packages/contracts/test/asset_proxy/authorizable.ts
index 267444ee6..a317f217a 100644
--- a/packages/contracts/test/asset_proxy/authorizable.ts
+++ b/packages/contracts/test/asset_proxy/authorizable.ts
@@ -3,9 +3,7 @@ import * as chai from 'chai';
 
 import { MixinAuthorizableContract } from '../../src/generated_contract_wrappers/mixin_authorizable';
 import { artifacts } from '../../src/utils/artifacts';
-import {
-    expectRevertReasonOrAlwaysFailingTransactionAsync,
-} from '../../src/utils/assertions';
+import { expectRevertReasonOrAlwaysFailingTransactionAsync } from '../../src/utils/assertions';
 import { chaiSetup } from '../../src/utils/chai_setup';
 import { constants } from '../../src/utils/constants';
 import { RevertReasons } from '../../src/utils/types';
diff --git a/packages/contracts/test/exchange/match_orders.ts b/packages/contracts/test/exchange/match_orders.ts
index 0f7cd32fd..30a37e01e 100644
--- a/packages/contracts/test/exchange/match_orders.ts
+++ b/packages/contracts/test/exchange/match_orders.ts
@@ -12,9 +12,7 @@ import { ERC20ProxyContract } from '../../src/generated_contract_wrappers/e_r_c2
 import { ERC721ProxyContract } from '../../src/generated_contract_wrappers/e_r_c721_proxy';
 import { ExchangeContract } from '../../src/generated_contract_wrappers/exchange';
 import { artifacts } from '../../src/utils/artifacts';
-import {
-    expectRevertReasonOrAlwaysFailingTransactionAsync,
-} from '../../src/utils/assertions';
+import { expectRevertReasonOrAlwaysFailingTransactionAsync } from '../../src/utils/assertions';
 import { chaiSetup } from '../../src/utils/chai_setup';
 import { constants } from '../../src/utils/constants';
 import { ERC20Wrapper } from '../../src/utils/erc20_wrapper';
@@ -22,7 +20,13 @@ import { ERC721Wrapper } from '../../src/utils/erc721_wrapper';
 import { ExchangeWrapper } from '../../src/utils/exchange_wrapper';
 import { MatchOrderTester } from '../../src/utils/match_order_tester';
 import { OrderFactory } from '../../src/utils/order_factory';
-import { RevertReasons, ERC20BalancesByOwner, ERC721TokenIdsByOwner, OrderInfo, OrderStatus } from '../../src/utils/types';
+import {
+    RevertReasons,
+    ERC20BalancesByOwner,
+    ERC721TokenIdsByOwner,
+    OrderInfo,
+    OrderStatus,
+} from '../../src/utils/types';
 import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper';
 
 chaiSetup.configure();
diff --git a/packages/contracts/test/exchange/transactions.ts b/packages/contracts/test/exchange/transactions.ts
index c2a70de26..d74dde749 100644
--- a/packages/contracts/test/exchange/transactions.ts
+++ b/packages/contracts/test/exchange/transactions.ts
@@ -10,9 +10,7 @@ import { ExchangeContract } from '../../src/generated_contract_wrappers/exchange
 import { ExchangeWrapperContract } from '../../src/generated_contract_wrappers/exchange_wrapper';
 import { WhitelistContract } from '../../src/generated_contract_wrappers/whitelist';
 import { artifacts } from '../../src/utils/artifacts';
-import {
-    expectRevertReasonOrAlwaysFailingTransactionAsync,
-} from '../../src/utils/assertions';
+import { expectRevertReasonOrAlwaysFailingTransactionAsync } from '../../src/utils/assertions';
 import { chaiSetup } from '../../src/utils/chai_setup';
 import { constants } from '../../src/utils/constants';
 import { ERC20Wrapper } from '../../src/utils/erc20_wrapper';
diff --git a/packages/contracts/test/exchange/wrapper.ts b/packages/contracts/test/exchange/wrapper.ts
index 26bdc24d0..3ff02f9e2 100644
--- a/packages/contracts/test/exchange/wrapper.ts
+++ b/packages/contracts/test/exchange/wrapper.ts
@@ -12,9 +12,7 @@ import { ERC20ProxyContract } from '../../src/generated_contract_wrappers/e_r_c2
 import { ERC721ProxyContract } from '../../src/generated_contract_wrappers/e_r_c721_proxy';
 import { ExchangeContract } from '../../src/generated_contract_wrappers/exchange';
 import { artifacts } from '../../src/utils/artifacts';
-import {
-    expectRevertReasonOrAlwaysFailingTransactionAsync,
-} from '../../src/utils/assertions';
+import { expectRevertReasonOrAlwaysFailingTransactionAsync } from '../../src/utils/assertions';
 import { chaiSetup } from '../../src/utils/chai_setup';
 import { constants } from '../../src/utils/constants';
 import { ERC20Wrapper } from '../../src/utils/erc20_wrapper';
diff --git a/packages/contracts/test/libraries/lib_bytes.ts b/packages/contracts/test/libraries/lib_bytes.ts
index bc1856b40..7db0f60b5 100644
--- a/packages/contracts/test/libraries/lib_bytes.ts
+++ b/packages/contracts/test/libraries/lib_bytes.ts
@@ -112,7 +112,7 @@ describe('LibBytes', () => {
         it('should revert if length is less than 20', async () => {
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicPopLast20Bytes.callAsync(byteArrayShorterThan20Bytes),
-                RevertReasons.LibBytesGreaterOrEqualTo20LengthRequired
+                RevertReasons.LibBytesGreaterOrEqualTo20LengthRequired,
             );
         });
         it('should pop the last 20 bytes from the input and return it', async () => {
@@ -173,7 +173,7 @@ describe('LibBytes', () => {
         it('should revert if dest is shorter than source', async () => {
             return expectRevertOrOtherErrorAsync(
                 libBytes.publicDeepCopyBytes.callAsync(byteArrayShorterThan32Bytes, byteArrayLongerThan32Bytes),
-                RevertReasons.LibBytesGreaterOrEqualToSourceBytesLengthRequired
+                RevertReasons.LibBytesGreaterOrEqualToSourceBytesLengthRequired,
             );
         });
         it('should overwrite dest with source if source and dest have equal length', async () => {
-- 
cgit 


From 2f6f815d81ff0f36a35a31c40bff7df1a974a1af Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Fri, 22 Jun 2018 18:54:18 +0200
Subject: Fix tslint

---
 packages/contracts/test/exchange/core.ts         | 2 +-
 packages/contracts/test/exchange/match_orders.ts | 2 +-
 packages/contracts/test/exchange/transactions.ts | 2 +-
 packages/contracts/test/exchange/wrapper.ts      | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/packages/contracts/test/exchange/core.ts b/packages/contracts/test/exchange/core.ts
index 7d4539ae6..069a2ab87 100644
--- a/packages/contracts/test/exchange/core.ts
+++ b/packages/contracts/test/exchange/core.ts
@@ -27,7 +27,7 @@ import { ERC20Wrapper } from '../../src/utils/erc20_wrapper';
 import { ERC721Wrapper } from '../../src/utils/erc721_wrapper';
 import { ExchangeWrapper } from '../../src/utils/exchange_wrapper';
 import { OrderFactory } from '../../src/utils/order_factory';
-import { RevertReasons, ERC20BalancesByOwner } from '../../src/utils/types';
+import { ERC20BalancesByOwner, RevertReasons } from '../../src/utils/types';
 import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper';
 
 chaiSetup.configure();
diff --git a/packages/contracts/test/exchange/match_orders.ts b/packages/contracts/test/exchange/match_orders.ts
index 30a37e01e..c9a78321d 100644
--- a/packages/contracts/test/exchange/match_orders.ts
+++ b/packages/contracts/test/exchange/match_orders.ts
@@ -21,11 +21,11 @@ import { ExchangeWrapper } from '../../src/utils/exchange_wrapper';
 import { MatchOrderTester } from '../../src/utils/match_order_tester';
 import { OrderFactory } from '../../src/utils/order_factory';
 import {
-    RevertReasons,
     ERC20BalancesByOwner,
     ERC721TokenIdsByOwner,
     OrderInfo,
     OrderStatus,
+    RevertReasons,
 } from '../../src/utils/types';
 import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper';
 
diff --git a/packages/contracts/test/exchange/transactions.ts b/packages/contracts/test/exchange/transactions.ts
index d74dde749..b2e097760 100644
--- a/packages/contracts/test/exchange/transactions.ts
+++ b/packages/contracts/test/exchange/transactions.ts
@@ -18,7 +18,7 @@ import { ExchangeWrapper } from '../../src/utils/exchange_wrapper';
 import { OrderFactory } from '../../src/utils/order_factory';
 import { orderUtils } from '../../src/utils/order_utils';
 import { TransactionFactory } from '../../src/utils/transaction_factory';
-import { RevertReasons, ERC20BalancesByOwner, SignedTransaction } from '../../src/utils/types';
+import { ERC20BalancesByOwner, RevertReasons, SignedTransaction } from '../../src/utils/types';
 import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper';
 
 chaiSetup.configure();
diff --git a/packages/contracts/test/exchange/wrapper.ts b/packages/contracts/test/exchange/wrapper.ts
index 3ff02f9e2..6e8a1aeb7 100644
--- a/packages/contracts/test/exchange/wrapper.ts
+++ b/packages/contracts/test/exchange/wrapper.ts
@@ -19,7 +19,7 @@ import { ERC20Wrapper } from '../../src/utils/erc20_wrapper';
 import { ERC721Wrapper } from '../../src/utils/erc721_wrapper';
 import { ExchangeWrapper } from '../../src/utils/exchange_wrapper';
 import { OrderFactory } from '../../src/utils/order_factory';
-import { RevertReasons, ERC20BalancesByOwner } from '../../src/utils/types';
+import { ERC20BalancesByOwner, RevertReasons } from '../../src/utils/types';
 import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper';
 
 chaiSetup.configure();
-- 
cgit