|
|
|
@ -18,6 +18,7 @@ from slither.core.declarations import ( |
|
|
|
|
Structure, |
|
|
|
|
Pragma, |
|
|
|
|
FunctionContract, |
|
|
|
|
CustomError, |
|
|
|
|
) |
|
|
|
|
from slither.core.source_mapping.source_mapping import SourceMapping |
|
|
|
|
from slither.core.variables.local_variable import LocalVariable |
|
|
|
@ -438,6 +439,8 @@ class Output: |
|
|
|
|
self.add_event(add, additional_fields=additional_fields) |
|
|
|
|
elif isinstance(add, Structure): |
|
|
|
|
self.add_struct(add, additional_fields=additional_fields) |
|
|
|
|
elif isinstance(add, CustomError): |
|
|
|
|
self.add_custom_error(add, additional_fields=additional_fields) |
|
|
|
|
elif isinstance(add, Pragma): |
|
|
|
|
self.add_pragma(add, additional_fields=additional_fields) |
|
|
|
|
elif isinstance(add, Node): |
|
|
|
@ -585,6 +588,32 @@ class Output: |
|
|
|
|
|
|
|
|
|
self._data["elements"].append(element) |
|
|
|
|
|
|
|
|
|
# endregion |
|
|
|
|
################################################################################### |
|
|
|
|
################################################################################### |
|
|
|
|
# region CustomError |
|
|
|
|
################################################################################### |
|
|
|
|
################################################################################### |
|
|
|
|
|
|
|
|
|
def add_custom_error( |
|
|
|
|
self, custom_error: CustomError, additional_fields: Optional[Dict] = None |
|
|
|
|
) -> None: |
|
|
|
|
if additional_fields is None: |
|
|
|
|
additional_fields = {} |
|
|
|
|
type_specific_fields = { |
|
|
|
|
"parent": _create_parent_element(custom_error), |
|
|
|
|
"signature": custom_error.full_name, |
|
|
|
|
} |
|
|
|
|
element = _create_base_element( |
|
|
|
|
"custom_error", |
|
|
|
|
custom_error.name, |
|
|
|
|
custom_error.source_mapping.to_json(), |
|
|
|
|
type_specific_fields, |
|
|
|
|
additional_fields, |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
self._data["elements"].append(element) |
|
|
|
|
|
|
|
|
|
# endregion |
|
|
|
|
################################################################################### |
|
|
|
|
################################################################################### |
|
|
|
|