aleph-im / aleph-client

Lightweight Python Client library for the Aleph.im network
MIT License
11 stars 12 forks source link

fix(node): add missing return type annotation #221

Closed Psycojoker closed 3 weeks ago

Psycojoker commented 3 weeks ago
github-actions[bot] commented 3 weeks ago

The PR introduces minor changes in the _format_score function, modifying the function signature and its return type. The changes are localized and unlikely to have a significant impact on the rest of the codebase. The changes in the _show_compute function are also minor, affecting only the formatting of node rewards. These modifications are simple enough to be categorized as 'BLUE'.

-def _format_score(score: float):
+def _format_score(score: float) -> text.Text:
     if score < 0.5:
         return text.Text(f"{score:.2%}", style="red", justify="right")
     elif score < 0.75:
         creation_time = datetime.datetime.fromtimestamp(node["time"]).strftime("%Y-%m-%d %H:%M:%S")
-        score = _format_score(node["score"])
+        score = _format_score(node["score"]).plain
         node_name = _escape_and_normalize(node_name)
         node_name = _remove_ansi_escape(node_name)
         node_hash = node["hash"]