aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-cov/src
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-05-23 07:29:10 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-05-23 07:29:10 +0800
commit8c7f0902c044b671ca66c004d9c29e018bcdb20e (patch)
tree6c57f2cef0d49c1b151724234e035c7e3e68ed7d /packages/sol-cov/src
parentf7560036b8697ce9797b00c67f8310017625e393 (diff)
downloaddexon-sol-tools-8c7f0902c044b671ca66c004d9c29e018bcdb20e.tar
dexon-sol-tools-8c7f0902c044b671ca66c004d9c29e018bcdb20e.tar.gz
dexon-sol-tools-8c7f0902c044b671ca66c004d9c29e018bcdb20e.tar.bz2
dexon-sol-tools-8c7f0902c044b671ca66c004d9c29e018bcdb20e.tar.lz
dexon-sol-tools-8c7f0902c044b671ca66c004d9c29e018bcdb20e.tar.xz
dexon-sol-tools-8c7f0902c044b671ca66c004d9c29e018bcdb20e.tar.zst
dexon-sol-tools-8c7f0902c044b671ca66c004d9c29e018bcdb20e.zip
Add a more verbose comment for self-destruct
Diffstat (limited to 'packages/sol-cov/src')
-rw-r--r--packages/sol-cov/src/trace.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/sol-cov/src/trace.ts b/packages/sol-cov/src/trace.ts
index 28fc7d004..4d106e355 100644
--- a/packages/sol-cov/src/trace.ts
+++ b/packages/sol-cov/src/trace.ts
@@ -54,7 +54,11 @@ export function getTracesByContractAddress(structLogs: StructLog[], startAddress
);
currentTraceSegment = [];
if (structLog.op === OpCode.SelfDestruct) {
- // TODO: Record contract bytecode before the selfdestruct and handle that scenario
+ // After contract execution, we look at all sub-calls to external contracts, and for each one, fetch
+ // the bytecode and compute the coverage for the call. If the contract is destroyed with a call
+ // to `selfdestruct`, we are unable to fetch it's bytecode and compute coverage.
+ // TODO: Refactor this logic to fetch the sub-called contract bytecode before the selfdestruct is called
+ // in order to handle this edge-case.
logUtils.warn(
"Detected a selfdestruct. Sol-cov currently doesn't support that scenario. We'll just skip the trace part for a destructed contract",
);