diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2019-01-17 22:53:17 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-17 22:53:17 +0800 |
commit | 0b23aaca2619b888dd4e15774d5c543f79f4588d (patch) | |
tree | 702418b680712fc7dfd949715f955e1fa7bc5dd7 /packages/sol-trace/src/revert_trace_subprovider.ts | |
parent | beaf0a4a8a1cd6800ac009bce4fed38ff3828f2a (diff) | |
parent | 8b69d918a968237571729725d3238529c0b7a7b2 (diff) | |
download | dexon-sol-tools-0b23aaca2619b888dd4e15774d5c543f79f4588d.tar dexon-sol-tools-0b23aaca2619b888dd4e15774d5c543f79f4588d.tar.gz dexon-sol-tools-0b23aaca2619b888dd4e15774d5c543f79f4588d.tar.bz2 dexon-sol-tools-0b23aaca2619b888dd4e15774d5c543f79f4588d.tar.lz dexon-sol-tools-0b23aaca2619b888dd4e15774d5c543f79f4588d.tar.xz dexon-sol-tools-0b23aaca2619b888dd4e15774d5c543f79f4588d.tar.zst dexon-sol-tools-0b23aaca2619b888dd4e15774d5c543f79f4588d.zip |
Merge pull request #1521 from 0xProject/feature/dev-tools-pre-release-fixes
0x Dev tools pre-release fixes
Diffstat (limited to 'packages/sol-trace/src/revert_trace_subprovider.ts')
-rw-r--r-- | packages/sol-trace/src/revert_trace_subprovider.ts | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/packages/sol-trace/src/revert_trace_subprovider.ts b/packages/sol-trace/src/revert_trace_subprovider.ts index fa065cfcb..046dad812 100644 --- a/packages/sol-trace/src/revert_trace_subprovider.ts +++ b/packages/sol-trace/src/revert_trace_subprovider.ts @@ -109,9 +109,7 @@ export class RevertTraceSubprovider extends TraceCollectionSubprovider { const fileNameToFileIndex = _.invert(contractData.sources); const fileIndex = _.parseInt(fileNameToFileIndex[sourceRange.fileName]); const sourceSnippet = getSourceRangeSnippet(sourceRange, contractData.sourceCodes[fileIndex]); - if (sourceSnippet !== null) { - sourceSnippets.push(sourceSnippet); - } + sourceSnippets.push(sourceSnippet); } const filteredSnippets = filterSnippets(sourceSnippets); if (filteredSnippets.length > 0) { @@ -135,9 +133,7 @@ function filterSnippets(sourceSnippets: SourceSnippet[]): SourceSnippet[] { const results: SourceSnippet[] = [sourceSnippets[0]]; let prev = sourceSnippets[0]; for (const sourceSnippet of sourceSnippets) { - if (sourceSnippet.type === 'IfStatement') { - continue; - } else if (sourceSnippet.source === prev.source) { + if (sourceSnippet.source === prev.source) { prev = sourceSnippet; continue; } @@ -157,12 +153,5 @@ function getStackTraceString(sourceSnippet: SourceSnippet): string { } function getSourceSnippetString(sourceSnippet: SourceSnippet): string { - switch (sourceSnippet.type) { - case 'ContractDefinition': - return `contract ${sourceSnippet.name}`; - case 'FunctionDefinition': - return `function ${sourceSnippet.name}`; - default: - return `${sourceSnippet.source}`; - } + return `${sourceSnippet.source}`; } |