diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js index 9846c84f0..9d0ca7f19 100644 --- a/app/scripts/lib/idStore.js +++ b/app/scripts/lib/idStore.js @@ -286,7 +286,7 @@ IdentityStore.prototype.addGasBuffer = function (gasHex) { var gas = new BN(gasHex, 16) var buffer = new BN('100000', 10) var result = gas.add(buffer) - return result.toString(16) + return ethUtil.addHexPrefix(result.toString(16)) } // comes from metamask ui diff --git a/test/unit/idStore-test.js b/test/unit/idStore-test.js index 7f6324645..0a57d2121 100644 --- a/test/unit/idStore-test.js +++ b/test/unit/idStore-test.js @@ -154,5 +154,6 @@ describe('IdentityStore', function() { const bnResult = new BN(result, 16) assert.ok(bnResult.gt(gas), 'added more gas as buffer.') + assert.equal(result.indexOf('0x'), 0, 'include hex prefix') }) })