diff options
Diffstat (limited to 'packages/sol-trace/src/revert_trace_subprovider.ts')
-rw-r--r-- | packages/sol-trace/src/revert_trace_subprovider.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/sol-trace/src/revert_trace_subprovider.ts b/packages/sol-trace/src/revert_trace_subprovider.ts index 31067a402..d36cba08b 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 fileIndexByFileName = _.invert(contractData.sources); + const fileIndex = _.parseInt(fileIndexByFileName[sourceRange.fileName]); const sourceSnippet = getSourceRangeSnippet(sourceRange, contractData.sourceCodes[fileIndex]); if (sourceSnippet !== null) { sourceSnippets.push(sourceSnippet); |