Comparing version 0.6.3 to 0.6.4
27
index.js
@@ -21,3 +21,3 @@ /** | ||
version: "0.6.3", | ||
version: "0.6.4", | ||
@@ -127,3 +127,8 @@ constants: { | ||
if (!Buffer.isBuffer(bytearray)) { | ||
bytearray = new Buffer(bytearray, "hex"); | ||
try { | ||
bytearray = new Buffer(bytearray, "hex"); | ||
} catch (ex) { | ||
console.log("[augur-abi] bytes_to_utf16:", JSON.stringify(bytearray, null, 2)); | ||
throw ex; | ||
} | ||
} | ||
@@ -196,10 +201,14 @@ return bytearray.toString("utf8"); | ||
var unforked = this.bignum(forked); | ||
var superforked = unforked.plus(this.constants.MOD); | ||
if (superforked.gte(this.constants.BYTES_32) && superforked.lt(this.constants.MOD)) { | ||
unforked = superforked; | ||
if (unforked.constructor === BigNumber) { | ||
var superforked = unforked.plus(this.constants.MOD); | ||
if (superforked.gte(this.constants.BYTES_32) && superforked.lt(this.constants.MOD)) { | ||
unforked = superforked; | ||
} | ||
if (forked.constructor === BigNumber) return unforked; | ||
unforked = this.pad_left(unforked.toString(16)); | ||
if (prefix) unforked = this.prefix_hex(unforked); | ||
return unforked; | ||
} else { | ||
throw new Error("abi.unfork failed (bad input): " + JSON.stringify(forked)); | ||
} | ||
if (forked.constructor === BigNumber) return unforked; | ||
unforked = this.pad_left(unforked.toString(16)); | ||
if (prefix) unforked = this.prefix_hex(unforked); | ||
return unforked; | ||
} else { | ||
@@ -206,0 +215,0 @@ throw new Error("abi.unfork failed (bad input): " + JSON.stringify(forked)); |
{ | ||
"name": "augur-abi", | ||
"version": "0.6.3", | ||
"version": "0.6.4", | ||
"description": "Contract ABI serialization", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
1041869
20711