|
|
|
@ -28,7 +28,7 @@ class LaserEVM: |
|
|
|
|
""" |
|
|
|
|
|
|
|
|
|
def __init__(self, accounts, dynamic_loader=None, max_depth=float('inf'), execution_timeout=60, create_timeout=10, |
|
|
|
|
strategy=DepthFirstSearchStrategy): |
|
|
|
|
strategy=DepthFirstSearchStrategy, max_transaction_count=3): |
|
|
|
|
world_state = WorldState() |
|
|
|
|
world_state.accounts = accounts |
|
|
|
|
# this sets the initial world state |
|
|
|
@ -45,6 +45,7 @@ class LaserEVM: |
|
|
|
|
self.work_list = [] |
|
|
|
|
self.strategy = strategy(self.work_list, max_depth) |
|
|
|
|
self.max_depth = max_depth |
|
|
|
|
self.max_transaction_count = max_transaction_count |
|
|
|
|
|
|
|
|
|
self.execution_timeout = execution_timeout |
|
|
|
|
self.create_timeout = create_timeout |
|
|
|
@ -60,7 +61,7 @@ class LaserEVM: |
|
|
|
|
def accounts(self): |
|
|
|
|
return self.world_state.accounts |
|
|
|
|
|
|
|
|
|
def sym_exec(self, main_address=None, creation_code=None, contract_name=None, max_transactions=3): |
|
|
|
|
def sym_exec(self, main_address=None, creation_code=None, contract_name=None): |
|
|
|
|
logging.debug("Starting LASER execution") |
|
|
|
|
self.time = datetime.now() |
|
|
|
|
|
|
|
|
@ -77,7 +78,7 @@ class LaserEVM: |
|
|
|
|
|
|
|
|
|
# Reset code coverage |
|
|
|
|
self.coverage = {} |
|
|
|
|
for i in range(max_transactions): |
|
|
|
|
for i in range(self.max_transaction_count): |
|
|
|
|
initial_coverage = self._get_covered_instructions() |
|
|
|
|
|
|
|
|
|
self.time = datetime.now() |
|
|
|
|