aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts
diff options
context:
space:
mode:
authorFrankie <frankie.diamond@gmail.com>2017-01-14 08:53:10 +0800
committerFrankie <frankie.diamond@gmail.com>2017-01-14 08:53:10 +0800
commit212ef0b850d3bd07c24a7e2d662fe1952cf9a6dd (patch)
tree13a4c0c8bc84e382a43a687c2350e25dc71cfd37 /app/scripts
parentd06c54e0b7eb7803798e31d8d035b648e9da0421 (diff)
downloadtangerine-wallet-browser-212ef0b850d3bd07c24a7e2d662fe1952cf9a6dd.tar
tangerine-wallet-browser-212ef0b850d3bd07c24a7e2d662fe1952cf9a6dd.tar.gz
tangerine-wallet-browser-212ef0b850d3bd07c24a7e2d662fe1952cf9a6dd.tar.bz2
tangerine-wallet-browser-212ef0b850d3bd07c24a7e2d662fe1952cf9a6dd.tar.lz
tangerine-wallet-browser-212ef0b850d3bd07c24a7e2d662fe1952cf9a6dd.tar.xz
tangerine-wallet-browser-212ef0b850d3bd07c24a7e2d662fe1952cf9a6dd.tar.zst
tangerine-wallet-browser-212ef0b850d3bd07c24a7e2d662fe1952cf9a6dd.zip
fix the maxcost not being included in txMeta
Diffstat (limited to 'app/scripts')
-rw-r--r--app/scripts/transaction-manager.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/app/scripts/transaction-manager.js b/app/scripts/transaction-manager.js
index 034cf3aeb..5e0544755 100644
--- a/app/scripts/transaction-manager.js
+++ b/app/scripts/transaction-manager.js
@@ -117,12 +117,14 @@ module.exports = class TransactionManager extends EventEmitter {
// save txMeta
(cb) => {
this.addTx(txMeta)
+ debugger
+ this.setMaxTxCostAndFee(txMeta)
cb(null, txMeta)
},
], done)
}
- getMaxTxCostAndFee (txMeta) {
+ setMaxTxCostAndFee (txMeta) {
var txParams = txMeta.txParams
var gasMultiplier = txMeta.gasMultiplier
@@ -132,7 +134,9 @@ module.exports = class TransactionManager extends EventEmitter {
var txFee = gasCost.mul(gasPrice)
var txValue = new BN(ethUtil.stripHexPrefix(txParams.value || '0x0'), 16)
var maxCost = txValue.add(txFee)
- return {maxCost, txFee}
+ txMeta.txValue = txValue
+ txMeta.maxCost = maxCost
+ this.updateTx(txMeta)
}
getUnapprovedTxList () {
@@ -263,7 +267,7 @@ module.exports = class TransactionManager extends EventEmitter {
setTxStatusRejected (txId) {
this._setTxStatus(txId, 'rejected')
}
-
+
// should update the status of the tx to 'approved'.
setTxStatusApproved (txId) {
this._setTxStatus(txId, 'approved')