Skip to content

Commit 37954fb

Browse files
committed
fix(hyperliquid): validate state for getLogs, fix annotation
1 parent d479d2e commit 37954fb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

metrics/hyperliquid.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,14 @@ class HTTPGetLogsLatencyMetric(HttpCallLatencyMetricBase):
7575
def method(self) -> str:
7676
return "eth_getLogs"
7777

78+
@staticmethod
79+
def validate_state(state_data: dict) -> bool:
80+
"""Validates that required block number exists in state data."""
81+
return bool(state_data and state_data.get("old_block"))
82+
7883
@staticmethod
7984
def get_params_from_state(state_data: dict) -> list:
80-
"""Get parameters for USDC transfer logs from recent block range."""
85+
"""Get parameters for Wrapped HYPE logs from a recent block range."""
8186
from_block_hex = state_data["old_block"]
8287
from_block_int = int(from_block_hex, 16)
8388
to_block_int: int = max(0, from_block_int + 100)

0 commit comments

Comments
 (0)