aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-trace/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/sol-trace/src')
-rw-r--r--packages/sol-trace/src/index.ts2
-rw-r--r--packages/sol-trace/src/revert_trace_subprovider.ts3
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);