diff options
author | Dan Finlay <dan@danfinlay.com> | 2017-12-08 05:05:17 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2017-12-08 05:05:17 +0800 |
commit | 89e640afcbd50307fcdae13f961f4b3cf6164b5b (patch) | |
tree | 44d553c3f4865cb23d11a654700a3967edce165b /app | |
parent | 553d713636d317b74d819d62b5b931bdf2d112d8 (diff) | |
parent | 35be563fbdc74974f54b3e90b2eba319b0619754 (diff) | |
download | tangerine-wallet-browser-89e640afcbd50307fcdae13f961f4b3cf6164b5b.tar tangerine-wallet-browser-89e640afcbd50307fcdae13f961f4b3cf6164b5b.tar.gz tangerine-wallet-browser-89e640afcbd50307fcdae13f961f4b3cf6164b5b.tar.bz2 tangerine-wallet-browser-89e640afcbd50307fcdae13f961f4b3cf6164b5b.tar.lz tangerine-wallet-browser-89e640afcbd50307fcdae13f961f4b3cf6164b5b.tar.xz tangerine-wallet-browser-89e640afcbd50307fcdae13f961f4b3cf6164b5b.tar.zst tangerine-wallet-browser-89e640afcbd50307fcdae13f961f4b3cf6164b5b.zip |
Merge branch 'master' into patch-2
Diffstat (limited to 'app')
-rw-r--r-- | app/manifest.json | 2 | ||||
-rw-r--r-- | app/scripts/controllers/transactions.js | 7 | ||||
-rw-r--r-- | app/scripts/lib/tx-state-manager.js | 4 | ||||
-rw-r--r-- | app/scripts/metamask-controller.js | 9 |
4 files changed, 21 insertions, 1 deletions
diff --git a/app/manifest.json b/app/manifest.json index 4219f3298..aa23f85ff 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -1,7 +1,7 @@ { "name": "MetaMask", "short_name": "Metamask", - "version": "3.12.1", + "version": "3.13.0", "manifest_version": 2, "author": "https://metamask.io", "description": "Ethereum Browser Extension", diff --git a/app/scripts/controllers/transactions.js b/app/scripts/controllers/transactions.js index 6bdbd2cfc..bb408d445 100644 --- a/app/scripts/controllers/transactions.js +++ b/app/scripts/controllers/transactions.js @@ -185,6 +185,13 @@ module.exports = class TransactionController extends EventEmitter { return await this.txGasUtil.analyzeGasUsage(txMeta) } + async retryTransaction (txId) { + this.txStateManager.setTxStatusUnapproved(txId) + const txMeta = this.txStateManager.getTx(txId) + txMeta.lastGasPrice = txMeta.txParams.gasPrice + this.txStateManager.updateTx(txMeta, 'retryTransaction: manual retry') + } + 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..9d126b416 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(this.retryTransaction, this), // messageManager signMessage: nodeify(this.signMessage, this), @@ -573,6 +574,14 @@ module.exports = class MetamaskController extends EventEmitter { // // Identity Management // + // + + async retryTransaction (txId, cb) { + await this.txController.retryTransaction(txId) + const state = await this.getState() + return state + } + newUnsignedMessage (msgParams, cb) { const msgId = this.messageManager.addUnapprovedMessage(msgParams) |