1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Use txParams

This commit is contained in:
frankiebee 2017-07-11 12:52:56 -07:00
parent 971d25a8ab
commit 231ad48564

View File

@ -118,11 +118,11 @@ module.exports = class txProviderUtils {
}
}
sufficientBalance (tx, hexBalance) {
sufficientBalance (txParams, hexBalance) {
const balance = hexToBn(hexBalance)
const value = hexToBn(tx.value)
const gasLimit = hexToBn(tx.gas)
const gasPrice = hexToBn(tx.gasPrice)
const value = hexToBn(txParams.value)
const gasLimit = hexToBn(txParams.gas)
const gasPrice = hexToBn(txParams.gasPrice)
const maxCost = value.add(gasLimit.mul(gasPrice))
return balance.gte(maxCost)