From da611eb3a12a40aba09517c7c8121f9684111e0a Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Mon, 3 Oct 2016 20:02:21 -0700 Subject: [PATCH] Improve popup behavior for parity errors When we receive an invalid params error, instead of opening the popup and showing no tx, we now just forward that tx back to the UI code. --- CHANGELOG.md | 1 + app/scripts/metamask-controller.js | 22 +++++----------------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 84a074480..b6d3d5ed4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Current Master - Fix bug where chosen FIAT exchange rate does no persist when switching networks +- Fix additional parameters that made MetaMask sometimes receive errors from Parity. ## 2.13.1 2016-09-23 diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 9e1a885ae..03082013a 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -203,26 +203,15 @@ module.exports = class MetamaskController { newUnsignedTransaction (txParams, onTxDoneCb) { const idStore = this.idStore - var state = idStore.getState() let err = this.enforceTxValidations(txParams) if (err) return onTxDoneCb(err) - // It's locked - if (!state.isUnlocked) { - - // Allow the environment to define an unlock message. - this.opts.unlockAccountMessage() - idStore.addUnconfirmedTransaction(txParams, onTxDoneCb, noop) - - // It's unlocked - } else { - idStore.addUnconfirmedTransaction(txParams, onTxDoneCb, (err, txData) => { - if (err) return onTxDoneCb(err) - this.sendUpdate() - this.opts.showUnconfirmedTx(txParams, txData, onTxDoneCb) - }) - } + idStore.addUnconfirmedTransaction(txParams, onTxDoneCb, (err, txData) => { + if (err) return onTxDoneCb(err) + this.sendUpdate() + this.opts.showUnconfirmedTx(txParams, txData, onTxDoneCb) + }) } enforceTxValidations (txParams) { @@ -353,4 +342,3 @@ module.exports = class MetamaskController { } } -function noop () {}