|
|
@ -72,15 +72,21 @@ export class TxRunnerWeb3 { |
|
|
|
const tx = { from: from, to: to, data: data, value: value } |
|
|
|
const tx = { from: from, to: to, data: data, value: value } |
|
|
|
|
|
|
|
|
|
|
|
if (useCall) { |
|
|
|
if (useCall) { |
|
|
|
const tag = Date.now() // for e2e reference
|
|
|
|
|
|
|
|
tx['gas'] = gasLimit |
|
|
|
tx['gas'] = gasLimit |
|
|
|
// tx['timestamp'] = timestamp
|
|
|
|
tx['timestamp'] = timestamp |
|
|
|
|
|
|
|
return this._api.detectNetwork((err, network) => { |
|
|
|
|
|
|
|
if (err) { |
|
|
|
|
|
|
|
console.log(err) |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} else if (network && network.name === 'Kovan') delete tx['timestamp'] |
|
|
|
|
|
|
|
|
|
|
|
return this.getWeb3().eth.call(tx, function (error, result: any) { |
|
|
|
return this.getWeb3().eth.call(tx, function (error, result: any) { |
|
|
|
if (error) return callback(error) |
|
|
|
if (error) return callback(error) |
|
|
|
callback(null, { |
|
|
|
callback(null, { |
|
|
|
result: result |
|
|
|
result: result |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
this.getWeb3().eth.estimateGas(tx, (err, gasEstimation) => { |
|
|
|
this.getWeb3().eth.estimateGas(tx, (err, gasEstimation) => { |
|
|
|
if (err && err.message.indexOf('Invalid JSON RPC response') !== -1) { |
|
|
|
if (err && err.message.indexOf('Invalid JSON RPC response') !== -1) { |
|
|
|