From 9ead6b99134c7d725149425ed267d588eb178c8e Mon Sep 17 00:00:00 2001 From: Jose Hugo De la cruz Romero Date: Wed, 22 Nov 2017 07:16:00 -0600 Subject: [PATCH 1/2] checks returnFee, if its greater than gasLimit set it as gasLimit + 1, this avoids BN assertion failure when returnFee is bigger than 0x4000000 --- lib/runCall.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/runCall.js b/lib/runCall.js index 13763e10b9..aa27a56e9d 100644 --- a/lib/runCall.js +++ b/lib/runCall.js @@ -160,6 +160,12 @@ module.exports = function (opts, cb) { var totalGas = results.gasUsed if (!results.runState.vmError) { var returnFee = results.return.length * fees.createDataGas.v + + // avoid BN assertion failure when returnFee is greater than 0x4000000 + if (returnFee > gasLimit.toNumber()) { + returnFee = gasLimit.toNumber() + 1 + } + totalGas = totalGas.addn(returnFee) } // if not enough gas From 919b5d0c6e29bff3300bc096bae8dfa9ec5a8a28 Mon Sep 17 00:00:00 2001 From: Jose Hugo De la cruz Romero Date: Fri, 24 Nov 2017 19:34:22 -0600 Subject: [PATCH 2/2] remove test randomStatetest643 from skipped tests --- tests/tester.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/tester.js b/tests/tester.js index e243a66250..fe954ccd73 100644 --- a/tests/tester.js +++ b/tests/tester.js @@ -12,8 +12,7 @@ const skipBroken = [ 'TransactionCollisionToEmptyButCode', // temporary till fixed (2017-09-21) 'TransactionCollisionToEmptyButNonce', // temporary till fixed (2017-09-21) 'RevertDepthCreateAddressCollision', // test case is wrong - 'randomStatetest642', // BROKEN, rustbn.js error - 'randomStatetest643' // BROKEN, breaks tests run (leave at the end), rustbn.js error + 'randomStatetest642' // BROKEN, rustbn.js error ] // tests skipped due to system specifics / design considerations const skipPermanent = [