remove unnecessary try statments

feature/default_network_editable
Frankie 8 years ago
parent 4b17222a59
commit cf6817092b
  1. 8
      app/scripts/keyring-controller.js
  2. 1
      app/scripts/metamask-controller.js
  3. 8
      app/scripts/transaction-manager.js

@ -318,18 +318,12 @@ module.exports = class KeyringController extends EventEmitter {
// TX Manager to update the state after signing
signTransaction (ethTx, selectedAddress, txId) {
return new Promise((resolve, reject) => {
try {
const address = normalize(selectedAddress)
return this.getKeyringForAccount(address)
.then((keyring) => {
return keyring.signTransaction(address, ethTx)
}).then((tx) => {
resolve({tx, txId})
})
} catch (e) {
reject(e)
}
return {tx, txId}
})
}
// Add Unconfirmed Message

@ -165,7 +165,6 @@ module.exports = class MetamaskController {
sendUpdate () {
this.getState()
.then((state) => {
this.listeners.forEach((remote) => {
remote.sendUpdate(state)
})

@ -138,8 +138,6 @@ module.exports = class TransactionManager extends EventEmitter {
// formats txParams so the keyringController can sign it
formatTxForSigining (txParams) {
return new Promise((resolve, reject) => {
try {
var address = txParams.from
var metaTx = this.getTx(txParams.metamaskId)
var gasMultiplier = metaTx.gasMultiplier
@ -156,11 +154,7 @@ module.exports = class TransactionManager extends EventEmitter {
txParams.nonce = normalize(txParams.nonce)
const ethTx = new Transaction(txParams)
var txId = txParams.metamaskId
resolve({ethTx, address, txId})
} catch (err) {
reject(err)
}
})
return Promise.resolve({ethTx, address, txId})
}
// receives a signed tx object and updates the tx hash

Loading…
Cancel
Save