aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfrankiebee <frankie.diamond@gmail.com>2017-07-13 06:07:56 +0800
committerfrankiebee <frankie.diamond@gmail.com>2017-07-13 06:07:56 +0800
commitbd26ec46aa8f2d144939573a8c427e2a7743d25c (patch)
tree056cc5e391894b7752cdcf38da857d9bca1635c3
parentda35f6744e3201bb75b896d3127d4f30d7e4d789 (diff)
downloadtangerine-wallet-browser-bd26ec46aa8f2d144939573a8c427e2a7743d25c.tar
tangerine-wallet-browser-bd26ec46aa8f2d144939573a8c427e2a7743d25c.tar.gz
tangerine-wallet-browser-bd26ec46aa8f2d144939573a8c427e2a7743d25c.tar.bz2
tangerine-wallet-browser-bd26ec46aa8f2d144939573a8c427e2a7743d25c.tar.lz
tangerine-wallet-browser-bd26ec46aa8f2d144939573a8c427e2a7743d25c.tar.xz
tangerine-wallet-browser-bd26ec46aa8f2d144939573a8c427e2a7743d25c.tar.zst
tangerine-wallet-browser-bd26ec46aa8f2d144939573a8c427e2a7743d25c.zip
mv updateAndApproveTx to txController
-rw-r--r--app/scripts/controllers/transactions.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/app/scripts/controllers/transactions.js b/app/scripts/controllers/transactions.js
index 45c6fb25a..a2842ae44 100644
--- a/app/scripts/controllers/transactions.js
+++ b/app/scripts/controllers/transactions.js
@@ -183,7 +183,7 @@ module.exports = class TransactionController extends EventEmitter {
}, {})
}
- async approveTransaction (txId, cb = warn) {
+ async approveTransaction (txId) {
let nonceLock
try {
// approve
@@ -199,7 +199,6 @@ module.exports = class TransactionController extends EventEmitter {
await this.publishTransaction(txId, rawTx)
// must set transaction to submitted/failed before releasing lock
nonceLock.releaseLock()
- cb()
} catch (err) {
this.setTxStatusFailed(txId, {
errCode: err.errCode || err,
@@ -208,7 +207,7 @@ module.exports = class TransactionController extends EventEmitter {
// must set transaction to submitted/failed before releasing lock
if (nonceLock) nonceLock.releaseLock()
// continue with error chain
- cb(err)
+ throw err
}
}
@@ -217,6 +216,11 @@ module.exports = class TransactionController extends EventEmitter {
cb()
}
+ async updateAndApproveTransaction (txMeta) {
+ this.updateTx(txMeta)
+ await this.approveTransaction(txMeta.id)
+ }
+
getChainId () {
const networkState = this.networkStore.getState()
const getChainId = parseInt(networkState)