|
|
@ -26,7 +26,6 @@ PTXP.render = function () { |
|
|
|
var props = this.props |
|
|
|
var props = this.props |
|
|
|
var state = this.state || {} |
|
|
|
var state = this.state || {} |
|
|
|
var txData = state.txMeta || props.txData |
|
|
|
var txData = state.txMeta || props.txData |
|
|
|
var state = this.state || {} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var txParams = txData.txParams || {} |
|
|
|
var txParams = txData.txParams || {} |
|
|
|
var address = txParams.from || props.selectedAddress |
|
|
|
var address = txParams.from || props.selectedAddress |
|
|
@ -155,7 +154,7 @@ PTXP.render = function () { |
|
|
|
this.setState({ gas: newHex }) |
|
|
|
this.setState({ gas: newHex }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
}), |
|
|
|
}), |
|
|
|
]) |
|
|
|
]), |
|
|
|
]), |
|
|
|
]), |
|
|
|
h('.cell.row', { |
|
|
|
h('.cell.row', { |
|
|
|
|
|
|
|
|
|
|
@ -170,7 +169,7 @@ PTXP.render = function () { |
|
|
|
this.setState({ gasPrice: newHex }) |
|
|
|
this.setState({ gasPrice: newHex }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
}), |
|
|
|
}), |
|
|
|
]) |
|
|
|
]), |
|
|
|
]), |
|
|
|
]), |
|
|
|
h('.cell.row', { |
|
|
|
h('.cell.row', { |
|
|
|
style: { |
|
|
|
style: { |
|
|
@ -275,11 +274,11 @@ PTXP.gatherParams = function () { |
|
|
|
|
|
|
|
|
|
|
|
PTXP.calculateGas = function () { |
|
|
|
PTXP.calculateGas = function () { |
|
|
|
const txMeta = this.gatherParams() |
|
|
|
const txMeta = this.gatherParams() |
|
|
|
log.debug(`pending-tx-details calculating gas for ${ JSON.stringify(txMeta) }`) |
|
|
|
log.debug(`pending-tx-details calculating gas for ${JSON.stringify(txMeta)}`) |
|
|
|
const txUtils = this.txUtils |
|
|
|
|
|
|
|
this.txUtils.analyzeGasUsage(txMeta, (err, result) => { |
|
|
|
this.txUtils.analyzeGasUsage(txMeta, (err, result) => { |
|
|
|
console.log('ANALYZED') |
|
|
|
if (err) { |
|
|
|
console.dir(arguments) |
|
|
|
return this.setState({ error: err }) |
|
|
|
|
|
|
|
} |
|
|
|
const { txFee, maxCost } = result || txMeta |
|
|
|
const { txFee, maxCost } = result || txMeta |
|
|
|
if (txFee === txMeta.txFee && maxCost === txMeta.maxCost) { |
|
|
|
if (txFee === txMeta.txFee && maxCost === txMeta.maxCost) { |
|
|
|
log.warn(`Recalculating gas resulted in no change.`) |
|
|
|
log.warn(`Recalculating gas resulted in no change.`) |
|
|
|