Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion timelock/timelock_alerts.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from dataclasses import dataclass

from dotenv import load_dotenv
from eth_utils import to_checksum_address

from utils.cache import cache_filename, get_last_value_for_key_from_file, write_last_value_to_file
from utils.calldata.decoder import format_call_lines
Expand Down Expand Up @@ -132,7 +133,18 @@ def format_delay(seconds: int) -> str:
def load_events(limit: int, since_ts: int, timelocks: list[TimelockConfig] | None = None) -> dict | None:
"""Fetch TimelockEvent events from the Envio GraphQL API."""
source = timelocks if timelocks is not None else TIMELOCK_LIST
addresses = [t.address for t in source]
# Some Envio deployments store timelockAddress checksummed; include both
# representations to avoid case-sensitive misses.
addresses = sorted(
{
addr
for t in source
for addr in (
t.address,
to_checksum_address(t.address),
)
}
)
_logger.info("load_events limit=%s since_ts=%s addresses=%s", limit, since_ts, len(addresses))
query = """
query GetTimelockEvents($limit: Int!, $sinceTs: Int!, $addresses: [String!]!) {
Expand Down
Loading