aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/conf-tx.js
diff options
context:
space:
mode:
authorFrankie <frankie.diamond@gmail.com>2017-01-11 03:52:25 +0800
committerFrankie <frankie.diamond@gmail.com>2017-01-12 04:16:37 +0800
commit0fae263a9acb1f4023070b37ee1b91815e34de86 (patch)
tree06ce3969f56a2b6d2c5d4316dc6367b79540cb44 /ui/app/conf-tx.js
parentaf312bdc90139f99a9a08f9d0f67d63e005e2a20 (diff)
downloadtangerine-wallet-browser-0fae263a9acb1f4023070b37ee1b91815e34de86.tar
tangerine-wallet-browser-0fae263a9acb1f4023070b37ee1b91815e34de86.tar.gz
tangerine-wallet-browser-0fae263a9acb1f4023070b37ee1b91815e34de86.tar.bz2
tangerine-wallet-browser-0fae263a9acb1f4023070b37ee1b91815e34de86.tar.lz
tangerine-wallet-browser-0fae263a9acb1f4023070b37ee1b91815e34de86.tar.xz
tangerine-wallet-browser-0fae263a9acb1f4023070b37ee1b91815e34de86.tar.zst
tangerine-wallet-browser-0fae263a9acb1f4023070b37ee1b91815e34de86.zip
Take some of the tx Logic out of the UI and create a visble state for pending and unaproved transactions
Diffstat (limited to 'ui/app/conf-tx.js')
-rw-r--r--ui/app/conf-tx.js12
1 files changed, 2 insertions, 10 deletions
diff --git a/ui/app/conf-tx.js b/ui/app/conf-tx.js
index 5a645022a..79699965b 100644
--- a/ui/app/conf-tx.js
+++ b/ui/app/conf-tx.js
@@ -46,7 +46,6 @@ ConfirmTxScreen.prototype.render = function () {
var txData = unconfTxList[index] || unconfTxList[0] || {}
var txParams = txData.txParams || {}
var isNotification = isPopupOrNotification() === 'notification'
-
return (
h('.flex-column.flex-grow', [
@@ -125,17 +124,10 @@ function currentTxView (opts) {
}
ConfirmTxScreen.prototype.checkBalanceAgainstTx = function (txData) {
var state = this.props
-
- var txParams = txData.txParams || {}
- var address = txParams.from || state.selectedAccount
+ var address = txData.txParams.from || state.selectedAccount
var account = state.accounts[address]
var balance = account ? account.balance : '0x0'
-
- var gasCost = new BN(ethUtil.stripHexPrefix(txParams.gas || txData.estimatedGas), 16)
- var gasPrice = new BN(ethUtil.stripHexPrefix(txParams.gasPrice || '0x4a817c800'), 16)
- var txFee = gasCost.mul(gasPrice)
- var txValue = new BN(ethUtil.stripHexPrefix(txParams.value || '0x0'), 16)
- var maxCost = txValue.add(txFee)
+ var maxCost = new BN(txData.maxCost)
var balanceBn = new BN(ethUtil.stripHexPrefix(balance), 16)
return maxCost.gt(balanceBn)