aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-cov/src/trace.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-05-23 04:44:48 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-05-23 06:27:17 +0800
commit9740199870d83dc999079883754ec512c1ff544b (patch)
tree0b46e10e53924f385d12e1e03684ab7e4c7ee43f /packages/sol-cov/src/trace.ts
parent06be580d2cbe7e3543d8c4deeb4d1c22b325e6a7 (diff)
downloaddexon-sol-tools-9740199870d83dc999079883754ec512c1ff544b.tar
dexon-sol-tools-9740199870d83dc999079883754ec512c1ff544b.tar.gz
dexon-sol-tools-9740199870d83dc999079883754ec512c1ff544b.tar.bz2
dexon-sol-tools-9740199870d83dc999079883754ec512c1ff544b.tar.lz
dexon-sol-tools-9740199870d83dc999079883754ec512c1ff544b.tar.xz
dexon-sol-tools-9740199870d83dc999079883754ec512c1ff544b.tar.zst
dexon-sol-tools-9740199870d83dc999079883754ec512c1ff544b.zip
Fix sol-cov tests
Diffstat (limited to 'packages/sol-cov/src/trace.ts')
-rw-r--r--packages/sol-cov/src/trace.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/sol-cov/src/trace.ts b/packages/sol-cov/src/trace.ts
index feebaaab5..389bd8309 100644
--- a/packages/sol-cov/src/trace.ts
+++ b/packages/sol-cov/src/trace.ts
@@ -27,7 +27,9 @@ export function getTracesByContractAddress(structLogs: StructLog[], startAddress
const currentAddress = _.last(callStack) as string;
const jumpAddressOffset = structLog.op === OpCode.DelegateCall ? 4 : 2;
const newAddress = addressUtils.padZeros(
- new BigNumber(addHexPrefix(structLog.stack[structLog.stack.length - jumpAddressOffset])).toString(16),
+ new BigNumber(addHexPrefix(structLog.stack[structLog.stack.length - jumpAddressOffset - 1])).toString(
+ 16,
+ ),
);
if (structLog === _.last(structLogs)) {
throw new Error('CALL-like opcode can not be the last one');