From 81d3658343bbdf8dd85b175f759c372d9ee00fb8 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Tue, 28 Mar 2017 11:46:33 -0700 Subject: Improve UI gas calculation logic - Now striping hex prefixed gas values, which may have been causing mis-estimation. - Unified calculation logic to be entirely functional. - Greatly simplified how the pending-tx form keeps updated form state. Still needs a commit from @kumavis to ensure the background passes in a txMeta.txParams.gasPrice value. --- app/scripts/lib/hex-to-bn.js | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 app/scripts/lib/hex-to-bn.js (limited to 'app/scripts') diff --git a/app/scripts/lib/hex-to-bn.js b/app/scripts/lib/hex-to-bn.js new file mode 100644 index 000000000..184217279 --- /dev/null +++ b/app/scripts/lib/hex-to-bn.js @@ -0,0 +1,7 @@ +const ethUtil = require('ethereumjs-util') +const BN = ethUtil.BN + +module.exports = function hexToBn (hex) { + return new BN(ethUtil.stripHexPrefix(hex), 16) +} + -- cgit v1.2.3