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

mv updateAndApproveTx to txController

This commit is contained in:
frankiebee 2017-07-12 15:07:56 -07:00
parent da35f6744e
commit bd26ec46aa

View File

@ -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)