aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2017-12-08 05:05:17 +0800
committerDan Finlay <dan@danfinlay.com>2017-12-08 05:05:17 +0800
commit89e640afcbd50307fcdae13f961f4b3cf6164b5b (patch)
tree44d553c3f4865cb23d11a654700a3967edce165b /app/scripts
parent553d713636d317b74d819d62b5b931bdf2d112d8 (diff)
parent35be563fbdc74974f54b3e90b2eba319b0619754 (diff)
downloadtangerine-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/scripts')
-rw-r--r--app/scripts/controllers/transactions.js7
-rw-r--r--app/scripts/lib/tx-state-manager.js4
-rw-r--r--app/scripts/metamask-controller.js9
3 files changed, 20 insertions, 0 deletions
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)