|
|
@ -201,11 +201,10 @@ module.exports = class TestTab extends ViewPlugin { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async startDebug (result) { |
|
|
|
async startDebug (txHash, web3) { |
|
|
|
const txHash = JSON.parse(result.errMsg.replace('Transaction has been reverted by the EVM:', '')).transactionHash |
|
|
|
|
|
|
|
if (!await this.appManager.isActive('debugger')) await this.appManager.activatePlugin('debugger') |
|
|
|
if (!await this.appManager.isActive('debugger')) await this.appManager.activatePlugin('debugger') |
|
|
|
this.call('menuicons', 'select', 'debugger') |
|
|
|
this.call('menuicons', 'select', 'debugger') |
|
|
|
this.call('debugger', 'debug', txHash, result.web3) |
|
|
|
this.call('debugger', 'debug', txHash, web3) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
printHHLogs (logsArr, testName) { |
|
|
|
printHHLogs (logsArr, testName) { |
|
|
@ -258,6 +257,20 @@ module.exports = class TestTab extends ViewPlugin { |
|
|
|
} else if (result.type === 'testFailure') { |
|
|
|
} else if (result.type === 'testFailure') { |
|
|
|
if (result.hhLogs && result.hhLogs.length) this.printHHLogs(result.hhLogs, result.value) |
|
|
|
if (result.hhLogs && result.hhLogs.length) this.printHHLogs(result.hhLogs, result.value) |
|
|
|
if (!result.assertMethod) { |
|
|
|
if (!result.assertMethod) { |
|
|
|
|
|
|
|
let debugBtn = yo`` |
|
|
|
|
|
|
|
if(result.errMsg.includes('Transaction has been reverted by the EVM')) { |
|
|
|
|
|
|
|
const txHash = JSON.parse(result.errMsg.replace('Transaction has been reverted by the EVM:', '')).transactionHash |
|
|
|
|
|
|
|
const { web3 } = result |
|
|
|
|
|
|
|
debugBtn = yo`<div
|
|
|
|
|
|
|
|
class="btn border btn btn-sm ml-1" |
|
|
|
|
|
|
|
title="Start debugging" |
|
|
|
|
|
|
|
onclick=${() => this.startDebug(txHash, web3)} |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<i class="fas fa-bug"></i> |
|
|
|
|
|
|
|
</div>` |
|
|
|
|
|
|
|
debugBtn.style.visibility = 'visible' |
|
|
|
|
|
|
|
debugBtn.style.cursor = 'pointer' |
|
|
|
|
|
|
|
} else debugBtn.style.visibility = 'hidden' |
|
|
|
this.testsOutput.appendChild(yo` |
|
|
|
this.testsOutput.appendChild(yo` |
|
|
|
<div |
|
|
|
<div |
|
|
|
class="bg-light mb-2 px-2 ${css.testLog} d-flex flex-column text-danger border-0" |
|
|
|
class="bg-light mb-2 px-2 ${css.testLog} d-flex flex-column text-danger border-0" |
|
|
@ -266,13 +279,7 @@ module.exports = class TestTab extends ViewPlugin { |
|
|
|
> |
|
|
|
> |
|
|
|
<div class="d-flex my-1 align-items-start justify-content-between"> |
|
|
|
<div class="d-flex my-1 align-items-start justify-content-between"> |
|
|
|
<span> ✘ ${result.value}</span> |
|
|
|
<span> ✘ ${result.value}</span> |
|
|
|
<div |
|
|
|
${debugBtn} |
|
|
|
class="btn border btn btn-sm ml-1" |
|
|
|
|
|
|
|
title="Start debugging" |
|
|
|
|
|
|
|
onclick=${() => this.startDebug(result)} |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<i class="fas fa-bug"></i> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<span class="text-dark">Error Message:</span> |
|
|
|
<span class="text-dark">Error Message:</span> |
|
|
|
<span class="pb-2 text-break">"${result.errMsg}"</span> |
|
|
|
<span class="pb-2 text-break">"${result.errMsg}"</span> |
|
|
|