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