|
|
|
@ -6,6 +6,7 @@ |
|
|
|
|
const SolidityCoder = require('web3/lib/solidity/coder.js'); |
|
|
|
|
const path = require('path'); |
|
|
|
|
const keccak = require('keccakjs'); |
|
|
|
|
const fs = require('fs'); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Converts solcover event data into an object that can be |
|
|
|
@ -64,10 +65,20 @@ module.exports = class CoverageMap { |
|
|
|
|
return hash.digest('hex'); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
this.lineTopics.push(keccakhex('__Coverage' + info.contractName + '(string,uint256)')); |
|
|
|
|
this.functionTopics.push(keccakhex('__FunctionCoverage' + info.contractName + '(string,uint256)')); |
|
|
|
|
this.branchTopics.push(keccakhex('__BranchCoverage' + info.contractName + '(string,uint256,uint256)')); |
|
|
|
|
this.statementTopics.push(keccakhex('__StatementCoverage' + info.contractName + '(string,uint256)')); |
|
|
|
|
const lineHash = keccakhex('__Coverage' + info.contractName + '(string,uint256)'); |
|
|
|
|
const fnHash = keccakhex('__FunctionCoverage' + info.contractName + '(string,uint256)'); |
|
|
|
|
const branchHash = keccakhex('__BranchCoverage' + info.contractName + '(string,uint256,uint256)'); |
|
|
|
|
const statementHash = keccakhex('__StatementCoverage' + info.contractName + '(string,uint256)'); |
|
|
|
|
|
|
|
|
|
this.lineTopics.push(lineHash); |
|
|
|
|
this.functionTopics.push(fnHash); |
|
|
|
|
this.branchTopics.push(branchHash); |
|
|
|
|
this.statementTopics.push(statementHash); |
|
|
|
|
|
|
|
|
|
fs.appendFileSync('./scTopics', `${lineHash}\n`); |
|
|
|
|
fs.appendFileSync('./scTopics', `${fnHash}\n`); |
|
|
|
|
fs.appendFileSync('./scTopics', `${branchHash}\n`); |
|
|
|
|
fs.appendFileSync('./scTopics', `${statementHash}\n`); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|