handling boolean for the status

pull/5370/head
yann300 5 years ago
parent f9ffba0cf8
commit 29fffb7d70
  1. 2
      src/app/tabs/runTab/model/blockchain.js
  2. 10
      src/app/ui/txLogger.js

@ -58,7 +58,7 @@ class Blockchain {
return finalCb(vmError.message) return finalCb(vmError.message)
} }
} }
if (txResult.result.status && txResult.result.status === '0x0') { if (txResult.result.status === false || txResult.result.status === '0x0') {
return finalCb(`creation of ${selectedContract.name} errored: transaction execution failed`) return finalCb(`creation of ${selectedContract.name} errored: transaction execution failed`)
} }
var address = isVM ? txResult.result.createdAddress : txResult.result.contractAddress var address = isVM ? txResult.result.createdAddress : txResult.result.contractAddress

@ -278,12 +278,12 @@ function renderEmptyBlock (self, data) {
} }
function checkTxStatus (tx, type) { function checkTxStatus (tx, type) {
if (tx.status === '0x1') { if (tx.status === '0x1' || tx.status === true) {
return yo`<i class="${css.txStatus} ${css.succeeded} fas fa-check-circle"></i>` return yo`<i class="${css.txStatus} ${css.succeeded} fas fa-check-circle"></i>`
} }
if (type === 'call' || type === 'unknownCall') { if (type === 'call' || type === 'unknownCall') {
return yo`<i class="${css.txStatus} ${css.call}">call</i>` return yo`<i class="${css.txStatus} ${css.call}">call</i>`
} else if (tx.status === '0x0') { } else if (tx.status === '0x0' || tx.status === false) {
return yo`<i class="${css.txStatus} ${css.failed} fas fa-times-circle"></i>` return yo`<i class="${css.txStatus} ${css.failed} fas fa-times-circle"></i>`
} else { } else {
return yo`<i class="${css.txStatus} ${css.notavailable} fas fa-circle-thin" title='Status not available' ></i>` return yo`<i class="${css.txStatus} ${css.notavailable} fas fa-circle-thin" title='Status not available' ></i>`
@ -387,10 +387,10 @@ function createTable (opts) {
var table = yo`<table class="${css.txTable}" id="txTable"></table>` var table = yo`<table class="${css.txTable}" id="txTable"></table>`
if (!opts.isCall) { if (!opts.isCall) {
var msg = '' var msg = ''
if (opts.status) { if (opts.status !== undefined && opts.status !== null) {
if (opts.status === '0x0') { if (opts.status === '0x0' || opts.status === false) {
msg = ' Transaction mined but execution failed' msg = ' Transaction mined but execution failed'
} else if (opts.status === '0x1') { } else if (opts.status === '0x1' || opts.status === true) {
msg = ' Transaction mined and execution succeed' msg = ' Transaction mined and execution succeed'
} }
} else { } else {

Loading…
Cancel
Save