diff --git a/lib/solidity/coder.js b/lib/solidity/coder.js index 05a07c5..acb2e05 100644 --- a/lib/solidity/coder.js +++ b/lib/solidity/coder.js @@ -244,18 +244,20 @@ SolidityCoder.prototype.encodeParams = function (types, params) { return acc + f.formatInputInt(totalOffset + offsets[index]).encode(); } else if (solidityType.isStaticArray(types[index])) { var offset = acc.length / 2; - return acc + encodeds[index].join(''); + //return acc + encodeds[index].join(''); + return acc + self.encodeWithOffset(types[index], solidityType, encodeds[index], offset); } return acc + encodeds[index]; }, ""); console.log(result); var self = this; - result = solidityTypes.filter(function (solidityType, index) { - return solidityType.isDynamicArray(types[index]); - }).reduce(function (acc, solidityType, index) { - var offset = acc.length / 2; - return acc + self.encodeWithOffset(types[index], solidityType, encodeds[index], offset); + result = solidityTypes.reduce(function (acc, solidityType, index) { + if (solidityType.isDynamicArray(types[index])) { + var offset = acc.length / 2; + return acc + self.encodeWithOffset(types[index], solidityType, encodeds[index], offset); + } + return acc; }, result); console.log(result);