diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2019-01-14 19:02:32 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2019-01-14 19:04:08 +0800 |
commit | 2581bc93e5893d43642b240d290c141f0d9419bf (patch) | |
tree | 2fa713969c802d0c8c7f6290a789267ca7404d10 /packages/sol-trace | |
parent | 8b62783f4876594ad350175b12a85321e9d1a3fc (diff) | |
download | dexon-0x-contracts-2581bc93e5893d43642b240d290c141f0d9419bf.tar.gz dexon-0x-contracts-2581bc93e5893d43642b240d290c141f0d9419bf.tar.zst dexon-0x-contracts-2581bc93e5893d43642b240d290c141f0d9419bf.zip |
Fix the bug with incorrect source maps parsing by changing contract data from an array to a mapping
Diffstat (limited to 'packages/sol-trace')
-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); |