Comparing version 0.1.3 to 0.1.4
16
index.js
@@ -179,6 +179,7 @@ /** | ||
} catch (exc) { | ||
if (n.slice(0,1) === '-') { | ||
bn = new BigNumber("-0x" + n.slice(1)); | ||
if (this.is_hex(n)) { | ||
bn = new BigNumber(this.prefix_hex(n)); | ||
} else { | ||
return console.error(exc); | ||
} | ||
bn = new BigNumber("0x" + n); | ||
} | ||
@@ -191,3 +192,7 @@ } | ||
} catch (exc) { | ||
bn = new BigNumber(this.prefix_hex(n)); | ||
if (this.is_hex(n)) { | ||
bn = new BigNumber(this.prefix_hex(n)); | ||
} else { | ||
return console.error(exc); | ||
} | ||
} | ||
@@ -206,4 +211,3 @@ break; | ||
default: | ||
console.log("[augur-abi] Couldn't convert", n, "to BigNumber"); | ||
return; | ||
return console.error("Couldn't convert", n, "to BigNumber"); | ||
} | ||
@@ -210,0 +214,0 @@ if (bn !== undefined && bn !== null && bn.constructor === BigNumber) { |
{ | ||
"name": "augur-abi", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "Contract ABI serialization", | ||
@@ -11,5 +11,5 @@ "main": "index.js", | ||
"scripts": { | ||
"test": "mocha test/abi.js", | ||
"test": "mocha test/*.js", | ||
"lint": "jshint index.js && jshint test", | ||
"coverage": "istanbul cover -x **/lib/** ./node_modules/mocha/bin/_mocha test/abi.js" | ||
"coverage": "istanbul cover -x **/lib/** ./node_modules/mocha/bin/_mocha test/*.js" | ||
}, | ||
@@ -16,0 +16,0 @@ "repository": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
1015606
20484