diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2019-01-15 21:45:02 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-15 21:45:02 +0800 |
commit | 18084588ea9fa724d6e32c9a49c79d49f189ba7c (patch) | |
tree | 7944152430a9687e7e63db4011bacaf2fa3aebe3 /packages/sol-trace | |
parent | 16a2cf7be68605def2824de4f5c22f0154c2e6ad (diff) | |
parent | 64d99dc07cc82c7cc2917871596b46985f1d709f (diff) | |
download | dexon-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-trace')
-rw-r--r-- | packages/sol-trace/src/index.ts | 2 | ||||
-rw-r--r-- | packages/sol-trace/src/revert_trace_subprovider.ts | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/packages/sol-trace/src/index.ts b/packages/sol-trace/src/index.ts index 120c0d0a9..61b5d8cb7 100644 --- a/packages/sol-trace/src/index.ts +++ b/packages/sol-trace/src/index.ts @@ -3,6 +3,8 @@ export { TruffleArtifactAdapter, SolCompilerArtifactAdapter, ContractData, + SourceCodes, + Sources, } from '@0x/sol-tracing-utils'; export { RevertTraceSubprovider } from './revert_trace_subprovider'; diff --git a/packages/sol-trace/src/revert_trace_subprovider.ts b/packages/sol-trace/src/revert_trace_subprovider.ts index 31067a402..fa065cfcb 100644 --- a/packages/sol-trace/src/revert_trace_subprovider.ts +++ b/packages/sol-trace/src/revert_trace_subprovider.ts @@ -106,7 +106,8 @@ export class RevertTraceSubprovider extends TraceCollectionSubprovider { continue; } - const fileIndex = contractData.sources.indexOf(sourceRange.fileName); + const fileNameToFileIndex = _.invert(contractData.sources); + const fileIndex = _.parseInt(fileNameToFileIndex[sourceRange.fileName]); const sourceSnippet = getSourceRangeSnippet(sourceRange, contractData.sourceCodes[fileIndex]); if (sourceSnippet !== null) { sourceSnippets.push(sourceSnippet); |