From 661e8e4d259b0e132e5d74e623f6ec987eae1314 Mon Sep 17 00:00:00 2001 From: Rima <153289003+casks-mutters@users.noreply.github.com> Date: Mon, 17 Nov 2025 04:25:51 -0500 Subject: [PATCH] Improve connect() message and send errors to stderr Mention --rpc and use stderr --- slot_change_finder.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/slot_change_finder.py b/slot_change_finder.py index f7ba47b..412fb5c 100644 --- a/slot_change_finder.py +++ b/slot_change_finder.py @@ -19,9 +19,11 @@ def checksum(addr: str) -> str: def connect(url: str) -> Web3: w3 = Web3(Web3.HTTPProvider(url, request_kwargs={"timeout": 30})) if not w3.is_connected(): - print("❌ Failed to connect to RPC. Check RPC_URL."); sys.exit(1) + print("❌ Failed to connect to RPC. Check RPC_URL or use --rpc.", file=sys.stderr) + sys.exit(1) return w3 + @lru_cache(maxsize=8192) def storage_at(w3_provider_uri: str, address: str, slot: int, block_number: int) -> bytes: # cache key uses provider URI string via decorator arg; w3 constructed per call to avoid unhashable