From d118533d876fdf290af5e0e5a08dd84ff001eee4 Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Thu, 14 Jun 2018 16:53:29 -0700 Subject: Remove redundant check in trace.ts and revert_trace.ts --- packages/sol-cov/src/revert_trace.ts | 3 --- packages/sol-cov/src/trace.ts | 4 +--- 2 files changed, 1 insertion(+), 6 deletions(-) (limited to 'packages') diff --git a/packages/sol-cov/src/revert_trace.ts b/packages/sol-cov/src/revert_trace.ts index 1d52b969e..a78d1afa8 100644 --- a/packages/sol-cov/src/revert_trace.ts +++ b/packages/sol-cov/src/revert_trace.ts @@ -30,9 +30,6 @@ export function getRevertTrace(structLogs: StructLog[], startAddress: string): E structLog.stack[structLog.stack.length - jumpAddressOffset - 1], ); - if (structLog === _.last(normalizedStructLogs)) { - throw new Error('Malformed trace. CALL-like opcode can not be the last one'); - } // Sometimes calls don't change the execution context (current address). When we do a transfer to an // externally owned account - it does the call and immediately returns because there is no fallback // function. We manually check if the call depth had changed to handle that case. diff --git a/packages/sol-cov/src/trace.ts b/packages/sol-cov/src/trace.ts index fad2e5e08..635019fc0 100644 --- a/packages/sol-cov/src/trace.ts +++ b/packages/sol-cov/src/trace.ts @@ -33,9 +33,7 @@ export function getTracesByContractAddress(structLogs: StructLog[], startAddress const newAddress = utils.getAddressFromStackEntry( structLog.stack[structLog.stack.length - jumpAddressOffset - 1], ); - if (structLog === _.last(normalizedStructLogs)) { - throw new Error('Malformed trace. CALL-like opcode can not be the last one'); - } + // Sometimes calls don't change the execution context (current address). When we do a transfer to an // externally owned account - it does the call and immediately returns because there is no fallback // function. We manually check if the call depth had changed to handle that case. -- cgit