add status info

pull/1/head
yann300 7 years ago
parent f2c47edb4e
commit f14e82da7d
  1. 1
      src/app/execution/txListener.js
  2. 20
      src/app/execution/txLogger.js
  3. 1
      src/app/execution/txRunner.js

@ -76,6 +76,7 @@ class TxListener {
}
tx.envMode = executionContext.getProvider()
tx.status = txResult.result.status // 0x0 or 0x1
this._resolve([tx], () => {
})
})

@ -182,7 +182,8 @@ function renderKnownTransaction (self, data) {
logs: data.logs,
val: data.tx.value,
transactionCost: data.tx.transactionCost,
executionCost: data.tx.executionCost
executionCost: data.tx.executionCost,
status: data.tx.status
})
tx.appendChild(table)
}
@ -248,7 +249,8 @@ function renderUnknownTransaction (self, data) {
gas: data.tx.gas,
logs: data.logs,
transactionCost: data.tx.transactionCost,
executionCost: data.tx.executionCost
executionCost: data.tx.executionCost,
status: data.tx.status
})
tx.appendChild(table)
}
@ -289,6 +291,20 @@ module.exports = TxLogger
function createTable (opts) {
var table = yo`<table class="${css.txTable}" id="txTable"></table>`
if (opts.status) {
var msg = ''
if (opts.status === '0x0') {
msg = ' Transaction mined but execution failed'
} else if (opts.status === '0x1') {
msg = ' Transaction mined and execution succeed'
}
table.appendChild(yo`
<tr class="${css.tr}">
<td class="${css.td}"> status </td>
<td class="${css.td}">${opts.status}${msg}</td>
</tr class="${css.tr}">`)
}
var contractAddress = yo`
<tr class="${css.tr}">
<td class="${css.td}"> contractAddress </td>

@ -120,6 +120,7 @@ TxRunner.prototype.execute = function (args, callback) {
executionContext.vm().stateManager.revert(function () {})
}
err = err ? err.message : err
result.status = '0x' + result.vm.exception.toString(16)
callback(err, {
result: result,
transactionHash: ethJSUtil.bufferToHex(new Buffer(tx.hash()))

Loading…
Cancel
Save