diff options
Diffstat (limited to 'packages/sol-cov/src')
-rw-r--r-- | packages/sol-cov/src/artifact_adapters/sol_compiler_artifact_adapter.ts | 9 | ||||
-rw-r--r-- | packages/sol-cov/src/artifact_adapters/truffle_artifact_adapter.ts | 7 | ||||
-rw-r--r-- | packages/sol-cov/src/index.ts | 23 | ||||
-rw-r--r-- | packages/sol-cov/src/monorepo_scripts/postpublish.ts | 8 | ||||
-rw-r--r-- | packages/sol-cov/src/monorepo_scripts/stage_docs.ts | 8 | ||||
-rw-r--r-- | packages/sol-cov/src/revert_trace.ts | 2 | ||||
-rw-r--r-- | packages/sol-cov/src/trace.ts | 2 | ||||
-rw-r--r-- | packages/sol-cov/src/trace_collection_subprovider.ts | 9 | ||||
-rw-r--r-- | packages/sol-cov/src/trace_collector.ts | 2 | ||||
-rw-r--r-- | packages/sol-cov/src/utils.ts | 2 |
10 files changed, 42 insertions, 30 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 8e03bf7fd..57391abbe 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 @@ -1,5 +1,5 @@ -import { CompilerOptions, ContractArtifact } from '@0xproject/sol-compiler'; -import { logUtils } from '@0xproject/utils'; +import { logUtils } from '@0x/utils'; +import { CompilerOptions, ContractArtifact } from 'ethereum-types'; import * as fs from 'fs'; import * as glob from 'glob'; import * as _ from 'lodash'; @@ -14,6 +14,11 @@ const CONFIG_FILE = 'compiler.json'; export class SolCompilerArtifactAdapter extends AbstractArtifactAdapter { private readonly _artifactsPath: string; private readonly _sourcesPath: string; + /** + * Instantiates a SolCompilerArtifactAdapter + * @param artifactsPath Path to your artifacts directory + * @param sourcesPath Path to your contract sources directory + */ 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 2706435cc..f064911d3 100644 --- a/packages/sol-cov/src/artifact_adapters/truffle_artifact_adapter.ts +++ b/packages/sol-cov/src/artifact_adapters/truffle_artifact_adapter.ts @@ -1,4 +1,4 @@ -import { Compiler, CompilerOptions } from '@0xproject/sol-compiler'; +import { Compiler, CompilerOptions } from '@0x/sol-compiler'; import * as fs from 'fs'; import * as glob from 'glob'; import * as path from 'path'; @@ -18,6 +18,11 @@ interface TruffleConfig { export class TruffleArtifactAdapter extends AbstractArtifactAdapter { private readonly _solcVersion: string; private readonly _projectRoot: string; + /** + * Instantiates a TruffleArtifactAdapter + * @param projectRoot Path to the truffle project's root directory + * @param solcVersion Solidity version with which to compile all the contracts + */ constructor(projectRoot: string, solcVersion: string) { super(); this._solcVersion = solcVersion; diff --git a/packages/sol-cov/src/index.ts b/packages/sol-cov/src/index.ts index 003a27374..348e0fc9b 100644 --- a/packages/sol-cov/src/index.ts +++ b/packages/sol-cov/src/index.ts @@ -1,8 +1,25 @@ export { CoverageSubprovider } from './coverage_subprovider'; -// HACK: ProfilerSubprovider is a hacky way to do profiling using coverage tools. Not production ready -export { ProfilerSubprovider } from './profiler_subprovider'; -export { RevertTraceSubprovider } from './revert_trace_subprovider'; export { SolCompilerArtifactAdapter } from './artifact_adapters/sol_compiler_artifact_adapter'; export { TruffleArtifactAdapter } from './artifact_adapters/truffle_artifact_adapter'; export { AbstractArtifactAdapter } from './artifact_adapters/abstract_artifact_adapter'; + +// HACK: ProfilerSubprovider is a hacky way to do profiling using coverage tools. Not production ready +export { ProfilerSubprovider } from './profiler_subprovider'; +export { RevertTraceSubprovider } from './revert_trace_subprovider'; + export { ContractData } from './types'; +export { + JSONRPCRequestPayload, + Provider, + JSONRPCErrorCallback, + JSONRPCResponsePayload, + JSONRPCResponseError, +} from 'ethereum-types'; + +export { + JSONRPCRequestPayloadWithMethod, + NextCallback, + ErrorCallback, + OnNextCompleted, + Callback, +} from '@0x/subproviders'; diff --git a/packages/sol-cov/src/monorepo_scripts/postpublish.ts b/packages/sol-cov/src/monorepo_scripts/postpublish.ts deleted file mode 100644 index dcb99d0f7..000000000 --- a/packages/sol-cov/src/monorepo_scripts/postpublish.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { postpublishUtils } from '@0xproject/monorepo-scripts'; - -import * as packageJSON from '../package.json'; -import * as tsConfigJSON from '../tsconfig.json'; - -const cwd = `${__dirname}/..`; -// tslint:disable-next-line:no-floating-promises -postpublishUtils.runAsync(packageJSON, tsConfigJSON, cwd); diff --git a/packages/sol-cov/src/monorepo_scripts/stage_docs.ts b/packages/sol-cov/src/monorepo_scripts/stage_docs.ts deleted file mode 100644 index e732ac8eb..000000000 --- a/packages/sol-cov/src/monorepo_scripts/stage_docs.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { postpublishUtils } from '@0xproject/monorepo-scripts'; - -import * as packageJSON from '../package.json'; -import * as tsConfigJSON from '../tsconfig.json'; - -const cwd = `${__dirname}/..`; -// tslint:disable-next-line:no-floating-promises -postpublishUtils.publishDocsToStagingAsync(packageJSON, tsConfigJSON, cwd); diff --git a/packages/sol-cov/src/revert_trace.ts b/packages/sol-cov/src/revert_trace.ts index a78d1afa8..d60c6e7d9 100644 --- a/packages/sol-cov/src/revert_trace.ts +++ b/packages/sol-cov/src/revert_trace.ts @@ -1,4 +1,4 @@ -import { logUtils } from '@0xproject/utils'; +import { logUtils } from '@0x/utils'; import { OpCode, StructLog } from 'ethereum-types'; import * as _ from 'lodash'; diff --git a/packages/sol-cov/src/trace.ts b/packages/sol-cov/src/trace.ts index 635019fc0..b38dbdce0 100644 --- a/packages/sol-cov/src/trace.ts +++ b/packages/sol-cov/src/trace.ts @@ -1,4 +1,4 @@ -import { logUtils } from '@0xproject/utils'; +import { logUtils } from '@0x/utils'; import { OpCode, StructLog } from 'ethereum-types'; import * as _ from 'lodash'; diff --git a/packages/sol-cov/src/trace_collection_subprovider.ts b/packages/sol-cov/src/trace_collection_subprovider.ts index b6486e6f7..25e38768d 100644 --- a/packages/sol-cov/src/trace_collection_subprovider.ts +++ b/packages/sol-cov/src/trace_collection_subprovider.ts @@ -1,6 +1,6 @@ -import { BlockchainLifecycle } from '@0xproject/dev-utils'; -import { Callback, ErrorCallback, NextCallback, Subprovider } from '@0xproject/subproviders'; -import { CallDataRPC, marshaller, Web3Wrapper } from '@0xproject/web3-wrapper'; +import { BlockchainLifecycle } from '@0x/dev-utils'; +import { Callback, ErrorCallback, NextCallback, Subprovider } from '@0x/subproviders'; +import { CallDataRPC, marshaller, Web3Wrapper } from '@0x/web3-wrapper'; import { JSONRPCRequestPayload, Provider, TxData } from 'ethereum-types'; import * as _ from 'lodash'; import { Lock } from 'semaphore-async-await'; @@ -63,7 +63,7 @@ export abstract class TraceCollectionSubprovider extends Subprovider { * turn to handle a JSON RPC request. * @param payload JSON RPC payload * @param next Callback to call if this subprovider decides not to handle the request - * @param end Callback to call if subprovider handled the request and wants to pass back the request. + * @param _end Callback to call if subprovider handled the request and wants to pass back the request. */ // tslint:disable-next-line:prefer-function-over-method async-suffix public async handleRequest(payload: JSONRPCRequestPayload, next: NextCallback, _end: ErrorCallback): Promise<void> { @@ -109,6 +109,7 @@ export abstract class TraceCollectionSubprovider extends Subprovider { * Set's the subprovider's engine to the ProviderEngine it is added to. * This is only called within the ProviderEngine source code, do not call * directly. + * @param engine The ProviderEngine this subprovider is added to */ public setEngine(engine: Provider): void { super.setEngine(engine); diff --git a/packages/sol-cov/src/trace_collector.ts b/packages/sol-cov/src/trace_collector.ts index 3e2ae3516..44cffc238 100644 --- a/packages/sol-cov/src/trace_collector.ts +++ b/packages/sol-cov/src/trace_collector.ts @@ -1,4 +1,4 @@ -import { promisify } from '@0xproject/utils'; +import { promisify } from '@0x/utils'; import { stripHexPrefix } from 'ethereumjs-util'; import * as fs from 'fs'; import { Collector } from 'istanbul'; diff --git a/packages/sol-cov/src/utils.ts b/packages/sol-cov/src/utils.ts index b696bd463..d8bc65e73 100644 --- a/packages/sol-cov/src/utils.ts +++ b/packages/sol-cov/src/utils.ts @@ -1,4 +1,4 @@ -import { addressUtils, BigNumber } from '@0xproject/utils'; +import { addressUtils, BigNumber } from '@0x/utils'; import { OpCode, StructLog } from 'ethereum-types'; import { addHexPrefix } from 'ethereumjs-util'; import * as _ from 'lodash'; |