Commit 3c35257e authored by aniket-engg's avatar aniket-engg Committed by Aniket

show logs for method call

parent 36f76864
......@@ -244,8 +244,15 @@ export function runTest (testName: string, testObject: any, contractDetails: Com
const method = testObject.methods[func.name].apply(testObject.methods[func.name], [])
const startTime = Date.now()
if (func.constant) {
method.call(sendParams).then((result) => {
sendParams = {}
const tagTimestamp = 'remix_tests_tag' + Date.now()
sendParams.timestamp = tagTimestamp
method.call(sendParams).then(async (result) => {
const time = (Date.now() - startTime) / 1000.0
let tagTxHash
let hhLogs
if (web3.eth && web3.eth.getHashFromTagBySimulator) tagTxHash = await web3.eth.getHashFromTagBySimulator(tagTimestamp)
if (web3.eth && web3.eth.getHHLogsForTx) hhLogs = await web3.eth.getHHLogsForTx(tagTxHash)
if (result) {
const resp: TestResultInterface = {
type: 'testPass',
......@@ -254,6 +261,7 @@ export function runTest (testName: string, testObject: any, contractDetails: Com
time: time,
context: testName
}
if (hhLogs) resp.hhLogs = hhLogs
testCallback(undefined, resp)
passingNum += 1
timePassed += time
......@@ -266,6 +274,7 @@ export function runTest (testName: string, testObject: any, contractDetails: Com
errMsg: 'function returned false',
context: testName
}
if (hhLogs) resp.hhLogs = hhLogs
testCallback(undefined, resp)
failureNum += 1
timePassed += time
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment