diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2019-01-15 22:33:55 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-15 22:33:55 +0800 |
commit | 9932240a4d7cfc877be322a65c70f6bdf73d7ca7 (patch) | |
tree | 939109f2916554b2d6d6f429e600c56380d98e16 /packages/sol-tracing-utils/src/trace_collector.ts | |
parent | 91b57793c2b8a0bc1209dd174c6d8b946827aa7c (diff) | |
parent | f570f80674c22f69712c45e8e3c48e948b51f357 (diff) | |
download | dexon-0x-contracts-9932240a4d7cfc877be322a65c70f6bdf73d7ca7.tar dexon-0x-contracts-9932240a4d7cfc877be322a65c70f6bdf73d7ca7.tar.gz dexon-0x-contracts-9932240a4d7cfc877be322a65c70f6bdf73d7ca7.tar.bz2 dexon-0x-contracts-9932240a4d7cfc877be322a65c70f6bdf73d7ca7.tar.lz dexon-0x-contracts-9932240a4d7cfc877be322a65c70f6bdf73d7ca7.tar.xz dexon-0x-contracts-9932240a4d7cfc877be322a65c70f6bdf73d7ca7.tar.zst dexon-0x-contracts-9932240a4d7cfc877be322a65c70f6bdf73d7ca7.zip |
Merge branch 'development' into feature/new-ganache
Diffstat (limited to 'packages/sol-tracing-utils/src/trace_collector.ts')
-rw-r--r-- | packages/sol-tracing-utils/src/trace_collector.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/sol-tracing-utils/src/trace_collector.ts b/packages/sol-tracing-utils/src/trace_collector.ts index 943e208cf..f5dde8762 100644 --- a/packages/sol-tracing-utils/src/trace_collector.ts +++ b/packages/sol-tracing-utils/src/trace_collector.ts @@ -56,7 +56,7 @@ export class TraceCollector { this._singleFileSubtraceHandler = singleFileSubtraceHandler; } public async writeOutputAsync(): Promise<void> { - const finalCoverage = this._collector.getFinalCoverage(); + const finalCoverage: Coverage = this._collector.getFinalCoverage(); const stringifiedCoverage = JSON.stringify(finalCoverage, null, '\t'); await mkdirpAsync('coverage'); fs.writeFileSync('coverage/coverage.json', stringifiedCoverage); @@ -80,14 +80,14 @@ export class TraceCollector { const bytecodeHex = stripHexPrefix(bytecode); const sourceMap = isContractCreation ? contractData.sourceMap : contractData.sourceMapRuntime; const pcToSourceRange = parseSourceMap(contractData.sourceCodes, sourceMap, bytecodeHex, contractData.sources); - for (let fileIndex = 0; fileIndex < contractData.sources.length; fileIndex++) { + _.map(contractData.sources, (_sourcePath: string, fileIndex: string) => { const singleFileCoverageForTrace = this._singleFileSubtraceHandler( contractData, traceInfo.subtrace, pcToSourceRange, - fileIndex, + _.parseInt(fileIndex), ); this._collector.add(singleFileCoverageForTrace); - } + }); } } |