From 9778695b4ad1fd999eb79b01c768a2f2b9938917 Mon Sep 17 00:00:00 2001 From: fragosti Date: Mon, 4 Jun 2018 19:48:21 -0700 Subject: Try enabling no-unused-variable... --- packages/order-utils/src/assert.ts | 1 - packages/order-utils/src/order_hash.ts | 3 --- packages/order-utils/src/order_state_utils.ts | 1 - packages/order-utils/src/signature_utils.ts | 1 - packages/order-utils/test/assert_test.ts | 1 - packages/order-utils/test/order_hash_test.ts | 2 -- packages/order-utils/test/signature_utils_test.ts | 3 +-- packages/order-utils/test/utils/web3_wrapper.ts | 2 +- 8 files changed, 2 insertions(+), 12 deletions(-) (limited to 'packages/order-utils') diff --git a/packages/order-utils/src/assert.ts b/packages/order-utils/src/assert.ts index a1318b9b8..b4335980f 100644 --- a/packages/order-utils/src/assert.ts +++ b/packages/order-utils/src/assert.ts @@ -4,7 +4,6 @@ import { assert as sharedAssert } from '@0xproject/assert'; import { Schema } from '@0xproject/json-schemas'; // tslint:disable-next-line:no-unused-variable import { ECSignature, SignatureType } from '@0xproject/types'; -import { BigNumber } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as _ from 'lodash'; diff --git a/packages/order-utils/src/order_hash.ts b/packages/order-utils/src/order_hash.ts index 2ef746ef8..b9d0b43aa 100644 --- a/packages/order-utils/src/order_hash.ts +++ b/packages/order-utils/src/order_hash.ts @@ -1,9 +1,6 @@ import { schemas, SchemaValidator } from '@0xproject/json-schemas'; import { Order, SignedOrder } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; -import BN = require('bn.js'); -import { SolidityTypes } from 'ethereum-types'; -import * as ethABI from 'ethereumjs-abi'; import * as ethUtil from 'ethereumjs-util'; import * as _ from 'lodash'; diff --git a/packages/order-utils/src/order_state_utils.ts b/packages/order-utils/src/order_state_utils.ts index 61050c9d6..da33ea010 100644 --- a/packages/order-utils/src/order_state_utils.ts +++ b/packages/order-utils/src/order_state_utils.ts @@ -7,7 +7,6 @@ import { SignedOrder, } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; -import * as _ from 'lodash'; import { AbstractBalanceAndProxyAllowanceFetcher } from './abstract/abstract_balance_and_proxy_allowance_fetcher'; import { AbstractOrderFilledCancelledFetcher } from './abstract/abstract_order_filled_cancelled_fetcher'; diff --git a/packages/order-utils/src/signature_utils.ts b/packages/order-utils/src/signature_utils.ts index c57699af0..c3fa0b6a5 100644 --- a/packages/order-utils/src/signature_utils.ts +++ b/packages/order-utils/src/signature_utils.ts @@ -159,7 +159,6 @@ export function isValidECSignature(data: string, signature: ECSignature, signerA assert.isHexString('data', data); assert.doesConformToSchema('signature', signature, schemas.ecSignatureSchema); assert.isETHAddressHex('signerAddress', signerAddress); - const normalizedSignerAddress = signerAddress.toLowerCase(); const msgHashBuff = ethUtil.toBuffer(data); try { diff --git a/packages/order-utils/test/assert_test.ts b/packages/order-utils/test/assert_test.ts index 033fd6732..4b22ef27d 100644 --- a/packages/order-utils/test/assert_test.ts +++ b/packages/order-utils/test/assert_test.ts @@ -1,4 +1,3 @@ -import { web3Factory } from '@0xproject/dev-utils'; import * as chai from 'chai'; import 'make-promises-safe'; import 'mocha'; diff --git a/packages/order-utils/test/order_hash_test.ts b/packages/order-utils/test/order_hash_test.ts index d571fc62a..7cf6435c2 100644 --- a/packages/order-utils/test/order_hash_test.ts +++ b/packages/order-utils/test/order_hash_test.ts @@ -1,4 +1,3 @@ -import { web3Factory } from '@0xproject/dev-utils'; import { Order } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import * as chai from 'chai'; @@ -8,7 +7,6 @@ import 'mocha'; import { constants, orderHashUtils } from '../src'; import { chaiSetup } from './utils/chai_setup'; -import { web3Wrapper } from './utils/web3_wrapper'; chaiSetup.configure(); const expect = chai.expect; diff --git a/packages/order-utils/test/signature_utils_test.ts b/packages/order-utils/test/signature_utils_test.ts index c1a3cc7fb..74033104a 100644 --- a/packages/order-utils/test/signature_utils_test.ts +++ b/packages/order-utils/test/signature_utils_test.ts @@ -1,4 +1,3 @@ -import { web3Factory } from '@0xproject/dev-utils'; import { BigNumber } from '@0xproject/utils'; import * as chai from 'chai'; import { JSONRPCErrorCallback, JSONRPCRequestPayload } from 'ethereum-types'; @@ -7,7 +6,7 @@ import 'make-promises-safe'; import 'mocha'; import * as Sinon from 'sinon'; -import { ecSignOrderHashAsync, generatePseudoRandomSalt, MessagePrefixType, orderHashUtils } from '../src'; +import { ecSignOrderHashAsync, generatePseudoRandomSalt, MessagePrefixType } from '../src'; import { isValidECSignature, isValidSignatureAsync } from '../src/signature_utils'; import { chaiSetup } from './utils/chai_setup'; diff --git a/packages/order-utils/test/utils/web3_wrapper.ts b/packages/order-utils/test/utils/web3_wrapper.ts index 419f76dde..ab801fa7f 100644 --- a/packages/order-utils/test/utils/web3_wrapper.ts +++ b/packages/order-utils/test/utils/web3_wrapper.ts @@ -1,4 +1,4 @@ -import { devConstants, web3Factory } from '@0xproject/dev-utils'; +import { web3Factory } from '@0xproject/dev-utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import { Provider } from 'ethereum-types'; -- cgit v1.2.3 From 86a6a5b826158fbf3b16081a2ecdbb020140adda Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 5 Jun 2018 12:20:23 +0200 Subject: Replace `-` with `_` in yarn script name so that we are consistent across yarn script names --- packages/order-utils/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/order-utils') diff --git a/packages/order-utils/package.json b/packages/order-utils/package.json index 5a04c58f7..41c2f8757 100644 --- a/packages/order-utils/package.json +++ b/packages/order-utils/package.json @@ -15,7 +15,7 @@ "generate_contract_wrappers": "abi-gen --abis 'lib/src/artifacts/@(Exchange|IWallet|IValidator).json' --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/generated_contract_wrappers --backend ethers && prettier --write 'src/generated_contract_wrappers/**.ts'", "update_artifacts": "for i in ${npm_package_config_contracts}; do copyfiles -u 4 ../migrations/artifacts/2.0.0/$i.json lib/src/artifacts; done;", "test": "yarn run_mocha", - "rebuild-and-test": "run-s build test", + "rebuild_and_test": "run-s build test", "test:circleci": "yarn test:coverage", "run_mocha": "mocha lib/test/**/*_test.js --bail --exit", "test:coverage": "nyc npm run test --all && yarn coverage:report:lcov", -- cgit v1.2.3 From 25f62daf146895a1e0e0c966166f08f28467ae2e Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 5 Jun 2018 15:38:40 +0200 Subject: - Rename watch to watch_without_deps in sub-packages, so dev's don't confuse running watch from root dir, with sub-package dir - stop using special prebuild script name and run pre_build steps for `watch` and `build` commands - Remove `clean` step from `build`/`watch` --- packages/order-utils/package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'packages/order-utils') diff --git a/packages/order-utils/package.json b/packages/order-utils/package.json index 5a04c58f7..f9785ce17 100644 --- a/packages/order-utils/package.json +++ b/packages/order-utils/package.json @@ -8,8 +8,9 @@ "main": "lib/src/index.js", "types": "lib/src/index.d.ts", "scripts": { - "watch": "tsc -w", - "build": "run-s clean update_artifacts generate_contract_wrappers transpile copy_monorepo_scripts", + "watch_without_deps": "yarn pre_build && tsc -w", + "build": "run-s pre_build transpile copy_monorepo_scripts", + "pre_build": "run-s update_artifacts generate_contract_wrappers", "transpile": "tsc", "copy_monorepo_scripts": "copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts", "generate_contract_wrappers": "abi-gen --abis 'lib/src/artifacts/@(Exchange|IWallet|IValidator).json' --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/generated_contract_wrappers --backend ethers && prettier --write 'src/generated_contract_wrappers/**.ts'", -- cgit v1.2.3 From fe437da7517b4ea8e308a7210a34e66b715d5c78 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 6 Jun 2018 12:23:50 +0200 Subject: Exclude generate contract wrappers from tslint --- packages/order-utils/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/order-utils') diff --git a/packages/order-utils/package.json b/packages/order-utils/package.json index 2d7e7ba66..bce11461b 100644 --- a/packages/order-utils/package.json +++ b/packages/order-utils/package.json @@ -20,7 +20,7 @@ "test:coverage": "nyc npm run test --all && yarn coverage:report:lcov", "coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info", "clean": "shx rm -rf lib scripts lib/src/artifacts src/generated_contract_wrappers", - "lint": "tslint --project .", + "lint": "tslint --project . --exclude **/src/generated_contract_wrappers/**/*", "manual:postpublish": "yarn build; node ./scripts/postpublish.js", "docs:stage": "node scripts/stage_docs.js", "docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_FILES", -- cgit v1.2.3 From 42f39de0f93eb9068f574f53b0d71917a27a80a2 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 4 Jun 2018 13:48:06 -0700 Subject: Stop running prettier on generated files --- packages/order-utils/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/order-utils') diff --git a/packages/order-utils/package.json b/packages/order-utils/package.json index da168610b..661fbab4f 100644 --- a/packages/order-utils/package.json +++ b/packages/order-utils/package.json @@ -13,7 +13,7 @@ "pre_build": "run-s update_artifacts generate_contract_wrappers", "transpile": "tsc", "copy_monorepo_scripts": "copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts", - "generate_contract_wrappers": "abi-gen --abis 'lib/src/artifacts/@(Exchange|IWallet|IValidator).json' --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/generated_contract_wrappers --backend ethers && prettier --write 'src/generated_contract_wrappers/**.ts'", + "generate_contract_wrappers": "abi-gen --abis 'lib/src/artifacts/@(Exchange|IWallet|IValidator).json' --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/generated_contract_wrappers --backend ethers", "update_artifacts": "for i in ${npm_package_config_contracts}; do copyfiles -u 4 ../migrations/artifacts/2.0.0/$i.json lib/src/artifacts; done;", "test": "yarn run_mocha", "rebuild_and_test": "run-s build test", -- cgit v1.2.3 From a97d77064aacda3de74b04894f110b05298c5ca8 Mon Sep 17 00:00:00 2001 From: fragosti Date: Wed, 6 Jun 2018 15:26:40 -0700 Subject: Get build and tests to pass --- packages/order-utils/src/assert.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'packages/order-utils') diff --git a/packages/order-utils/src/assert.ts b/packages/order-utils/src/assert.ts index b4335980f..b4b57d02a 100644 --- a/packages/order-utils/src/assert.ts +++ b/packages/order-utils/src/assert.ts @@ -1,10 +1,11 @@ import { assert as sharedAssert } from '@0xproject/assert'; // We need those two unused imports because they're actually used by sharedAssert which gets injected here -// tslint:disable-next-line:no-unused-variable +// tslint:disable:no-unused-variable import { Schema } from '@0xproject/json-schemas'; -// tslint:disable-next-line:no-unused-variable import { ECSignature, SignatureType } from '@0xproject/types'; +import { BigNumber } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; +// tslint:enable:no-unused-variable import * as _ from 'lodash'; import { utils } from './utils'; -- cgit v1.2.3