mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Specify base 10 in bignumber
This commit is contained in:
parent
b200f74d5f
commit
67eba9f542
@ -28,7 +28,7 @@ function IdManagement (opts) {
|
||||
// calculate gas with custom gas multiplier
|
||||
var gasMultiplier = this.configManager.getGasMultiplier() || 1
|
||||
var gasPrice = new BN(ethUtil.stripHexPrefix(txParams.gasPrice), 16)
|
||||
gasPrice = gasPrice.mul(new BN(gasMultiplier * 100)).div(new BN(100, 10))
|
||||
gasPrice = gasPrice.mul(new BN(gasMultiplier * 100, 10)).div(new BN(100, 10))
|
||||
txParams.gasPrice = ethUtil.intToHex(gasPrice.toNumber())
|
||||
// normalize values
|
||||
|
||||
|
@ -32,7 +32,7 @@ PTXP.render = function () {
|
||||
var gasMultiplier = txData.gasMultiplier
|
||||
var gasCost = new BN(ethUtil.stripHexPrefix(txParams.gas || txData.estimatedGas), 16)
|
||||
var gasPrice = new BN(ethUtil.stripHexPrefix(txParams.gasPrice || '0x4a817c800'), 16)
|
||||
gasPrice = gasPrice.mul(new BN(gasMultiplier * 100)).div(new BN(100, 10))
|
||||
gasPrice = gasPrice.mul(new BN(gasMultiplier * 100), 10).div(new BN(100, 10))
|
||||
var txFee = gasCost.mul(gasPrice)
|
||||
var txValue = new BN(ethUtil.stripHexPrefix(txParams.value || '0x0'), 16)
|
||||
var maxCost = txValue.add(txFee)
|
||||
|
Loading…
Reference in New Issue
Block a user