aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-coverage
diff options
context:
space:
mode:
Diffstat (limited to 'packages/sol-coverage')
-rw-r--r--packages/sol-coverage/CHANGELOG.json18
-rw-r--r--packages/sol-coverage/CHANGELOG.md18
-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, 47 insertions, 9 deletions
diff --git a/packages/sol-coverage/CHANGELOG.json b/packages/sol-coverage/CHANGELOG.json
index 223400eae..8157d441e 100644
--- a/packages/sol-coverage/CHANGELOG.json
+++ b/packages/sol-coverage/CHANGELOG.json
@@ -1,5 +1,23 @@
[
{
+ "timestamp": 1547561734,
+ "version": "1.0.2",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "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..ac09a1bbf
--- /dev/null
+++ b/packages/sol-coverage/CHANGELOG.md
@@ -0,0 +1,18 @@
+<!--
+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.2 - _January 15, 2019_
+
+ * Dependencies updated
+
+## 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..efe91cf2b 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.2",
"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": "^4.0.0",
+ "@0x/subproviders": "^2.1.11",
+ "@0x/typescript-typings": "^3.0.8",
+ "ethereum-types": "^1.1.6",
"lodash": "^4.17.5"
},
"devDependencies": {
- "@0x/tslint-config": "^2.0.0",
+ "@0x/tslint-config": "^2.0.2",
"@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 {