Commit ece75953 authored by aniket-engg's avatar aniket-engg Committed by Aniket

tests fixed

parent dbb71b17
...@@ -282,9 +282,10 @@ export function runTest (testName: string, testObject: any, contractDetails: Com ...@@ -282,9 +282,10 @@ export function runTest (testName: string, testObject: any, contractDetails: Com
} }
if (!sendParams) sendParams = {} if (!sendParams) sendParams = {}
sendParams.gas = 10000000 * 8 sendParams.gas = 10000000 * 8
method.send(sendParams).on('receipt', (receipt) => { method.send(sendParams).on('receipt', async (receipt) => {
try { try {
web3.eth.getHHLogsForTx(receipt.transactionHash).then((hhLogs) => { let hhLogs
if (web3.eth && web3.eth.getHHLogsForTx) hhLogs = await web3.eth.getHHLogsForTx(receipt.transactionHash)
const time: number = (Date.now() - startTime) / 1000.0 const time: number = (Date.now() - startTime) / 1000.0
const assertionEventHashes = assertionEvents.map(e => Web3.utils.sha3(e.name + '(' + e.params.join() + ')')) const assertionEventHashes = assertionEvents.map(e => Web3.utils.sha3(e.name + '(' + e.params.join() + ')'))
let testPassed = false let testPassed = false
...@@ -313,8 +314,8 @@ export function runTest (testName: string, testObject: any, contractDetails: Com ...@@ -313,8 +314,8 @@ export function runTest (testName: string, testObject: any, contractDetails: Com
returned: testEvent[3], returned: testEvent[3],
expected: testEvent[4], expected: testEvent[4],
location, location,
hhLogs
} }
if (hhLogs) resp.hhLogs = hhLogs
testCallback(undefined, resp) testCallback(undefined, resp)
failureNum += 1 failureNum += 1
timePassed += time timePassed += time
...@@ -332,15 +333,14 @@ export function runTest (testName: string, testObject: any, contractDetails: Com ...@@ -332,15 +333,14 @@ export function runTest (testName: string, testObject: any, contractDetails: Com
filename: testObject.filename, filename: testObject.filename,
time: time, time: time,
context: testName, context: testName,
hhLogs
} }
if (hhLogs) resp.hhLogs = hhLogs
testCallback(undefined, resp) testCallback(undefined, resp)
passingNum += 1 passingNum += 1
timePassed += time timePassed += time
} }
return next() return next()
})
} catch (err) { } catch (err) {
console.error(err) console.error(err)
return next(err) return next(err)
......
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