diff options
author | Dan Finlay <dan@danfinlay.com> | 2017-12-07 11:20:11 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2017-12-07 11:20:58 +0800 |
commit | 6ff580584a74c6d85f54ce7cfc500db822904957 (patch) | |
tree | 9352690d0f68bb33ab0bb409a97c29905bf20150 /app | |
parent | a78cc013d199547ba865a0d1c2fec9a328ce7e0b (diff) | |
download | tangerine-wallet-browser-6ff580584a74c6d85f54ce7cfc500db822904957.tar tangerine-wallet-browser-6ff580584a74c6d85f54ce7cfc500db822904957.tar.gz tangerine-wallet-browser-6ff580584a74c6d85f54ce7cfc500db822904957.tar.bz2 tangerine-wallet-browser-6ff580584a74c6d85f54ce7cfc500db822904957.tar.lz tangerine-wallet-browser-6ff580584a74c6d85f54ce7cfc500db822904957.tar.xz tangerine-wallet-browser-6ff580584a74c6d85f54ce7cfc500db822904957.tar.zst tangerine-wallet-browser-6ff580584a74c6d85f54ce7cfc500db822904957.zip |
Add retry background method and action
Diffstat (limited to 'app')
-rw-r--r-- | app/scripts/controllers/transactions.js | 4 | ||||
-rw-r--r-- | app/scripts/lib/tx-state-manager.js | 4 | ||||
-rw-r--r-- | app/scripts/metamask-controller.js | 1 |
3 files changed, 9 insertions, 0 deletions
diff --git a/app/scripts/controllers/transactions.js b/app/scripts/controllers/transactions.js index ce709bd28..67043b401 100644 --- a/app/scripts/controllers/transactions.js +++ b/app/scripts/controllers/transactions.js @@ -184,6 +184,10 @@ module.exports = class TransactionController extends EventEmitter { return await this.txGasUtil.analyzeGasUsage(txMeta) } + async retryTransaction (txId) { + return this.txStateManager.setTxStatusUnapproved(txId) + } + async updateAndApproveTransaction (txMeta) { this.txStateManager.updateTx(txMeta, 'confTx: user approved transaction') await this.approveTransaction(txMeta.id) diff --git a/app/scripts/lib/tx-state-manager.js b/app/scripts/lib/tx-state-manager.js index 0fd6bed4b..cc441c584 100644 --- a/app/scripts/lib/tx-state-manager.js +++ b/app/scripts/lib/tx-state-manager.js @@ -187,6 +187,10 @@ module.exports = class TransactionStateManger extends EventEmitter { this._setTxStatus(txId, 'rejected') } + // should update the status of the tx to 'unapproved'. + setTxStatusUnapproved (txId) { + this._setTxStatus(txId, 'unapproved') + } // should update the status of the tx to 'approved'. setTxStatusApproved (txId) { this._setTxStatus(txId, 'approved') diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 130ad1471..3a8100d12 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -363,6 +363,7 @@ module.exports = class MetamaskController extends EventEmitter { // txController cancelTransaction: nodeify(txController.cancelTransaction, txController), updateAndApproveTransaction: nodeify(txController.updateAndApproveTransaction, txController), + retryTransaction: nodeify(txController.retryTransaction, txController), // messageManager signMessage: nodeify(this.signMessage, this), |