File tree Expand file tree Collapse file tree 2 files changed +15
-10
lines changed Expand file tree Collapse file tree 2 files changed +15
-10
lines changed Original file line number Diff line number Diff line change 1
1
"""
2
2
Truffle platform
3
3
"""
4
- import json
5
4
import logging
6
5
import os
7
6
import shutil
8
7
import subprocess
9
8
from pathlib import Path
10
9
from typing import TYPE_CHECKING , List
11
10
12
- from crytic_compile .compilation_unit import CompilationUnit
13
- from crytic_compile .compiler .compiler import CompilerVersion
14
11
from crytic_compile .platform .abstract_platform import AbstractPlatform
15
- from crytic_compile .platform .exceptions import InvalidCompilation
16
12
from crytic_compile .platform .types import Type
17
- from crytic_compile .utils .naming import convert_filename , extract_name
18
- from crytic_compile .utils .natspec import Natspec
19
13
from .hardhat import hardhat_like_parsing
20
14
21
- from .solc import relative_to_short
22
-
23
15
# Handle cycle
24
16
if TYPE_CHECKING :
25
17
from crytic_compile import CryticCompile
Original file line number Diff line number Diff line change 25
25
26
26
LOGGER = logging .getLogger ("CryticCompile" )
27
27
28
-
28
+ # pylint: disable=too-many-locals
29
29
def hardhat_like_parsing (
30
30
crytic_compile : "CryticCompile" , target : str , build_directory : Path , working_dir : str
31
31
) -> None :
32
+ """
33
+ This function parse the output generated by hardhat.
34
+ It can be re-used by any platform that follows the same schema (ex:foudnry)
35
+
36
+
37
+ Args:
38
+ crytic_compile: CryticCompile object
39
+ target: target
40
+ build_directory: build directory
41
+ working_dir: working directory
42
+
43
+ Returns:
44
+
45
+ """
32
46
files = sorted (
33
47
os .listdir (build_directory ), key = lambda x : os .path .getmtime (Path (build_directory , x ))
34
48
)
@@ -128,7 +142,6 @@ class Hardhat(AbstractPlatform):
128
142
PROJECT_URL = "https://github.com/nomiclabs/hardhat"
129
143
TYPE = Type .HARDHAT
130
144
131
- # pylint: disable=too-many-locals,too-many-statements
132
145
def compile (self , crytic_compile : "CryticCompile" , ** kwargs : str ) -> None :
133
146
"""Run the compilation
134
147
You can’t perform that action at this time.
0 commit comments