Skip to content

Commit

Permalink
handling boolean for the status
Browse files Browse the repository at this point in the history
  • Loading branch information
yann300 committed Jan 15, 2020
1 parent 2e4f128 commit 71a7045
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/app/tabs/runTab/model/blockchain.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class Blockchain {
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`)
}
var address = isVM ? txResult.result.createdAddress : txResult.result.contractAddress
Expand Down
10 changes: 5 additions & 5 deletions src/app/ui/txLogger.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,12 +278,12 @@ function renderEmptyBlock (self, data) {
}

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>`
}
if (type === 'call' || type === 'unknownCall') {
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>`
} else {
return yo`<i class="${css.txStatus} ${css.notavailable} fas fa-circle-thin" title='Status not available' ></i>`
Expand Down Expand Up @@ -387,10 +387,10 @@ function createTable (opts) {
var table = yo`<table class="${css.txTable}" id="txTable"></table>`
if (!opts.isCall) {
var msg = ''
if (opts.status) {
if (opts.status === '0x0') {
if (opts.status !== undefined && opts.status !== null) {
if (opts.status === '0x0' || opts.status === false) {
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'
}
} else {
Expand Down

0 comments on commit 71a7045

Please sign in to comment.