1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-23 03:36:18 +02:00
metamask-extension/app/scripts/lib/hex-to-bn.js
Dan Finlay 81d3658343 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.
2017-03-28 11:52:15 -07:00

8 lines
160 B
JavaScript

const ethUtil = require('ethereumjs-util')
const BN = ethUtil.BN
module.exports = function hexToBn (hex) {
return new BN(ethUtil.stripHexPrefix(hex), 16)
}