From 835fa0af131f8a0deeb6dc1030e584687f336332 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 16 Jan 2018 13:44:38 +0100 Subject: [PATCH 01/21] Test workflow --- .circleci/config.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 85b0555710..e64f4b5b7b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,10 +20,30 @@ jobs: - run: unzip ${CONTRACTS_COMMIT_HASH}.zip -d testrpc_snapshot - run: node ./node_modules/lerna/bin/lerna.js bootstrap - run: yarn lerna:run build + test: + steps: - run: name: testrpc command: npm run testrpc -- --db testrpc_snapshot background: true - run: yarn lerna:run test:circleci + lint: + steps: - run: yarn lerna:run lint + prettier: + steps: - run: yarn prettier:ci +workflows: + version: 2 + main: + jobs: + - build + - test: + requires: + - build + - lint: + requires: + - build + - prettier: + requires: + - build From 593f7e826ce7ae2c8725fcc572f2c1d9955b296f Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 16 Jan 2018 13:45:36 +0100 Subject: [PATCH 02/21] Specify the executor --- .circleci/config.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index e64f4b5b7b..45af8de7de 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -21,6 +21,8 @@ jobs: - run: node ./node_modules/lerna/bin/lerna.js bootstrap - run: yarn lerna:run build test: + docker: + - image: circleci/node:6.12 steps: - run: name: testrpc @@ -28,9 +30,13 @@ jobs: background: true - run: yarn lerna:run test:circleci lint: + docker: + - image: circleci/node:6.12 steps: - run: yarn lerna:run lint prettier: + docker: + - image: circleci/node:6.12 steps: - run: yarn prettier:ci workflows: From 6bc0e815e965921e6f3e02bf921ce01d5fad10e2 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 16 Jan 2018 13:54:13 +0100 Subject: [PATCH 03/21] Add caching between steps --- .circleci/config.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 45af8de7de..84f3dc947c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,6 +6,7 @@ jobs: - image: circleci/node:6.12 environment: CONTRACTS_COMMIT_HASH: '9ed05f5' + working_directory: ~/repo steps: - checkout - run: echo 'export PATH=$HOME/CIRCLE_PROJECT_REPONAME/node_modules/.bin:$PATH' >> $BASH_ENV @@ -20,24 +21,40 @@ jobs: - run: unzip ${CONTRACTS_COMMIT_HASH}.zip -d testrpc_snapshot - run: node ./node_modules/lerna/bin/lerna.js bootstrap - run: yarn lerna:run build + - save_cache: + key: repo-{{ .Environment.CIRCLE_SHA1 }} + paths: + - ~/repo test: docker: - image: circleci/node:6.12 + working_directory: ~/repo steps: + - restore_cache: + keys: + - repo-{{ .Environment.CIRCLE_SHA1 }} - run: name: testrpc command: npm run testrpc -- --db testrpc_snapshot background: true - run: yarn lerna:run test:circleci lint: + working_directory: ~/repo docker: - image: circleci/node:6.12 steps: + - restore_cache: + keys: + - repo-{{ .Environment.CIRCLE_SHA1 }} - run: yarn lerna:run lint prettier: + working_directory: ~/repo docker: - image: circleci/node:6.12 steps: + - restore_cache: + keys: + - repo-{{ .Environment.CIRCLE_SHA1 }} - run: yarn prettier:ci workflows: version: 2 From 7040a01cf2d154e16ab97fe0bfcb9297962eb77a Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 16 Jan 2018 14:01:46 +0100 Subject: [PATCH 04/21] Remove umd tests --- packages/0x.js/package.json | 7 +------ packages/0x.js/scripts/test_umd.sh | 6 ------ 2 files changed, 1 insertion(+), 12 deletions(-) delete mode 100755 packages/0x.js/scripts/test_umd.sh diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json index 1f11c43d67..12416fa4ac 100644 --- a/packages/0x.js/package.json +++ b/packages/0x.js/package.json @@ -14,21 +14,16 @@ "generate_contract_wrappers": "node ../abi-gen/lib/index.js --abiGlob 'src/artifacts/@(Exchange|Token|TokenTransferProxy|EtherToken|TokenRegistry|DummyToken).json' --templates contract_templates --output src/contract_wrappers/generated", "lint": "tslint --project . 'src/**/*.ts' 'test/**/*.ts'", - "test:circleci": - "run-s test:coverage report_test_coverage && if [ $CIRCLE_BRANCH = \"development\" ]; then yarn test:umd; fi", + "test:circleci": "run-s test:coverage report_test_coverage", "test": "run-s clean test:commonjs", - "test:umd": "./scripts/test_umd.sh", "test:coverage": "nyc npm run test --all", "report_test_coverage": "nyc report --reporter=text-lcov | coveralls", "update_contracts": "for i in ${npm_package_config_artifacts}; do copyfiles -u 4 ../contracts/build/contracts/$i.json ../0x.js/src/artifacts; done;", "clean": "shx rm -rf _bundles lib test_temp", - "build:umd:dev": "webpack", "build:umd:prod": "NODE_ENV=production webpack", "build:commonjs": "tsc && copyfiles -u 2 './src/artifacts/**/*.json' ./lib/src/artifacts;", "test:commonjs": "run-s build:commonjs run_mocha", - "pretest:umd": "run-s clean build:umd:dev build:commonjs", - "substitute_umd_bundle": "shx mv _bundles/* lib/src", "run_mocha": "mocha lib/test/**/*_test.js --timeout 10000 --bail --exit" }, "config": { diff --git a/packages/0x.js/scripts/test_umd.sh b/packages/0x.js/scripts/test_umd.sh deleted file mode 100755 index e3eba088ae..0000000000 --- a/packages/0x.js/scripts/test_umd.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash -# This script runs umd tests and cleans up after them while preserving the `return_code` for CI -# UMD tests should only be run after building the commonjs because they reuse some of the commonjs build artifacts -run-s substitute_umd_bundle run_mocha -return_code=$? -exit $return_code From 1ccb97861273838523bf2e58c1ee8056605c259b Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 16 Jan 2018 14:04:02 +0100 Subject: [PATCH 05/21] Split tests into two bundles --- .circleci/config.yml | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 84f3dc947c..da3b4d3860 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -25,7 +25,7 @@ jobs: key: repo-{{ .Environment.CIRCLE_SHA1 }} paths: - ~/repo - test: + test-0xjs: docker: - image: circleci/node:6.12 working_directory: ~/repo @@ -37,7 +37,20 @@ jobs: name: testrpc command: npm run testrpc -- --db testrpc_snapshot background: true - - run: yarn lerna:run test:circleci + - run: yarn lerna:run --scope 0x.js test:circleci + test-rest: + docker: + - image: circleci/node:6.12 + working_directory: ~/repo + steps: + - restore_cache: + keys: + - repo-{{ .Environment.CIRCLE_SHA1 }} + - run: + name: testrpc + command: npm run testrpc -- --db testrpc_snapshot + background: true + - run: yarn lerna:run --ignore 0x.js test:circleci lint: working_directory: ~/repo docker: @@ -61,7 +74,10 @@ workflows: main: jobs: - build - - test: + - test-0xjs: + requires: + - build + - test-rest: requires: - build - lint: From ae8cb2e6a8fc4bcd49fd4713308590a97c54556f Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 16 Jan 2018 14:05:11 +0100 Subject: [PATCH 06/21] Don't run testrpc for the rest of the tests --- .circleci/config.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index da3b4d3860..66dabcea57 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -46,10 +46,6 @@ jobs: - restore_cache: keys: - repo-{{ .Environment.CIRCLE_SHA1 }} - - run: - name: testrpc - command: npm run testrpc -- --db testrpc_snapshot - background: true - run: yarn lerna:run --ignore 0x.js test:circleci lint: working_directory: ~/repo From 3ebd8b7f45e1e6f7bf15cc731d291766d836ddac Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 16 Jan 2018 14:11:17 +0100 Subject: [PATCH 07/21] Revert "Don't run testrpc for the rest of the tests" This reverts commit ae8cb2e6a8fc4bcd49fd4713308590a97c54556f. --- .circleci/config.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 66dabcea57..da3b4d3860 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -46,6 +46,10 @@ jobs: - restore_cache: keys: - repo-{{ .Environment.CIRCLE_SHA1 }} + - run: + name: testrpc + command: npm run testrpc -- --db testrpc_snapshot + background: true - run: yarn lerna:run --ignore 0x.js test:circleci lint: working_directory: ~/repo From 8a7496381541afc38687b0a1561a3cd8bb5f9918 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 16 Jan 2018 14:31:28 +0100 Subject: [PATCH 08/21] Respore dependency cache --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index da3b4d3860..40650c539f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,6 +10,8 @@ jobs: steps: - checkout - run: echo 'export PATH=$HOME/CIRCLE_PROJECT_REPONAME/node_modules/.bin:$PATH' >> $BASH_ENV + - restore_cache: + key: dependency-cache-{{ checksum "package.json" }} - run: name: yarn command: yarn From 7c1c94d39bfb9ff7872de7a6435ac52e94de4ec1 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 16 Jan 2018 14:36:04 +0100 Subject: [PATCH 09/21] Change cached directory --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 40650c539f..0416fae84c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -18,7 +18,7 @@ jobs: - save_cache: key: dependency-cache-{{ checksum "package.json" }} paths: - - ~/.cache/yarn + - ./node_modules - run: wget https://s3.amazonaws.com/testrpc-shapshots/${CONTRACTS_COMMIT_HASH}.zip - run: unzip ${CONTRACTS_COMMIT_HASH}.zip -d testrpc_snapshot - run: node ./node_modules/lerna/bin/lerna.js bootstrap From 9521bf8d4fd769712702169ef1ea4ee6296d1ca8 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 16 Jan 2018 15:20:15 +0100 Subject: [PATCH 10/21] Separate contracts tests from others --- .circleci/config.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0416fae84c..47cf0af168 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -40,7 +40,7 @@ jobs: command: npm run testrpc -- --db testrpc_snapshot background: true - run: yarn lerna:run --scope 0x.js test:circleci - test-rest: + test-contracts: docker: - image: circleci/node:6.12 working_directory: ~/repo @@ -52,7 +52,16 @@ jobs: name: testrpc command: npm run testrpc -- --db testrpc_snapshot background: true - - run: yarn lerna:run --ignore 0x.js test:circleci + - run: yarn lerna:run --scope contracts test:circleci + test-rest: + docker: + - image: circleci/node:6.12 + working_directory: ~/repo + steps: + - restore_cache: + keys: + - repo-{{ .Environment.CIRCLE_SHA1 }} + - run: yarn lerna:run --ignore contracts,0x.js test:circleci lint: working_directory: ~/repo docker: @@ -79,6 +88,9 @@ workflows: - test-0xjs: requires: - build + - test-contracts: + requires: + - build - test-rest: requires: - build From 59f9605ed9b7aec6f7125ab8bfd5ec45dc3a07c5 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 16 Jan 2018 15:26:15 +0100 Subject: [PATCH 11/21] Run testrpc for rest tests --- .circleci/config.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 47cf0af168..1adc4cd251 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -61,6 +61,10 @@ jobs: - restore_cache: keys: - repo-{{ .Environment.CIRCLE_SHA1 }} + - run: + name: testrpc + command: npm run testrpc -- --db testrpc_snapshot + background: true - run: yarn lerna:run --ignore contracts,0x.js test:circleci lint: working_directory: ~/repo From a350638526fbc50c0dba33b0a77bd74685fed532 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 16 Jan 2018 15:40:20 +0100 Subject: [PATCH 12/21] Upgrade testrpc to 6.0.3 to avoid some race-conditions --- package.json | 2 +- yarn.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 597e618865..d0e6966cd3 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "devDependencies": { "@0xproject/utils": "^0.1.0", "async-child-process": "^1.1.1", - "ethereumjs-testrpc": "6.0.3", + "ethereumjs-testrpc": "^6.0.3", "lerna": "^2.5.1", "prettier": "1.9.2", "publish-release": "0xproject/publish-release", diff --git a/yarn.lock b/yarn.lock index ce1d12ade1..1808c48686 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3184,7 +3184,7 @@ ethereumjs-blockstream@^2.0.6: source-map-support "0.4.14" uuid "3.0.1" -ethereumjs-testrpc@6.0.3: +ethereumjs-testrpc@^6.0.3: version "6.0.3" resolved "https://registry.yarnpkg.com/ethereumjs-testrpc/-/ethereumjs-testrpc-6.0.3.tgz#7a0b87bf3670f92f607f98fa6a78801d9741b124" dependencies: From a45de6d4273ef3f4f6b676c948fc1b6e4c673ab7 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 16 Jan 2018 15:50:15 +0100 Subject: [PATCH 13/21] Return is pensing events are undefined --- packages/0x.js/src/order_watcher/event_watcher.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/0x.js/src/order_watcher/event_watcher.ts b/packages/0x.js/src/order_watcher/event_watcher.ts index 43a60957b9..5d05bfb60a 100644 --- a/packages/0x.js/src/order_watcher/event_watcher.ts +++ b/packages/0x.js/src/order_watcher/event_watcher.ts @@ -51,6 +51,10 @@ export class EventWatcher { } private async _pollForBlockchainEventsAsync(callback: EventWatcherCallback): Promise { const pendingEvents = await this._getEventsAsync(); + if (_.isUndefined(pendingEvents)) { + // HACK: This should never happen, but happens frequently on CI due to a ganache bug + return; + } if (pendingEvents.length === 0) { // HACK: Sometimes when node rebuilds the pending block we get back the empty result. // We don't want to emit a lot of removal events and bring them back after a couple of miliseconds, From e2ca71365859aad4256fb73ffaf22df2a0a01576 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 16 Jan 2018 16:03:06 +0100 Subject: [PATCH 14/21] Fix the glob pattern for exclusion --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1adc4cd251..e391533fd8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -65,7 +65,7 @@ jobs: name: testrpc command: npm run testrpc -- --db testrpc_snapshot background: true - - run: yarn lerna:run --ignore contracts,0x.js test:circleci + - run: yarn lerna:run --ignore "contracts|0x.js" test:circleci lint: working_directory: ~/repo docker: From 35501dd4fc9d2034356f364447dec2e26b88557b Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 16 Jan 2018 16:17:20 +0100 Subject: [PATCH 15/21] Fix ignore configuration --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e391533fd8..1795a4bfc1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -65,7 +65,7 @@ jobs: name: testrpc command: npm run testrpc -- --db testrpc_snapshot background: true - - run: yarn lerna:run --ignore "contracts|0x.js" test:circleci + - run: yarn lerna:run --ignore contracts --ignore 0x.js --ignore subproviders test:circleci lint: working_directory: ~/repo docker: From 3894311d68ff2b38287154c6dc335a36e1d0be97 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 16 Jan 2018 16:36:21 +0100 Subject: [PATCH 16/21] Test deployer separately from contracts --- .circleci/config.yml | 22 +++++++++++++++++++--- packages/contracts/package.json | 3 ++- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1795a4bfc1..10c5fc8860 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -52,7 +52,20 @@ jobs: name: testrpc command: npm run testrpc -- --db testrpc_snapshot background: true - - run: yarn lerna:run --scope contracts test:circleci + - run: yarn lerna:run --scope contracts test:circleci:contracts + test-deployer: + docker: + - image: circleci/node:6.12 + working_directory: ~/repo + steps: + - restore_cache: + keys: + - repo-{{ .Environment.CIRCLE_SHA1 }} + - run: + name: testrpc + command: npm run testrpc -- --db testrpc_snapshot + background: true + - run: yarn lerna:run --scope contracts test:circleci:deployer test-rest: docker: - image: circleci/node:6.12 @@ -95,12 +108,15 @@ workflows: - test-contracts: requires: - build - - test-rest: + - test-deployer: requires: - build - - lint: + - test-rest: requires: - build - prettier: requires: - build + - lint: + requires: + - build diff --git a/packages/contracts/package.json b/packages/contracts/package.json index a3abac517a..d184410ca5 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -16,7 +16,8 @@ "migrate:truffle": "npm run build; truffle migrate", "migrate": "npm run build; node lib/deploy/cli.js migrate", "lint": "tslint --project . 'migrations/**/*.ts' 'test/**/*.ts' 'util/**/*.ts' 'deploy/**/*.ts'", - "test:circleci": "yarn test; yarn test:deployer", + "test:circleci:contracts": "yarn test", + "test:circleci:deployer": "yarn test:deployer", "test:deployer": "npm run build; mocha lib/deploy/test/*_test.js" }, "repository": { From df9c2b193e6c31d531be735d40561d86c40660cd Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 16 Jan 2018 21:28:26 +0100 Subject: [PATCH 17/21] Remove trailing slash --- packages/0x.js/test/utils/constants.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/0x.js/test/utils/constants.ts b/packages/0x.js/test/utils/constants.ts index 7b6b2ee7b2..a9e665c25c 100644 --- a/packages/0x.js/test/utils/constants.ts +++ b/packages/0x.js/test/utils/constants.ts @@ -1,6 +1,6 @@ export const constants = { NULL_ADDRESS: '0x0000000000000000000000000000000000000000', - RPC_URL: 'http://localhost:8545/', + RPC_URL: 'http://localhost:8545', ROPSTEN_NETWORK_ID: 3, KOVAN_NETWORK_ID: 42, TESTRPC_NETWORK_ID: 50, From 59a39ac57dc66f16835788c7a9ab60e0db568c61 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 17 Jan 2018 15:35:14 +0100 Subject: [PATCH 18/21] Fix a stupid RPC bug which caused the port togo over 65535 --- packages/dev-utils/src/rpc.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/dev-utils/src/rpc.ts b/packages/dev-utils/src/rpc.ts index cf6678f81a..36f8b1ef94 100644 --- a/packages/dev-utils/src/rpc.ts +++ b/packages/dev-utils/src/rpc.ts @@ -41,7 +41,7 @@ export class RPC { method, params, }); - this._url += 1; + this._id += 1; return payload; } private async _sendAsync(payload: string): Promise { From de3bf03f42b25f65ad1baea2f85185d93ca19791 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 17 Jan 2018 15:55:58 +0100 Subject: [PATCH 19/21] Add --frozen-lockfile flag on CI --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 10c5fc8860..d95940898b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,7 +14,7 @@ jobs: key: dependency-cache-{{ checksum "package.json" }} - run: name: yarn - command: yarn + command: yarn --frozen-lockfile - save_cache: key: dependency-cache-{{ checksum "package.json" }} paths: From 9f47c72d31412d30471ab05dbb22780dd2f29036 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 17 Jan 2018 16:07:49 +0100 Subject: [PATCH 20/21] Remove unused dependencies --- packages/0x.js/package.json | 2 -- packages/0x.js/src/globals.d.ts | 12 ------------ 2 files changed, 14 deletions(-) diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json index 12416fa4ac..f9b92f21b2 100644 --- a/packages/0x.js/package.json +++ b/packages/0x.js/package.json @@ -83,11 +83,9 @@ "@0xproject/web3-wrapper": "^0.1.4", "bintrees": "^1.0.2", "bn.js": "^4.11.8", - "compare-versions": "^3.0.1", "ethereumjs-abi": "^0.6.4", "ethereumjs-blockstream": "^2.0.6", "ethereumjs-util": "^5.1.1", - "find-versions": "^2.0.0", "js-sha3": "^0.6.1", "lodash": "^4.17.4", "uuid": "^3.1.0", diff --git a/packages/0x.js/src/globals.d.ts b/packages/0x.js/src/globals.d.ts index ff8e00b69e..4f4932b6e3 100644 --- a/packages/0x.js/src/globals.d.ts +++ b/packages/0x.js/src/globals.d.ts @@ -25,18 +25,6 @@ declare module '*.json' { /* tslint:enable */ } -// find-version declarations -declare function findVersions(version: string): string[]; -declare module 'find-versions' { - export = findVersions; -} - -// compare-version declarations -declare function compareVersions(firstVersion: string, secondVersion: string): number; -declare module 'compare-versions' { - export = compareVersions; -} - declare module 'ethereumjs-abi' { const soliditySHA3: (argTypes: string[], args: any[]) => Buffer; } From b4375d6f64fc0651c7ba347fcfe36e171fa261fc Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 17 Jan 2018 16:14:25 +0100 Subject: [PATCH 21/21] Enable restrict-plus-operands and fix issues detected --- packages/tslint-config/tslint.json | 1 + packages/website/ts/components/eth_weth_conversion_button.tsx | 2 +- .../ts/components/generate_order/generate_order_form.tsx | 2 +- packages/website/ts/components/inputs/allowance_toggle.tsx | 2 +- packages/website/ts/components/token_balances.tsx | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/tslint-config/tslint.json b/packages/tslint-config/tslint.json index 486780de6f..971588b089 100644 --- a/packages/tslint-config/tslint.json +++ b/packages/tslint-config/tslint.json @@ -60,6 +60,7 @@ "prefer-function-over-method": true, "promise-function-async": true, "quotemark": [true, "single", "avoid-escape", "jsx-double"], + "restrict-plus-operands": true, "semicolon": [true, "always"], "space-before-function-paren": [ true, diff --git a/packages/website/ts/components/eth_weth_conversion_button.tsx b/packages/website/ts/components/eth_weth_conversion_button.tsx index f2c505207c..300e71f1f8 100644 --- a/packages/website/ts/components/eth_weth_conversion_button.tsx +++ b/packages/website/ts/components/eth_weth_conversion_button.tsx @@ -105,7 +105,7 @@ export class EthWethConversionButton extends React.Component< } this.props.onConversionSuccessful(); } catch (err) { - const errMsg = '' + err; + const errMsg = `${err}`; if (_.includes(errMsg, BlockchainCallErrs.UserHasNoAssociatedAddresses)) { this.props.dispatcher.updateShouldBlockchainErrDialogBeOpen(true); } else if (!_.includes(errMsg, 'User denied transaction')) { diff --git a/packages/website/ts/components/generate_order/generate_order_form.tsx b/packages/website/ts/components/generate_order/generate_order_form.tsx index 3144fc3bdd..3ae0d48a71 100644 --- a/packages/website/ts/components/generate_order/generate_order_form.tsx +++ b/packages/website/ts/components/generate_order/generate_order_form.tsx @@ -329,7 +329,7 @@ export class GenerateOrderForm extends React.Component