Merge branch 'implementFirstExchangeMethod' of github.com:0xProject/0x.js into implementFirstExchangeMethod

This commit is contained in:
Fabio Berger 2017-05-26 18:20:43 +02:00
commit 95f07a428b
2 changed files with 3 additions and 3 deletions

View File

@ -12,7 +12,7 @@
"scripts": { "scripts": {
"clean": "shx rm -rf _bundles lib", "clean": "shx rm -rf _bundles lib",
"build:bundle": "webpack", "build:bundle": "webpack",
"build:commonjs": "tsc; copyfiles -u 2 ./src/artifacts/*.json ./../0x.js/lib/src/artifacts;", "build:commonjs": "tsc; copyfiles -u 2 ./src/artifacts/*.json ../0x.js/lib/src/artifacts;",
"build": "npm run clean && run-p build:*", "build": "npm run clean && run-p build:*",
"lint": "tslint src/ts/**/*", "lint": "tslint src/ts/**/*",
"test": "run-s clean build:commonjs && mocha lib/test/**/*_test.js", "test": "run-s clean build:commonjs && mocha lib/test/**/*_test.js",
@ -20,7 +20,7 @@
"docs:json": "typedoc --json docs/index.json .", "docs:json": "typedoc --json docs/index.json .",
"docs:generate": "typedoc --out docs .", "docs:generate": "typedoc --out docs .",
"docs:open": "opn docs/index.html", "docs:open": "opn docs/index.html",
"update_contracts": "for i in ${npm_package_config_artifacts}; do copyfiles -u 4 ./../contracts/build/contracts/$i.json ./../0x.js/src/artifacts; done;", "update_contracts": "for i in ${npm_package_config_artifacts}; do copyfiles -u 4 ../contracts/build/contracts/$i.json ../0x.js/src/artifacts; done;",
"testrpc": "testrpc -p 8545 --networkId 50" "testrpc": "testrpc -p 8545 --networkId 50"
}, },
"config": { "config": {

View File

@ -50,7 +50,7 @@ export class Web3Wrapper {
public async doesContractExistAtAddressAsync(address: string): Promise<boolean> { public async doesContractExistAtAddressAsync(address: string): Promise<boolean> {
const code = await promisify(this.web3.eth.getCode)(address); const code = await promisify(this.web3.eth.getCode)(address);
// Regex matches 0x0, 0x00, 0x in order to accomodate poorly implemented clients // Regex matches 0x0, 0x00, 0x in order to accomodate poorly implemented clients
const zeroHexAddressRegex = /^0[xX][0]*$/; const zeroHexAddressRegex = /^0x0*$/i;
const didFindCode = _.isNull(code.match(zeroHexAddressRegex)); const didFindCode = _.isNull(code.match(zeroHexAddressRegex));
return didFindCode; return didFindCode;
} }