Comparing version 0.3.3 to 0.3.4
32
index.js
@@ -100,18 +100,21 @@ /** | ||
for (var i = 0; i < bytearray.length; ++i) { | ||
tmp += bytearray[i].slice(2); | ||
if (bytearray[i] !== undefined && bytearray[i] !== null) { | ||
if (bytearray[i].constructor === String) { | ||
tmp += this.strip_0x(bytearray[i]); | ||
} else if (bytearray[i].constructor === Number) { | ||
tmp += bytearray[i].toString(16); | ||
} else if (Buffer.isBuffer(bytearray[i])) { | ||
tmp += bytearray[i].toString("hex"); | ||
} | ||
} | ||
} | ||
bytearray = tmp; | ||
} else if (Buffer.isBuffer(bytearray)) { | ||
bytearray = bytearray.toString("hex"); | ||
} | ||
bytearray = this.strip_0x(bytearray); | ||
return this.remove_trailing_zeros( | ||
this.abi.rawDecode( | ||
["string"], | ||
new Buffer( | ||
"0000000000000000000000000000000000000000000000000000000000000020"+ | ||
this.pad_left((this.chunk(bytearray.length)*32).toString(16))+ | ||
this.pad_right(bytearray), | ||
"hex") | ||
)[0], true); | ||
if (bytearray.constructor === String) { | ||
bytearray = this.strip_0x(bytearray); | ||
} | ||
if (!Buffer.isBuffer(bytearray)) { | ||
bytearray = new Buffer(bytearray, "hex"); | ||
} | ||
return bytearray.toString("utf8"); | ||
}, | ||
@@ -122,7 +125,6 @@ | ||
return this.prefix_hex(this.pad_right(new Buffer(s, "utf8").toString("hex"))); | ||
// return this.prefix_hex(ethabi.rawEncode(["string"], [s]).slice(64).toString("hex")); | ||
}, | ||
int256_to_short_string: function (n) { | ||
return this.bytes_to_utf16(this.remove_trailing_zeros(n)); | ||
return new Buffer(this.strip_0x(this.remove_trailing_zeros(n)), "hex").toString("utf8"); | ||
}, | ||
@@ -129,0 +131,0 @@ |
{ | ||
"name": "augur-abi", | ||
"version": "0.3.3", | ||
"version": "0.3.4", | ||
"description": "Contract ABI serialization", | ||
@@ -27,3 +27,3 @@ "main": "index.js", | ||
"bignumber.js": "^2.0.7", | ||
"ethereumjs-abi": "tinybike/ethereumjs-abi", | ||
"ethereumjs-abi": "ethereumjs/ethereumjs-abi", | ||
"js-sha3": "^0.3.1" | ||
@@ -30,0 +30,0 @@ }, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
GitHub dependency
Supply chain riskContains a dependency which resolves to a GitHub URL. Dependencies fetched from GitHub specifiers are not immutable can be used to inject untrusted code or reduce the likelihood of a reproducible install.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
GitHub dependency
Supply chain riskContains a dependency which resolves to a GitHub URL. Dependencies fetched from GitHub specifiers are not immutable can be used to inject untrusted code or reduce the likelihood of a reproducible install.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
1531566
31152
24
4