diff options
author | Alex Browne <stephenalexbrowne@gmail.com> | 2018-06-15 07:33:09 +0800 |
---|---|---|
committer | Alex Browne <stephenalexbrowne@gmail.com> | 2018-06-15 07:33:09 +0800 |
commit | 897560745a7e528691e03ecfa99ca25da26135ba (patch) | |
tree | eaa66cd45ebd01efe101cd99ec9a9b0f2179a290 /packages/sol-cov/src/profiler_subprovider.ts | |
parent | 5a8539a1228baeb085ed7851245337f27ee1d974 (diff) | |
download | dexon-sol-tools-897560745a7e528691e03ecfa99ca25da26135ba.tar dexon-sol-tools-897560745a7e528691e03ecfa99ca25da26135ba.tar.gz dexon-sol-tools-897560745a7e528691e03ecfa99ca25da26135ba.tar.bz2 dexon-sol-tools-897560745a7e528691e03ecfa99ca25da26135ba.tar.lz dexon-sol-tools-897560745a7e528691e03ecfa99ca25da26135ba.tar.xz dexon-sol-tools-897560745a7e528691e03ecfa99ca25da26135ba.tar.zst dexon-sol-tools-897560745a7e528691e03ecfa99ca25da26135ba.zip |
De-duplicate code by refactoring subprovider classes
Diffstat (limited to 'packages/sol-cov/src/profiler_subprovider.ts')
-rw-r--r-- | packages/sol-cov/src/profiler_subprovider.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/sol-cov/src/profiler_subprovider.ts b/packages/sol-cov/src/profiler_subprovider.ts index 62ed1b472..9f98da524 100644 --- a/packages/sol-cov/src/profiler_subprovider.ts +++ b/packages/sol-cov/src/profiler_subprovider.ts @@ -2,8 +2,8 @@ import * as _ from 'lodash'; import { AbstractArtifactAdapter } from './artifact_adapters/abstract_artifact_adapter'; import { collectCoverageEntries } from './collect_coverage_entries'; -import { TraceCollectionSubprovider } from './trace_collection_subprovider'; import { SingleFileSubtraceHandler, TraceCollector } from './trace_collector'; +import { TraceInfoSubprovider } from './trace_info_subprovider'; import { ContractData, Coverage, SourceRange, Subtrace, TraceInfo } from './types'; import { utils } from './utils'; @@ -11,7 +11,7 @@ import { utils } from './utils'; * This class implements the [web3-provider-engine](https://github.com/MetaMask/provider-engine) subprovider interface. * ProfilerSubprovider is used to profile Solidity code while running tests. */ -export class ProfilerSubprovider extends TraceCollectionSubprovider { +export class ProfilerSubprovider extends TraceInfoSubprovider { private _profilerCollector: TraceCollector; /** * Instantiates a ProfilerSubprovider instance @@ -28,7 +28,7 @@ export class ProfilerSubprovider extends TraceCollectionSubprovider { super(defaultFromAddress, traceCollectionSubproviderConfig); this._profilerCollector = new TraceCollector(artifactAdapter, isVerbose, profilerHandler); } - public async handleTraceInfoAsync(traceInfo: TraceInfo): Promise<void> { + protected async _handleTraceInfoAsync(traceInfo: TraceInfo): Promise<void> { await this._profilerCollector.computeSingleTraceCoverageAsync(traceInfo); } /** |