Skip to content

Commit 16d3a89

Browse files
Split Process contract in two functions
1 parent 27908f7 commit 16d3a89

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Tools/count_contracts.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,7 @@ def use_solc(self, version):
9494
subprocess.run(["solc-select", "use", version])
9595
self.current_version = version
9696

97-
@function_benchmark
98-
def process_contracts(self, file_path):
99-
contract_results = {}
97+
def extract_solidity_version(self, file_path):
10098
version_pattern = re.compile(r"\d+\.\d+\.\d+")
10199
with open(file_path, "r") as file:
102100
lines = file.readlines()
@@ -107,8 +105,12 @@ def process_contracts(self, file_path):
107105
version = version_match.group()
108106
self.use_solc(version)
109107
break
110-
108+
109+
@function_benchmark
110+
def process_contracts(self, file_path):
111+
self.extract_solidity_version(file_path)
111112
slither = Slither(file_path)
113+
contract_results = {}
112114
contracts = slither.contracts
113115
for contract in contracts:
114116
functions = contract.functions

0 commit comments

Comments
 (0)