1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Add background method for updating and approving a tx in one call

This commit is contained in:
Dan Finlay 2017-02-27 18:25:46 -08:00
parent 4370ca0cef
commit 1eb4a5d62c

View File

@ -278,6 +278,7 @@ module.exports = class MetamaskController extends EventEmitter {
// txManager
approveTransaction: txManager.approveTransaction.bind(txManager),
cancelTransaction: txManager.cancelTransaction.bind(txManager),
updateAndApproveTransaction: this.updateAndApproveTx.bind(this),
// messageManager
signMessage: nodeify(this.signMessage).bind(this),
@ -462,6 +463,12 @@ module.exports = class MetamaskController extends EventEmitter {
})
}
updateAndApproveTx(txMeta, cb) {
const txManager = this.txManager
txManager.updateTx(txMeta)
txManager.approveTransaction(txMeta.id, cb)
}
signMessage (msgParams, cb) {
log.info('MetaMaskController - signMessage')
const msgId = msgParams.metamaskId