(self)
| 73 | contract_reports: Optional[List[ContractReport]] |
| 74 | |
| 75 | def format_report(self) -> str: |
| 76 | report = "" |
| 77 | |
| 78 | if self.contract_reports is None: |
| 79 | return f"{self.file_name.as_posix()}: <ERROR>\n" |
| 80 | |
| 81 | for contract_report in self.contract_reports: |
| 82 | bytecode = contract_report.bytecode if contract_report.bytecode is not None else '<NO BYTECODE>' |
| 83 | metadata = contract_report.metadata if contract_report.metadata is not None else '<NO METADATA>' |
| 84 | |
| 85 | # NOTE: Ignoring contract_report.file_name because it should always be either the same |
| 86 | # as self.file_name (for Standard JSON) or just the '<stdin>' placeholder (for CLI). |
| 87 | report += f"{self.file_name.as_posix()}:{contract_report.contract_name} {bytecode}\n" |
| 88 | report += f"{self.file_name.as_posix()}:{contract_report.contract_name} {metadata}\n" |
| 89 | |
| 90 | return report |
| 91 | |
| 92 | def format_summary(self, verbose: bool) -> str: |
| 93 | error = (self.contract_reports is None) |
no outgoing calls