wake.compiler.build_data_model
module
#
CompilationUnitBuildInfo
class
#
Bases: BuildInfoModel
Holds all compilation errors and warnings that occurred during compilation of a single compilation unit. Some errors and warnings may not be associated with any specific source code location. Because of incremental compilation, it is important to keep track of all errors and warnings that occurred during compilation of a compilation unit with a given hash.
Attributes:
Name | Type | Description |
---|---|---|
errors |
List[SolcOutputError]
|
List of compilation warnings and errors that occurred during compilation of the compilation unit. |
Source code in wake/compiler/build_data_model.py
HexBytes
class
#
Bases: bytes
Workaround for pydantic bytes JSON encode bug
Source code in wake/compiler/build_data_model.py
ProjectBuild
class
#
Class holding a single project build.
Source code in wake/compiler/build_data_model.py
interval_trees: Dict[Path, IntervalTree]
property
#
Returns:
Type | Description |
---|---|
Dict[Path, IntervalTree]
|
Mapping of source file paths to interval trees that can be used to query IR nodes by byte offsets in the source code. |
reference_resolver: ReferenceResolver
property
#
Returns:
Type | Description |
---|---|
ReferenceResolver
|
Reference resolver responsible for resolving AST node IDs to IR nodes. Useful especially for resolving references across different compilation units. |
source_units: Dict[Path, SourceUnit]
property
#
Returns:
Type | Description |
---|---|
Dict[Path, SourceUnit]
|
Mapping of source file paths to top-level SourceUnit IR nodes. |
ProjectBuildInfo
class
#
Bases: BuildInfoModel
Attributes:
Name | Type | Description |
---|---|---|
compilation_units |
Dict[str, CompilationUnitBuildInfo]
|
Mapping of compilation unit hex-encoded hashes to compilation unit build info. |
source_units_info |
Dict[str, SourceUnitInfo]
|
Mapping of source unit names to source unit info. |
allow_paths |
FrozenSet[Path]
|
Compilation allow_paths used during compilation. |
exclude_paths |
FrozenSet[Path]
|
Compilation exclude_paths used during compilation. |
include_paths |
FrozenSet[Path]
|
Compilation include_paths used during compilation. |
settings |
SolcInputSettings
|
solc input settings used during compilation. |
target_solidity_version |
Optional[SolidityVersion]
|
Solidity target_version used during compilation, if any. |
wake_version |
str
|
|
incremental |
bool
|
Whether the compilation was performed in incremental mode. |
Source code in wake/compiler/build_data_model.py
SourceUnitInfo
class
#
Bases: NamedTuple
Attributes:
Name | Type | Description |
---|---|---|
fs_path |
Path
|
Path to the source unit. |
blake2b_hash |
HexBytes
|
256-bit blake2b hash of the source unit contents. |