aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-cov/src
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-06-07 09:07:22 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-06-07 09:07:22 +0800
commit2af6d3f6bc03932f53d199971694c3c0d9441ba8 (patch)
treeb17f3343a635aa72a917b89f278f63924e25da3e /packages/sol-cov/src
parentcbe5438a31a54a92a198b2cc5ad8a5d5feb033b4 (diff)
parent67c4ad128c405692e471274148c9a2ef7cd8b6ca (diff)
downloaddexon-sol-tools-2af6d3f6bc03932f53d199971694c3c0d9441ba8.tar.gz
dexon-sol-tools-2af6d3f6bc03932f53d199971694c3c0d9441ba8.tar.zst
dexon-sol-tools-2af6d3f6bc03932f53d199971694c3c0d9441ba8.zip
Merge branch 'v2-prototype' of https://github.com/0xProject/0x-monorepo into feature/website/onboarding-flow-allowances
Diffstat (limited to 'packages/sol-cov/src')
-rw-r--r--packages/sol-cov/src/artifact_adapters/sol_compiler_artifact_adapter.ts1
-rw-r--r--packages/sol-cov/src/artifact_adapters/truffle_artifact_adapter.ts4
-rw-r--r--packages/sol-cov/src/collect_coverage_entries.ts2
-rw-r--r--packages/sol-cov/src/coverage_manager.ts10
-rw-r--r--packages/sol-cov/src/coverage_subprovider.ts1
-rw-r--r--packages/sol-cov/src/source_maps.ts2
-rw-r--r--packages/sol-cov/src/trace.ts5
7 files changed, 6 insertions, 19 deletions
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 d08828bf6..6e385203b 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
@@ -32,7 +32,6 @@ export class SolCompilerArtifactAdapter extends AbstractArtifactAdapter {
const artifact = JSON.parse(fs.readFileSync(artifactFileName).toString());
let sources = _.keys(artifact.sources);
sources = _.map(sources, relativeFilePath => path.resolve(this._sourcesPath, relativeFilePath));
- const contractName = artifact.contractName;
const sourceCodes = _.map(sources, (source: string) => fs.readFileSync(source).toString());
const contractData = {
sourceCodes,
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 c7f21b6eb..53449e5e1 100644
--- a/packages/sol-cov/src/artifact_adapters/truffle_artifact_adapter.ts
+++ b/packages/sol-cov/src/artifact_adapters/truffle_artifact_adapter.ts
@@ -1,8 +1,4 @@
import { Compiler, CompilerOptions } from '@0xproject/sol-compiler';
-import * as fs from 'fs';
-import * as glob from 'glob';
-import * as _ from 'lodash';
-import * as path from 'path';
import * as rimraf from 'rimraf';
import { ContractData } from '../types';
diff --git a/packages/sol-cov/src/collect_coverage_entries.ts b/packages/sol-cov/src/collect_coverage_entries.ts
index 97218616c..b145f044e 100644
--- a/packages/sol-cov/src/collect_coverage_entries.ts
+++ b/packages/sol-cov/src/collect_coverage_entries.ts
@@ -1,7 +1,5 @@
import * as ethUtil from 'ethereumjs-util';
-import * as fs from 'fs';
import * as _ from 'lodash';
-import * as path from 'path';
import * as parser from 'solidity-parser-antlr';
import { ASTVisitor, CoverageEntriesDescription } from './ast_visitor';
diff --git a/packages/sol-cov/src/coverage_manager.ts b/packages/sol-cov/src/coverage_manager.ts
index 31b0e6fbc..064338a32 100644
--- a/packages/sol-cov/src/coverage_manager.ts
+++ b/packages/sol-cov/src/coverage_manager.ts
@@ -1,11 +1,10 @@
import { promisify } from '@0xproject/utils';
-import { addHexPrefix, stripHexPrefix } from 'ethereumjs-util';
+import { stripHexPrefix } from 'ethereumjs-util';
import * as fs from 'fs';
import { Collector } from 'istanbul';
import * as _ from 'lodash';
-import { getLogger, levels, Logger, LogLevel } from 'loglevel';
+import { getLogger, levels, Logger } from 'loglevel';
import * as mkdirp from 'mkdirp';
-import * as path from 'path';
import { AbstractArtifactAdapter } from './artifact_adapters/abstract_artifact_adapter';
import { collectCoverageEntries } from './collect_coverage_entries';
@@ -14,18 +13,14 @@ import { parseSourceMap } from './source_maps';
import {
BranchCoverage,
BranchDescription,
- BranchMap,
ContractData,
Coverage,
- FnMap,
FunctionCoverage,
FunctionDescription,
- LineColumn,
SingleFileSourceRange,
SourceRange,
StatementCoverage,
StatementDescription,
- StatementMap,
TraceInfo,
TraceInfoExistingContract,
TraceInfoNewContract,
@@ -38,6 +33,7 @@ export class CoverageManager {
private _artifactAdapter: AbstractArtifactAdapter;
private _logger: Logger;
private _traceInfos: TraceInfo[] = [];
+ // tslint:disable-next-line:no-unused-variable
private _getContractCodeAsync: (address: string) => Promise<string>;
private static _getSingleFileCoverageForTrace(
contractData: ContractData,
diff --git a/packages/sol-cov/src/coverage_subprovider.ts b/packages/sol-cov/src/coverage_subprovider.ts
index ca7f4aed2..13b76f537 100644
--- a/packages/sol-cov/src/coverage_subprovider.ts
+++ b/packages/sol-cov/src/coverage_subprovider.ts
@@ -1,6 +1,5 @@
import { Callback, ErrorCallback, NextCallback, Subprovider } from '@0xproject/subproviders';
import { BlockParam, CallData, JSONRPCRequestPayload, TransactionTrace, TxData } from 'ethereum-types';
-import * as fs from 'fs';
import * as _ from 'lodash';
import { Lock } from 'semaphore-async-await';
diff --git a/packages/sol-cov/src/source_maps.ts b/packages/sol-cov/src/source_maps.ts
index 694171442..f9503e16c 100644
--- a/packages/sol-cov/src/source_maps.ts
+++ b/packages/sol-cov/src/source_maps.ts
@@ -38,10 +38,10 @@ export function parseSourceMap(
const pcToInstructionIndex: { [programCounter: number]: number } = getPcToInstructionIndexMapping(bytecode);
const locationByOffsetByFileIndex = _.map(sourceCodes, getLocationByOffset);
const entries = srcMap.split(';');
- const parsedEntries: SourceLocation[] = [];
let lastParsedEntry: SourceLocation = {} as any;
const instructionIndexToSourceRange: { [instructionIndex: number]: SourceRange } = {};
_.each(entries, (entry: string, i: number) => {
+ // tslint:disable-next-line:no-unused-variable
const [instructionIndexStrIfExists, lengthStrIfExists, fileIndexStrIfExists, jumpTypeStrIfExists] = entry.split(
':',
);
diff --git a/packages/sol-cov/src/trace.ts b/packages/sol-cov/src/trace.ts
index 1c21c8e5c..c725de3d0 100644
--- a/packages/sol-cov/src/trace.ts
+++ b/packages/sol-cov/src/trace.ts
@@ -1,7 +1,6 @@
import { addressUtils, BigNumber, logUtils } from '@0xproject/utils';
-import { OpCode, StructLog, TransactionTrace } from 'ethereum-types';
-import { addHexPrefix, stripHexPrefix } from 'ethereumjs-util';
-import * as fs from 'fs';
+import { OpCode, StructLog } from 'ethereum-types';
+import { addHexPrefix } from 'ethereumjs-util';
import * as _ from 'lodash';
export interface TraceByContractAddress {