aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-profiler
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2019-01-15 21:45:02 +0800
committerGitHub <noreply@github.com>2019-01-15 21:45:02 +0800
commit18084588ea9fa724d6e32c9a49c79d49f189ba7c (patch)
tree7944152430a9687e7e63db4011bacaf2fa3aebe3 /packages/sol-profiler
parent16a2cf7be68605def2824de4f5c22f0154c2e6ad (diff)
parent64d99dc07cc82c7cc2917871596b46985f1d709f (diff)
downloaddexon-sol-tools-18084588ea9fa724d6e32c9a49c79d49f189ba7c.tar
dexon-sol-tools-18084588ea9fa724d6e32c9a49c79d49f189ba7c.tar.gz
dexon-sol-tools-18084588ea9fa724d6e32c9a49c79d49f189ba7c.tar.bz2
dexon-sol-tools-18084588ea9fa724d6e32c9a49c79d49f189ba7c.tar.lz
dexon-sol-tools-18084588ea9fa724d6e32c9a49c79d49f189ba7c.tar.xz
dexon-sol-tools-18084588ea9fa724d6e32c9a49c79d49f189ba7c.tar.zst
dexon-sol-tools-18084588ea9fa724d6e32c9a49c79d49f189ba7c.zip
Merge pull request #1498 from 0xProject/fix/sol-cov
Sol tracing fixes
Diffstat (limited to 'packages/sol-profiler')
-rw-r--r--packages/sol-profiler/src/index.ts2
-rw-r--r--packages/sol-profiler/src/profiler_subprovider.ts6
2 files changed, 5 insertions, 3 deletions
diff --git a/packages/sol-profiler/src/index.ts b/packages/sol-profiler/src/index.ts
index 5d4806be4..fcb715d2d 100644
--- a/packages/sol-profiler/src/index.ts
+++ b/packages/sol-profiler/src/index.ts
@@ -3,6 +3,8 @@ export {
SolCompilerArtifactAdapter,
TruffleArtifactAdapter,
ContractData,
+ SourceCodes,
+ Sources,
} from '@0x/sol-tracing-utils';
// HACK: ProfilerSubprovider is a hacky way to do profiling using coverage tools. Not production ready
diff --git a/packages/sol-profiler/src/profiler_subprovider.ts b/packages/sol-profiler/src/profiler_subprovider.ts
index c3ed13ea5..9f195f768 100644
--- a/packages/sol-profiler/src/profiler_subprovider.ts
+++ b/packages/sol-profiler/src/profiler_subprovider.ts
@@ -63,7 +63,7 @@ export const profilerHandler: SingleFileSubtraceHandler = (
): Coverage => {
const absoluteFileName = contractData.sources[fileIndex];
const profilerEntriesDescription = collectCoverageEntries(contractData.sourceCodes[fileIndex]);
- const gasConsumedByStatement: { [statementId: string]: number } = {};
+ const statementToGasConsumed: { [statementId: string]: number } = {};
const statementIds = _.keys(profilerEntriesDescription.statementMap);
for (const statementId of statementIds) {
const statementDescription = profilerEntriesDescription.statementMap[statementId];
@@ -83,14 +83,14 @@ export const profilerHandler: SingleFileSubtraceHandler = (
}
}),
);
- gasConsumedByStatement[statementId] = totalGasCost;
+ statementToGasConsumed[statementId] = totalGasCost;
}
const partialProfilerOutput = {
[absoluteFileName]: {
...profilerEntriesDescription,
path: absoluteFileName,
f: {}, // I's meaningless in profiling context
- s: gasConsumedByStatement,
+ s: statementToGasConsumed,
b: {}, // I's meaningless in profiling context
},
};