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:
parent
da35f6744e
commit
bd26ec46aa
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user