From 5fe2593287d3532972ab7466dee6be20e4f5cc16 Mon Sep 17 00:00:00 2001 From: kalm Date: Mon, 17 Feb 2025 21:35:50 -0800 Subject: [PATCH] explorer/site: display empty metrics instead of "metrics not available" message This commit updates the explorer UI to show empty metrics when no metrics are available, replacing the previous behavior of displaying a "Gas consumption details are not available" message. --- .../research/blockchain-explorer/site/blueprints/explore.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/research/blockchain-explorer/site/blueprints/explore.py b/script/research/blockchain-explorer/site/blueprints/explore.py index c9348f72e..30d201edf 100644 --- a/script/research/blockchain-explorer/site/blueprints/explore.py +++ b/script/research/blockchain-explorer/site/blueprints/explore.py @@ -50,8 +50,8 @@ async def index(): # Determine if metrics exist has_metrics = metric_stats and isinstance(metric_stats, list) - # Get the latest metric statistics or set to None if none are found - latest_metric_stats = metric_stats[-1] if has_metrics else None + # Get the latest metric statistics or return empty metrics + latest_metric_stats = metric_stats[-1] if has_metrics else [0] * 15 # Retrieve the native contracts native_contracts = await rpc.get_native_contracts()