aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-coverage
diff options
context:
space:
mode:
Diffstat (limited to 'packages/sol-coverage')
-rw-r--r--packages/sol-coverage/CHANGELOG.json9
-rw-r--r--packages/sol-coverage/CHANGELOG.md14
-rw-r--r--packages/sol-coverage/package.json12
-rw-r--r--packages/sol-coverage/src/coverage_subprovider.ts6
-rw-r--r--packages/sol-coverage/src/index.ts2
5 files changed, 34 insertions, 9 deletions
diff --git a/packages/sol-coverage/CHANGELOG.json b/packages/sol-coverage/CHANGELOG.json
index 223400eae..858ec8227 100644
--- a/packages/sol-coverage/CHANGELOG.json
+++ b/packages/sol-coverage/CHANGELOG.json
@@ -1,5 +1,14 @@
[
{
+ "timestamp": 1547225310,
+ "version": "1.0.1",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"version": "1.0.0",
"changes": [
{
diff --git a/packages/sol-coverage/CHANGELOG.md b/packages/sol-coverage/CHANGELOG.md
new file mode 100644
index 000000000..f2c34622d
--- /dev/null
+++ b/packages/sol-coverage/CHANGELOG.md
@@ -0,0 +1,14 @@
+<!--
+changelogUtils.file is auto-generated using the monorepo-scripts package. Don't edit directly.
+Edit the package's CHANGELOG.json file only.
+-->
+
+CHANGELOG
+
+## v1.0.1 - _January 11, 2019_
+
+ * Dependencies updated
+
+## v1.0.0 - _Invalid date_
+
+ * Initial release as a separate package. For historical entries see @0x/sol-tracing-utils (#1492)
diff --git a/packages/sol-coverage/package.json b/packages/sol-coverage/package.json
index 7dc764efd..510a568e0 100644
--- a/packages/sol-coverage/package.json
+++ b/packages/sol-coverage/package.json
@@ -1,6 +1,6 @@
{
"name": "@0x/sol-coverage",
- "version": "1.0.0",
+ "version": "1.0.1",
"engines": {
"node": ">=6.12"
},
@@ -29,14 +29,14 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/sol-coverage/README.md",
"dependencies": {
- "@0x/subproviders": "^2.1.8",
- "@0x/sol-tracing-utils": "^2.1.16",
- "@0x/typescript-typings": "^3.0.6",
- "ethereum-types": "^1.1.4",
+ "@0x/sol-tracing-utils": "^3.0.0",
+ "@0x/subproviders": "^2.1.10",
+ "@0x/typescript-typings": "^3.0.7",
+ "ethereum-types": "^1.1.5",
"lodash": "^4.17.5"
},
"devDependencies": {
- "@0x/tslint-config": "^2.0.0",
+ "@0x/tslint-config": "^2.0.1",
"@types/node": "*",
"npm-run-all": "^4.1.2",
"nyc": "^11.0.1",
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 {