refactor: remove unnecessary level of depth from runInNode

pull/3094/head
Iuri Matias 7 years ago
parent 280a87bf76
commit 38f4ba1a52
  1. 39
      src/app/execution/txRunner.js

@ -163,27 +163,26 @@ TxRunner.prototype.runInNode = function (from, to, data, value, gasLimit, useCal
console.log(err) console.log(err)
return return
} }
if (network.name === 'Main') { if (network.name !== 'Main') {
var content = confirmDialog(tx, gasEstimation, self) return executeTx(tx, null, self._api, callback)
modalDialog('Confirm transaction', content,
{ label: 'Confirm',
fn: () => {
self._api.config.setUnpersistedProperty('doNotShowTransactionConfirmationAgain', content.querySelector('input#confirmsetting').checked)
if (!content.gasPriceStatus) {
callback('Given gas grice is not correct')
} else {
var gasPrice = executionContext.web3().toWei(content.querySelector('#gasprice').value, 'gwei')
executeTx(tx, gasPrice, self._api, callback)
}
}}, {
label: 'Cancel',
fn: () => {
return callback('Transaction canceled by user.')
}
})
} else {
executeTx(tx, null, self._api, callback)
} }
var content = confirmDialog(tx, gasEstimation, self)
modalDialog('Confirm transaction', content,
{ label: 'Confirm',
fn: () => {
self._api.config.setUnpersistedProperty('doNotShowTransactionConfirmationAgain', content.querySelector('input#confirmsetting').checked)
if (!content.gasPriceStatus) {
callback('Given gas grice is not correct')
} else {
var gasPrice = executionContext.web3().toWei(content.querySelector('#gasprice').value, 'gwei')
executeTx(tx, gasPrice, self._api, callback)
}
}}, {
label: 'Cancel',
fn: () => {
return callback('Transaction canceled by user.')
}
})
}) })
}) })
} }

Loading…
Cancel
Save