aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2017-03-29 02:46:33 +0800
committerDan Finlay <dan@danfinlay.com>2017-03-29 02:52:15 +0800
commit81d3658343bbdf8dd85b175f759c372d9ee00fb8 (patch)
treedf3973c062c7c16ce0c965860c6c630f821d7602 /app/scripts
parent903d3aeb7a3482f9de1d43d5634bdfec59715288 (diff)
downloadtangerine-wallet-browser-81d3658343bbdf8dd85b175f759c372d9ee00fb8.tar
tangerine-wallet-browser-81d3658343bbdf8dd85b175f759c372d9ee00fb8.tar.gz
tangerine-wallet-browser-81d3658343bbdf8dd85b175f759c372d9ee00fb8.tar.bz2
tangerine-wallet-browser-81d3658343bbdf8dd85b175f759c372d9ee00fb8.tar.lz
tangerine-wallet-browser-81d3658343bbdf8dd85b175f759c372d9ee00fb8.tar.xz
tangerine-wallet-browser-81d3658343bbdf8dd85b175f759c372d9ee00fb8.tar.zst
tangerine-wallet-browser-81d3658343bbdf8dd85b175f759c372d9ee00fb8.zip
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.
Diffstat (limited to 'app/scripts')
-rw-r--r--app/scripts/lib/hex-to-bn.js7
1 files changed, 7 insertions, 0 deletions
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)
+}
+