From 71a7045c88de556bef708dd4eeb736b93971dff9 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 15 Jan 2020 10:36:50 +0100 Subject: [PATCH] handling boolean for the status --- src/app/tabs/runTab/model/blockchain.js | 2 +- src/app/ui/txLogger.js | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/tabs/runTab/model/blockchain.js b/src/app/tabs/runTab/model/blockchain.js index db5643136b9..ddbb72a661a 100644 --- a/src/app/tabs/runTab/model/blockchain.js +++ b/src/app/tabs/runTab/model/blockchain.js @@ -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 diff --git a/src/app/ui/txLogger.js b/src/app/ui/txLogger.js index 010a277715e..7aabd59213f 100644 --- a/src/app/ui/txLogger.js +++ b/src/app/ui/txLogger.js @@ -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`` } if (type === 'call' || type === 'unknownCall') { return yo`call` - } else if (tx.status === '0x0') { + } else if (tx.status === '0x0' || tx.status === false) { return yo`` } else { return yo`` @@ -387,10 +387,10 @@ function createTable (opts) { var table = yo`
` 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 {