File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -100,22 +100,20 @@ def latest():
100100 ).fetchone ()
101101
102102 if not wallet or not blocks or not metrics :
103- raise HTTPException (
104- status_code = 404 , detail = "No metrics available"
105- )
103+ raise HTTPException (status_code = 404 , detail = "No metrics available" )
106104
107105 # Map DB columns to expected API keys
108106 result = {
109107 "f" : float (wallet ["f" ]) if wallet ["f" ] is not None else None ,
110108 "S" : float (blocks ["S" ]) if blocks ["S" ] is not None else None ,
111- "BXS" : float (metrics ["BXS_cum" ]) if metrics ["BXS_cum" ] is not None else None ,
109+ "BXS" : (
110+ float (metrics ["BXS_cum" ]) if metrics ["BXS_cum" ] is not None else None
111+ ),
112112 }
113113
114114 return result
115115 except sqlite3 .OperationalError as e :
116- raise HTTPException (
117- status_code = 500 , detail = f"Database error: { str (e )} "
118- )
116+ raise HTTPException (status_code = 500 , detail = f"Database error: { str (e )} " )
119117 finally :
120118 conn .close ()
121119
@@ -291,7 +289,7 @@ def update_metrics_table(
291289def root ():
292290 """
293291 Return API information with available endpoints.
294-
292+
295293 Always returns JSON (tests expect "endpoints" key).
296294 """
297295 return {
You can’t perform that action at this time.
0 commit comments