diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2019-01-15 20:33:24 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2019-01-15 20:37:10 +0800 |
commit | 63a63543be74d9e8822b7b111aa46350a5f524d8 (patch) | |
tree | 054119646cd9994351b67552b4402af009d7fb66 /packages/sol-tracing-utils/src/collect_coverage_entries.ts | |
parent | 75a4bbc5f2bf38c2ea8c18f21dc9b54eaf5bb422 (diff) | |
download | dexon-0x-contracts-63a63543be74d9e8822b7b111aa46350a5f524d8.tar.gz dexon-0x-contracts-63a63543be74d9e8822b7b111aa46350a5f524d8.tar.zst dexon-0x-contracts-63a63543be74d9e8822b7b111aa46350a5f524d8.zip |
Make mapping namings direct
Diffstat (limited to 'packages/sol-tracing-utils/src/collect_coverage_entries.ts')
-rw-r--r-- | packages/sol-tracing-utils/src/collect_coverage_entries.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/sol-tracing-utils/src/collect_coverage_entries.ts b/packages/sol-tracing-utils/src/collect_coverage_entries.ts index 3ca794f8e..9e3591d74 100644 --- a/packages/sol-tracing-utils/src/collect_coverage_entries.ts +++ b/packages/sol-tracing-utils/src/collect_coverage_entries.ts @@ -8,19 +8,19 @@ import { getOffsetToLocation } from './source_maps'; const IGNORE_RE = /\/\*\s*solcov\s+ignore\s+next\s*\*\/\s*/gm; // Parsing source code for each transaction/code is slow and therefore we cache it -const coverageEntriesBySourceHash: { [sourceHash: string]: CoverageEntriesDescription } = {}; +const sourceHashToCoverageEntries: { [sourceHash: string]: CoverageEntriesDescription } = {}; export const collectCoverageEntries = (contractSource: string) => { const sourceHash = ethUtil.sha3(contractSource).toString('hex'); - if (_.isUndefined(coverageEntriesBySourceHash[sourceHash]) && !_.isUndefined(contractSource)) { + if (_.isUndefined(sourceHashToCoverageEntries[sourceHash]) && !_.isUndefined(contractSource)) { const ast = parser.parse(contractSource, { range: true }); const offsetToLocation = getOffsetToLocation(contractSource); const ignoreRangesBegingingAt = gatherRangesToIgnore(contractSource); const visitor = new ASTVisitor(offsetToLocation, ignoreRangesBegingingAt); parser.visit(ast, visitor); - coverageEntriesBySourceHash[sourceHash] = visitor.getCollectedCoverageEntries(); + sourceHashToCoverageEntries[sourceHash] = visitor.getCollectedCoverageEntries(); } - const coverageEntriesDescription = coverageEntriesBySourceHash[sourceHash]; + const coverageEntriesDescription = sourceHashToCoverageEntries[sourceHash]; return coverageEntriesDescription; }; |