diff options
Merge pull request #1154 from MetaMask/i765-gaslimits
Add ability to customize gas and gasPrice on tx confirmation screen
Diffstat (limited to 'app/scripts/metamask-controller.js')
-rw-r--r-- | app/scripts/metamask-controller.js | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index f172c67a8..bd01a260d 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -248,7 +248,6 @@ module.exports = class MetamaskController extends EventEmitter { setProviderType: this.setProviderType.bind(this), useEtherscanProvider: this.useEtherscanProvider.bind(this), setCurrentCurrency: this.setCurrentCurrency.bind(this), - setGasMultiplier: this.setGasMultiplier.bind(this), markAccountsFound: this.markAccountsFound.bind(this), // coinbase buyEth: this.buyEth.bind(this), @@ -276,8 +275,9 @@ module.exports = class MetamaskController extends EventEmitter { exportAccount: nodeify(keyringController.exportAccount).bind(keyringController), // txManager - approveTransaction: txManager.approveTransaction.bind(txManager), - cancelTransaction: txManager.cancelTransaction.bind(txManager), + approveTransaction: txManager.approveTransaction.bind(txManager), + cancelTransaction: txManager.cancelTransaction.bind(txManager), + updateAndApproveTransaction: this.updateAndApproveTx.bind(this), // messageManager signMessage: nodeify(this.signMessage).bind(this), @@ -407,6 +407,7 @@ module.exports = class MetamaskController extends EventEmitter { // newUnapprovedTransaction (txParams, cb) { + log.debug(`MetaMaskController newUnapprovedTransaction ${JSON.stringify(txParams)}`) const self = this self.txManager.addUnapprovedTransaction(txParams, (err, txMeta) => { if (err) return cb(err) @@ -462,6 +463,13 @@ module.exports = class MetamaskController extends EventEmitter { }) } + updateAndApproveTx(txMeta, cb) { + log.debug(`MetaMaskController - updateAndApproveTx: ${JSON.stringify(txMeta)}`) + const txManager = this.txManager + txManager.updateTx(txMeta) + txManager.approveTransaction(txMeta.id, cb) + } + signMessage (msgParams, cb) { log.info('MetaMaskController - signMessage') const msgId = msgParams.metamaskId @@ -644,15 +652,6 @@ module.exports = class MetamaskController extends EventEmitter { this.shapeshiftController.createShapeShiftTx(depositAddress, depositType) } - setGasMultiplier (gasMultiplier, cb) { - try { - this.txManager.setGasMultiplier(gasMultiplier) - cb() - } catch (err) { - cb(err) - } - } - // // network // |