From 4d03c3035c9186d4a05b159f8209cda046b397a3 Mon Sep 17 00:00:00 2001 From: Remco Bloemen Date: Thu, 20 Dec 2018 14:59:12 -0800 Subject: Fix typo --- packages/sol-coverage/src/coverage_subprovider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/sol-coverage') diff --git a/packages/sol-coverage/src/coverage_subprovider.ts b/packages/sol-coverage/src/coverage_subprovider.ts index e6b546c4a..21d25ed74 100644 --- a/packages/sol-coverage/src/coverage_subprovider.ts +++ b/packages/sol-coverage/src/coverage_subprovider.ts @@ -74,7 +74,7 @@ export const coverageHandler: SingleFileSubtraceHandler = ( let sourceRanges = _.map(subtrace, structLog => pcToSourceRange[structLog.pc]); sourceRanges = _.compact(sourceRanges); // Some PC's don't map to a source range and we just ignore them. - // By default lodash does a shallow object comparasion. We JSON.stringify them and compare as strings. + // By default lodash does a shallow object comparison. We JSON.stringify them and compare as strings. sourceRanges = _.uniqBy(sourceRanges, s => JSON.stringify(s)); // We don't care if one PC was covered multiple times within a single transaction sourceRanges = _.filter(sourceRanges, sourceRange => sourceRange.fileName === absoluteFileName); const branchCoverage: BranchCoverage = {}; -- cgit From a8e32d8c87bd2bcf846f124f2d153fd92658dd1e Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 15 Jan 2019 11:18:29 +0100 Subject: Export Sources and SourceCodes out of tracing utils --- packages/sol-coverage/src/index.ts | 2 ++ 1 file changed, 2 insertions(+) (limited to 'packages/sol-coverage') diff --git a/packages/sol-coverage/src/index.ts b/packages/sol-coverage/src/index.ts index 97b4ecee6..6a91a3966 100644 --- a/packages/sol-coverage/src/index.ts +++ b/packages/sol-coverage/src/index.ts @@ -4,6 +4,8 @@ export { TruffleArtifactAdapter, AbstractArtifactAdapter, ContractData, + SourceCodes, + Sources, } from '@0x/sol-tracing-utils'; export { -- cgit From 63a63543be74d9e8822b7b111aa46350a5f524d8 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 15 Jan 2019 13:33:24 +0100 Subject: Make mapping namings direct --- packages/sol-coverage/src/coverage_subprovider.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/sol-coverage') diff --git a/packages/sol-coverage/src/coverage_subprovider.ts b/packages/sol-coverage/src/coverage_subprovider.ts index 21d25ed74..d03963ed6 100644 --- a/packages/sol-coverage/src/coverage_subprovider.ts +++ b/packages/sol-coverage/src/coverage_subprovider.ts @@ -81,12 +81,12 @@ export const coverageHandler: SingleFileSubtraceHandler = ( const branchIds = _.keys(coverageEntriesDescription.branchMap); for (const branchId of branchIds) { const branchDescription = coverageEntriesDescription.branchMap[branchId]; - const isBranchCoveredByBranchIndex = _.map(branchDescription.locations, location => { + const branchIndexToIsBranchCovered = _.map(branchDescription.locations, location => { const isBranchCovered = _.some(sourceRanges, range => utils.isRangeInside(range.location, location)); const timesBranchCovered = Number(isBranchCovered); return timesBranchCovered; }); - branchCoverage[branchId] = isBranchCoveredByBranchIndex; + branchCoverage[branchId] = branchIndexToIsBranchCovered; } const statementCoverage: StatementCoverage = {}; const statementIds = _.keys(coverageEntriesDescription.statementMap); -- cgit