1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 03:12:42 +02:00

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.
This commit is contained in:
Dan Finlay 2016-10-03 20:02:21 -07:00
parent a52c497ad1
commit da611eb3a1
2 changed files with 6 additions and 17 deletions

View File

@ -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

View File

@ -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 () {}