aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-coverage/src
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2019-01-15 22:13:24 +0800
committerFabio Berger <me@fabioberger.com>2019-01-15 22:13:24 +0800
commit7c37d10d1f93791db75b1622efa775a361965c49 (patch)
tree7017104bea27120661f71701552214dc5efba909 /packages/sol-coverage/src
parentaffd6170540034c31593a4f36ce1dbacb91b6b3e (diff)
parent18084588ea9fa724d6e32c9a49c79d49f189ba7c (diff)
downloaddexon-sol-tools-7c37d10d1f93791db75b1622efa775a361965c49.tar
dexon-sol-tools-7c37d10d1f93791db75b1622efa775a361965c49.tar.gz
dexon-sol-tools-7c37d10d1f93791db75b1622efa775a361965c49.tar.bz2
dexon-sol-tools-7c37d10d1f93791db75b1622efa775a361965c49.tar.lz
dexon-sol-tools-7c37d10d1f93791db75b1622efa775a361965c49.tar.xz
dexon-sol-tools-7c37d10d1f93791db75b1622efa775a361965c49.tar.zst
dexon-sol-tools-7c37d10d1f93791db75b1622efa775a361965c49.zip
Merge branch 'development' into feature/monorepo-scripts/publishToDockerHub
* development: (87 commits) Update packages/sol-tracing-utils/src/trace_collection_subprovider.ts Make mapping namings direct Remove unused tslint disable Revert "Remove logAsyncErrors hack" Remove logAsyncErrors hack Refactor logAsyncErrors to follow our conventions Export Sources and SourceCodes out of tracing utils Replace console.log with logUtils.log (#1515) strict decoding of return values using generics makerAssetFillAmount -> takerAssetFillAmount Ran prettier Linter Fix build after rebase Style cleanup for Compressed Calldata in Contract Wrappers PR Use simpler `_.find` to locate fillOrderBai Updated dutch auction wrapper Added back abi-gen-wrappers Renamed signatureParser.ts to signature_parser.ts Renamed decode rule `structsAsObjects` to `shouldConvertStructsToObjects` circle build failed. New commit to resubmit job. ...
Diffstat (limited to 'packages/sol-coverage/src')
-rw-r--r--packages/sol-coverage/src/coverage_subprovider.ts6
-rw-r--r--packages/sol-coverage/src/index.ts2
2 files changed, 5 insertions, 3 deletions
diff --git a/packages/sol-coverage/src/coverage_subprovider.ts b/packages/sol-coverage/src/coverage_subprovider.ts
index e6b546c4a..d03963ed6 100644
--- a/packages/sol-coverage/src/coverage_subprovider.ts
+++ b/packages/sol-coverage/src/coverage_subprovider.ts
@@ -74,19 +74,19 @@ 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 = {};
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);
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 {