From 6cb9bd4426bff5885f3b453d60a6a00f048abb6b Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 29 May 2017 23:21:38 +0200 Subject: [PATCH 1/3] Instead of removing all files from ./lib/src for the UMD test, we leave the utils and schema folders as well as the types file since they are used by the test files --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 310ca4a8ed..75a55b899c 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,8 @@ "build:commonjs:dev": "tsc; copyfiles -u 2 ./src/artifacts/*.json ../0x.js/lib/src/artifacts;", "test:commonjs": "run-s build:commonjs:dev run_mocha", "pretest:umd": "run-s clean build:*:dev", - "substitute_umd_bundle": "shx rm -rf lib/src && shx mv _bundles lib/src", + "substitute_umd_bundle": "npm run remove_src_files_not_used_by_tests; shx mv _bundles/* lib/src", + "remove_src_files_not_used_by_tests": "find ./lib/src \\( -path ./lib/src/utils -o -path ./lib/src/schemas -o -path \"./lib/src/types.*\" \\) -prune -o -type f -print | xargs rm", "run_mocha": "mocha lib/test/**/*_test.js" }, "config": { From 000e364406a8644bdcf9384405fb921b4cdbc4da Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 30 May 2017 09:53:55 +0200 Subject: [PATCH 2/3] Reverts: 7e96b45ea0c51ca5589640018172a91a35596148 which broke this regex for the `0x0` edge-case --- src/web3_wrapper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/web3_wrapper.ts b/src/web3_wrapper.ts index 3b460e4da9..97d04db8c6 100644 --- a/src/web3_wrapper.ts +++ b/src/web3_wrapper.ts @@ -50,7 +50,7 @@ export class Web3Wrapper { public async doesContractExistAtAddressAsync(address: string): Promise { const code = await promisify(this.web3.eth.getCode)(address); // Regex matches 0x0, 0x00, 0x in order to accomodate poorly implemented clients - const zeroHexAddressRegex = /^0x0\{0,40\}$/i; + const zeroHexAddressRegex = /^0x0*$/i; const didFindCode = _.isNull(code.match(zeroHexAddressRegex)); return didFindCode; } From c9111aea382806db1b2ed64f0e075e4193ceb63a Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 30 May 2017 09:54:11 +0200 Subject: [PATCH 3/3] name exchangeWrapper test file properly --- test/{contract_wrapper_test.ts => exchange_wrapper.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename test/{contract_wrapper_test.ts => exchange_wrapper.ts} (100%) diff --git a/test/contract_wrapper_test.ts b/test/exchange_wrapper.ts similarity index 100% rename from test/contract_wrapper_test.ts rename to test/exchange_wrapper.ts