move coverage plugin to separate package and add function to

check if an instruction has previously been covered
pull/989/head
Joran Honig 6 years ago
parent aad81074f7
commit c966152d4c
  1. 1
      mythril/laser/ethereum/plugins/implementations/coverage/__init__.py
  2. 9
      mythril/laser/ethereum/plugins/implementations/coverage/coverage_plugin.py

@ -0,0 +1 @@
from mythril.laser.ethereum.plugins.implementations.coverage.coverage_plugin import InstructionCoveragePlugin

@ -87,3 +87,12 @@ class InstructionCoveragePlugin(LaserPlugin):
for _, cv in self.coverage.items():
total_covered_instructions += sum(cv[1])
return total_covered_instructions
def is_instruction_covered(self, bytecode, index):
if bytecode not in self.coverage.keys():
return False
try:
return self.coverage[bytecode][index]
except IndexError:
return False
Loading…
Cancel
Save