|
|
@ -414,14 +414,14 @@ module.exports = class MetamaskController extends EventEmitter { |
|
|
|
self.sendUpdate() |
|
|
|
self.sendUpdate() |
|
|
|
self.opts.showUnapprovedTx(txMeta) |
|
|
|
self.opts.showUnapprovedTx(txMeta) |
|
|
|
// listen for tx completion (success, fail)
|
|
|
|
// listen for tx completion (success, fail)
|
|
|
|
self.txManager.once(`${txMeta.id}:finished`, (status) => { |
|
|
|
self.txManager.once(`${txMeta.id}:finished`, (completedTx) => { |
|
|
|
switch (status) { |
|
|
|
switch (completedTx.status) { |
|
|
|
case 'submitted': |
|
|
|
case 'submitted': |
|
|
|
return cb(null, txMeta.hash) |
|
|
|
return cb(null, completedTx.hash) |
|
|
|
case 'rejected': |
|
|
|
case 'rejected': |
|
|
|
return cb(new Error('MetaMask Tx Signature: User denied transaction signature.')) |
|
|
|
return cb(new Error('MetaMask Tx Signature: User denied transaction signature.')) |
|
|
|
default: |
|
|
|
default: |
|
|
|
return cb(new Error(`MetaMask Tx Signature: Unknown problem: ${JSON.stringify(txMeta.txParams)}`)) |
|
|
|
return cb(new Error(`MetaMask Tx Signature: Unknown problem: ${JSON.stringify(completedTx.txParams)}`)) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|