diff options
Diffstat (limited to 'packages/sol-cov')
-rw-r--r-- | packages/sol-cov/CHANGELOG.json | 26 | ||||
-rw-r--r-- | packages/sol-cov/CHANGELOG.md | 4 | ||||
-rw-r--r-- | packages/sol-cov/package.json | 22 | ||||
-rw-r--r-- | packages/sol-cov/src/artifact_adapters/sol_compiler_artifact_adapter.ts | 4 | ||||
-rw-r--r-- | packages/sol-cov/src/artifact_adapters/truffle_artifact_adapter.ts | 4 | ||||
-rw-r--r-- | packages/sol-cov/src/ast_visitor.ts | 14 | ||||
-rw-r--r-- | packages/sol-cov/src/coverage_subprovider.ts | 2 | ||||
-rw-r--r-- | packages/sol-cov/src/get_source_range_snippet.ts | 2 | ||||
-rw-r--r-- | packages/sol-cov/src/profiler_subprovider.ts | 2 | ||||
-rw-r--r-- | packages/sol-cov/src/revert_trace_subprovider.ts | 4 | ||||
-rw-r--r-- | packages/sol-cov/src/trace_collection_subprovider.ts | 6 | ||||
-rw-r--r-- | packages/sol-cov/src/trace_collector.ts | 8 |
12 files changed, 57 insertions, 41 deletions
diff --git a/packages/sol-cov/CHANGELOG.json b/packages/sol-cov/CHANGELOG.json index 8a622162f..6b7cdf6e9 100644 --- a/packages/sol-cov/CHANGELOG.json +++ b/packages/sol-cov/CHANGELOG.json @@ -1,13 +1,15 @@ [ { - "version": "0.2.0", + "timestamp": 1532043000, + "version": "1.0.0", "changes": [ { - "note": "Add artifact adapter as a parameter for CoverageSubprovider. Export AbstractArtifactAdapter", + "note": + "Add artifact adapter as a parameter for `CoverageSubprovider`. Export `AbstractArtifactAdapter`", "pr": 589 }, { - "note": "Implement SolCompilerArtifactAdapter and TruffleArtifactAdapter", + "note": "Implement `SolCompilerArtifactAdapter` and `TruffleArtifactAdapter`", "pr": 589 }, { @@ -19,7 +21,7 @@ "pr": 589 }, { - "note": "Fixed a bug causing RegExp to crash if contract code is longer that 32767 characters", + "note": "Fixed a bug causing `RegExp` to crash if contract code is longer that 32767 characters", "pr": 675 }, { @@ -55,11 +57,12 @@ "pr": 675 }, { - "note": "Fix solcVersion regex in parameter validation", + "note": "Fix `solcVersion` regex in parameter validation", "pr": 690 }, { - "note": "Fix a bug when in TruffleArtifactsAdapter causing it to throw if compiler.json is not there", + "note": + "Fix a bug when in `TruffleArtifactsAdapter` causing it to throw if `compiler.json` is not there", "pr": 690 }, { @@ -67,7 +70,7 @@ "pr": 690 }, { - "note": "Create `RevertTraceSubprovider` which prints a stack trace when a REVERT is detected", + "note": "Create `RevertTraceSubprovider` which prints a stack trace when a `REVERT` is detected", "pr": 705 }, { @@ -77,6 +80,15 @@ ] }, { + "timestamp": 1531919263, + "version": "0.1.3", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "timestamp": 1531149657, "version": "0.1.2", "changes": [ diff --git a/packages/sol-cov/CHANGELOG.md b/packages/sol-cov/CHANGELOG.md index 0ed77253e..d7621c23d 100644 --- a/packages/sol-cov/CHANGELOG.md +++ b/packages/sol-cov/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v0.1.3 - _July 18, 2018_ + + * Dependencies updated + ## v0.1.2 - _July 9, 2018_ * Dependencies updated diff --git a/packages/sol-cov/package.json b/packages/sol-cov/package.json index 8553da7a4..86808bfc1 100644 --- a/packages/sol-cov/package.json +++ b/packages/sol-cov/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/sol-cov", - "version": "0.1.2", + "version": "1.0.0", "engines": { "node": ">=6.12" }, @@ -50,13 +50,13 @@ }, "homepage": "https://github.com/0xProject/0x.js/packages/sol-cov/README.md", "dependencies": { - "@0xproject/sol-compiler": "^0.5.3", - "@0xproject/subproviders": "^0.10.5", - "@0xproject/typescript-typings": "^0.4.2", - "@0xproject/utils": "^0.7.2", - "@0xproject/web3-wrapper": "^0.7.2", - "@0xproject/dev-utils": "^0.4.5", - "ethereum-types": "^0.0.2", + "@0xproject/sol-compiler": "^1.0.0", + "@0xproject/subproviders": "^1.0.0", + "@0xproject/typescript-typings": "^1.0.0", + "@0xproject/utils": "^1.0.0", + "@0xproject/web3-wrapper": "^1.0.0", + "@0xproject/dev-utils": "^1.0.0", + "ethereum-types": "^1.0.0", "ethereumjs-util": "^5.1.1", "glob": "^7.1.2", "istanbul": "^0.4.5", @@ -68,8 +68,8 @@ "solidity-parser-antlr": "^0.2.12" }, "devDependencies": { - "@0xproject/monorepo-scripts": "^0.2.1", - "@0xproject/tslint-config": "^0.4.20", + "@0xproject/monorepo-scripts": "^1.0.0", + "@0xproject/tslint-config": "^1.0.0", "@types/istanbul": "^0.4.30", "@types/loglevel": "^1.5.3", "@types/mkdirp": "^0.5.1", @@ -86,7 +86,7 @@ "nyc": "^11.0.1", "shx": "^0.2.2", "sinon": "^4.0.0", - "tslint": "5.8.0", + "tslint": "5.11.0", "typedoc": "0xProject/typedoc", "typescript": "2.7.1" }, diff --git a/packages/sol-cov/src/artifact_adapters/sol_compiler_artifact_adapter.ts b/packages/sol-cov/src/artifact_adapters/sol_compiler_artifact_adapter.ts index 220a9f98c..8e03bf7fd 100644 --- a/packages/sol-cov/src/artifact_adapters/sol_compiler_artifact_adapter.ts +++ b/packages/sol-cov/src/artifact_adapters/sol_compiler_artifact_adapter.ts @@ -12,8 +12,8 @@ import { AbstractArtifactAdapter } from './abstract_artifact_adapter'; const CONFIG_FILE = 'compiler.json'; export class SolCompilerArtifactAdapter extends AbstractArtifactAdapter { - private _artifactsPath: string; - private _sourcesPath: string; + private readonly _artifactsPath: string; + private readonly _sourcesPath: string; constructor(artifactsPath?: string, sourcesPath?: string) { super(); const config: CompilerOptions = fs.existsSync(CONFIG_FILE) diff --git a/packages/sol-cov/src/artifact_adapters/truffle_artifact_adapter.ts b/packages/sol-cov/src/artifact_adapters/truffle_artifact_adapter.ts index 53449e5e1..53b77aed5 100644 --- a/packages/sol-cov/src/artifact_adapters/truffle_artifact_adapter.ts +++ b/packages/sol-cov/src/artifact_adapters/truffle_artifact_adapter.ts @@ -7,8 +7,8 @@ import { AbstractArtifactAdapter } from './abstract_artifact_adapter'; import { SolCompilerArtifactAdapter } from './sol_compiler_artifact_adapter'; export class TruffleArtifactAdapter extends AbstractArtifactAdapter { - private _solcVersion: string; - private _sourcesPath: string; + private readonly _solcVersion: string; + private readonly _sourcesPath: string; constructor(sourcesPath: string, solcVersion: string) { super(); this._solcVersion = solcVersion; diff --git a/packages/sol-cov/src/ast_visitor.ts b/packages/sol-cov/src/ast_visitor.ts index a6bca4704..e55cdf6ec 100644 --- a/packages/sol-cov/src/ast_visitor.ts +++ b/packages/sol-cov/src/ast_visitor.ts @@ -18,15 +18,15 @@ enum BranchType { export class ASTVisitor { private _entryId = 0; - private _fnMap: FnMap = {}; - private _branchMap: BranchMap = {}; - private _modifiersStatementIds: number[] = []; - private _statementMap: StatementMap = {}; - private _locationByOffset: LocationByOffset; - private _ignoreRangesBeginningAt: number[]; + private readonly _fnMap: FnMap = {}; + private readonly _branchMap: BranchMap = {}; + private readonly _modifiersStatementIds: number[] = []; + private readonly _statementMap: StatementMap = {}; + private readonly _locationByOffset: LocationByOffset; + private readonly _ignoreRangesBeginningAt: number[]; // keep track of contract/function ranges that are to be ignored // so we can also ignore any children nodes within the contract/function - private _ignoreRangesWithin: Array<[number, number]> = []; + private readonly _ignoreRangesWithin: Array<[number, number]> = []; constructor(locationByOffset: LocationByOffset, ignoreRangesBeginningAt: number[] = []) { this._locationByOffset = locationByOffset; this._ignoreRangesBeginningAt = ignoreRangesBeginningAt; diff --git a/packages/sol-cov/src/coverage_subprovider.ts b/packages/sol-cov/src/coverage_subprovider.ts index 45843bc96..9667e891c 100644 --- a/packages/sol-cov/src/coverage_subprovider.ts +++ b/packages/sol-cov/src/coverage_subprovider.ts @@ -23,7 +23,7 @@ import { utils } from './utils'; * It's used to compute your code coverage while running solidity tests. */ export class CoverageSubprovider extends TraceInfoSubprovider { - private _coverageCollector: TraceCollector; + private readonly _coverageCollector: TraceCollector; /** * Instantiates a CoverageSubprovider instance * @param artifactAdapter Adapter for used artifacts format (0x, truffle, giveth, etc.) diff --git a/packages/sol-cov/src/get_source_range_snippet.ts b/packages/sol-cov/src/get_source_range_snippet.ts index 30d6ec802..bea17beae 100644 --- a/packages/sol-cov/src/get_source_range_snippet.ts +++ b/packages/sol-cov/src/get_source_range_snippet.ts @@ -38,7 +38,7 @@ export function getSourceRangeSnippet(sourceRange: SourceRange, sourceCode: stri // A visitor which collects ASTInfo for most nodes in the AST. class ASTInfoVisitor { - private _astInfos: ASTInfo[] = []; + private readonly _astInfos: ASTInfo[] = []; public getASTInfoForRange(sourceRange: SourceRange): ASTInfo | null { // HACK(albrow): Sometimes the source range doesn't exactly match that // of astInfo. To work around that we try with a +/-1 offset on diff --git a/packages/sol-cov/src/profiler_subprovider.ts b/packages/sol-cov/src/profiler_subprovider.ts index 9f98da524..ae9351f17 100644 --- a/packages/sol-cov/src/profiler_subprovider.ts +++ b/packages/sol-cov/src/profiler_subprovider.ts @@ -12,7 +12,7 @@ import { utils } from './utils'; * ProfilerSubprovider is used to profile Solidity code while running tests. */ export class ProfilerSubprovider extends TraceInfoSubprovider { - private _profilerCollector: TraceCollector; + private readonly _profilerCollector: TraceCollector; /** * Instantiates a ProfilerSubprovider instance * @param artifactAdapter Adapter for used artifacts format (0x, truffle, giveth, etc.) diff --git a/packages/sol-cov/src/revert_trace_subprovider.ts b/packages/sol-cov/src/revert_trace_subprovider.ts index fed305bd3..6ccf59653 100644 --- a/packages/sol-cov/src/revert_trace_subprovider.ts +++ b/packages/sol-cov/src/revert_trace_subprovider.ts @@ -18,8 +18,8 @@ import { utils } from './utils'; export class RevertTraceSubprovider extends TraceCollectionSubprovider { // Lock is used to not accept normal transactions while doing call/snapshot magic because they'll be reverted later otherwise private _contractsData!: ContractData[]; - private _artifactAdapter: AbstractArtifactAdapter; - private _logger: Logger; + private readonly _artifactAdapter: AbstractArtifactAdapter; + private readonly _logger: Logger; /** * Instantiates a RevertTraceSubprovider instance diff --git a/packages/sol-cov/src/trace_collection_subprovider.ts b/packages/sol-cov/src/trace_collection_subprovider.ts index 9866472b9..b530b59db 100644 --- a/packages/sol-cov/src/trace_collection_subprovider.ts +++ b/packages/sol-cov/src/trace_collection_subprovider.ts @@ -32,10 +32,10 @@ export interface TraceCollectionSubproviderConfig { export abstract class TraceCollectionSubprovider extends Subprovider { protected _web3Wrapper!: Web3Wrapper; // Lock is used to not accept normal transactions while doing call/snapshot magic because they'll be reverted later otherwise - private _lock = new Lock(); - private _defaultFromAddress: string; + private readonly _lock = new Lock(); + private readonly _defaultFromAddress: string; private _isEnabled = true; - private _config: TraceCollectionSubproviderConfig; + private readonly _config: TraceCollectionSubproviderConfig; /** * Instantiates a TraceCollectionSubprovider instance * @param defaultFromAddress default from address to use when sending transactions diff --git a/packages/sol-cov/src/trace_collector.ts b/packages/sol-cov/src/trace_collector.ts index 1b458edec..3e2ae3516 100644 --- a/packages/sol-cov/src/trace_collector.ts +++ b/packages/sol-cov/src/trace_collector.ts @@ -33,11 +33,11 @@ export type SingleFileSubtraceHandler = ( * TraceCollector is used by CoverageSubprovider to compute code coverage based on collected trace data. */ export class TraceCollector { - private _artifactAdapter: AbstractArtifactAdapter; - private _logger: Logger; + private readonly _artifactAdapter: AbstractArtifactAdapter; + private readonly _logger: Logger; private _contractsData!: ContractData[]; - private _collector = new Collector(); - private _singleFileSubtraceHandler: SingleFileSubtraceHandler; + private readonly _collector = new Collector(); + private readonly _singleFileSubtraceHandler: SingleFileSubtraceHandler; /** * Instantiates a TraceCollector instance |