MCPcopy Create free account
hub / github.com/argotorg/solidity / format_report

Method format_report

scripts/bytecodecompare/prepare_report.py:75–90  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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)

Calls

no outgoing calls