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:
parent
971d25a8ab
commit
231ad48564
@ -118,11 +118,11 @@ module.exports = class txProviderUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sufficientBalance (tx, hexBalance) {
|
sufficientBalance (txParams, hexBalance) {
|
||||||
const balance = hexToBn(hexBalance)
|
const balance = hexToBn(hexBalance)
|
||||||
const value = hexToBn(tx.value)
|
const value = hexToBn(txParams.value)
|
||||||
const gasLimit = hexToBn(tx.gas)
|
const gasLimit = hexToBn(txParams.gas)
|
||||||
const gasPrice = hexToBn(tx.gasPrice)
|
const gasPrice = hexToBn(txParams.gasPrice)
|
||||||
|
|
||||||
const maxCost = value.add(gasLimit.mul(gasPrice))
|
const maxCost = value.add(gasLimit.mul(gasPrice))
|
||||||
return balance.gte(maxCost)
|
return balance.gte(maxCost)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user