Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling boolean for the status #2529

Merged
merged 1 commit into from
Jan 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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