Skip to content

Commit

Permalink
Merge pull request #2106 from trufflesuite/fix-mishandledBytes
Browse files Browse the repository at this point in the history
Fix overly strict function validation requirements for decoding parameters
  • Loading branch information
nivida committed Dec 8, 2018
2 parents 613a222 + 617fd0b commit 1d9f6c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/web3-eth-abi/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ ABICoder.prototype.decodeParameter = function (type, bytes) {
* @return {Array} array of plain params
*/
ABICoder.prototype.decodeParameters = function (outputs, bytes) {
if (!bytes || bytes === '0x' || bytes === '0X') {
if (outputs.length > 0 && (!bytes || bytes === '0x' || bytes === '0X')) {
throw new Error('Returned values aren\'t valid, did it run Out of Gas?');
}

Expand Down

0 comments on commit 1d9f6c0

Please sign in to comment.