mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01: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:
parent
a52c497ad1
commit
da611eb3a1
@ -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
|
||||
|
||||
|
@ -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 () {}
|
||||
|
Loading…
Reference in New Issue
Block a user