ethereumjs-abi
Advanced tools
Comparing version 0.6.5 to 0.6.6
@@ -8,2 +8,15 @@ # Changelog | ||
## [0.6.6] - 2019-01-16 | ||
- Include size of fixed-size array in offset for dynamic type, | ||
PR [#60](https://github.com/ethereumjs/ethereumjs-abi/pull/60) | ||
- Replaced problematic for..in loops with C-style loops, | ||
PR [#68](https://github.com/ethereumjs/ethereumjs-abi/pull/68) | ||
- Updated `ethereumjs-util` dependency to `v5.0.0`, | ||
PR [#59](https://github.com/ethereumjs/ethereumjs-abi/pull/59) | ||
- Run CI tests on currently supported Node versions, | ||
PR [#61](https://github.com/ethereumjs/ethereumjs-abi/pull/61) | ||
[0.6.6]: https://github.com/ethereumjs/ethereumjs-abi/compare/v0.6.5...v0.6.6 | ||
## [0.6.5] - 2017-12-07 | ||
@@ -10,0 +23,0 @@ - Fix tight packing for ``ABI.soliditySHA3`` |
@@ -340,5 +340,19 @@ const utils = require('ethereumjs-util') | ||
var headLength = 32 * types.length | ||
var headLength = 0 | ||
for (var i in types) { | ||
types.forEach(function (type) { | ||
if (isArray(type)) { | ||
var size = parseTypeArray(type) | ||
if (size !== 'dynamic') { | ||
headLength += 32 * size | ||
} else { | ||
headLength += 32 | ||
} | ||
} else { | ||
headLength += 32 | ||
} | ||
}) | ||
for (var i = 0; i < types.length; i++) { | ||
var type = elementaryName(types[i]) | ||
@@ -365,3 +379,3 @@ var value = values[i] | ||
var offset = 0 | ||
for (var i in types) { | ||
for (var i = 0; i < types.length; i++) { | ||
var type = elementaryName(types[i]) | ||
@@ -368,0 +382,0 @@ var parsed = parseType(type, data, offset) |
{ | ||
"name": "ethereumjs-abi", | ||
"version": "0.6.5", | ||
"version": "0.6.6", | ||
"description": "Decoder and encoder for the Ethereum ABI", | ||
@@ -8,3 +8,3 @@ "main": "index.js", | ||
"bn.js": "^4.10.0", | ||
"ethereumjs-util": "^4.3.0" | ||
"ethereumjs-util": "^5.0.0" | ||
}, | ||
@@ -11,0 +11,0 @@ "devDependencies": { |
@@ -121,5 +121,5 @@ # ethereumjs-abi | ||
```js | ||
var encoded = abi.rawEncode("balanceOf", abi.fromSerpent("i"), [ "0x0000000000000000000000000000000000000000" ]) | ||
var encoded = abi.rawEncode(abi.fromSerpent("i"), [ "0x0000000000000000000000000000000000000000" ]) | ||
var decoded = abi.rawDecode("balanceOf", abi.fromSerpent("i"), abi.fromSerpent("i"), data) | ||
var decoded = abi.rawDecode([...abi.fromSerpent("i"), ...abi.fromSerpent("i")], data) | ||
``` | ||
@@ -126,0 +126,0 @@ |
@@ -129,2 +129,7 @@ var assert = require('assert') | ||
}) | ||
it('should work for string and uint256[2]', function () { | ||
var a = abi.rawEncode([ 'string', 'uint256[2]' ], [ 'foo', [5, 6] ]).toString('hex') | ||
var b = '0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000003666f6f0000000000000000000000000000000000000000000000000000000000' | ||
assert.equal(a, b) | ||
}) | ||
}) | ||
@@ -131,0 +136,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
61600
1214
8
1
+ Addedethereumjs-util@5.2.1(transitive)
+ Addedethjs-util@0.1.6(transitive)
+ Addedis-hex-prefixed@1.0.0(transitive)
+ Addedstrip-hex-prefix@1.0.0(transitive)
- Removedethereumjs-util@4.5.1(transitive)
Updatedethereumjs-util@^5.0.0