Skip to content

Commit c535b38

Browse files
committed
Add comment
1 parent a174f19 commit c535b38

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

async_substrate_interface/async_substrate.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2382,6 +2382,7 @@ async def _make_rpc_request(
23822382
for payload in payloads:
23832383
item_id = await ws.send(payload["payload"])
23842384
request_manager.add_request(item_id, payload["id"])
2385+
# truncate to 2000 chars for debug logging
23852386
if len(stringified_payload := str(payload)) < 2_000:
23862387
output_payload = stringified_payload
23872388
else:
@@ -2429,6 +2430,7 @@ async def _make_rpc_request(
24292430
request_manager.add_response(
24302431
item_id, decoded_response, complete
24312432
)
2433+
# truncate to 2000 chars for debug logging
24322434
if (
24332435
len(stringified_response := str(decoded_response))
24342436
< 2_000

async_substrate_interface/sync_substrate.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1904,6 +1904,7 @@ def _make_rpc_request(
19041904
raw_websocket_logger.debug(f"WEBSOCKET_SEND> {to_send}")
19051905
ws.send(to_send)
19061906
request_manager.add_request(item_id, payload["id"])
1907+
# truncate to 2000 chars for debug logging
19071908
if len(stringified_payload := str(payload)) < 2_000:
19081909
output_payload = stringified_payload
19091910
else:
@@ -1972,6 +1973,7 @@ def _make_rpc_request(
19721973
request_manager.add_response(
19731974
item_id, decoded_response, complete
19741975
)
1976+
# truncate to 2000 chars for debug logging
19751977
if len(stringified_response := str(decoded_response)) < 2_000:
19761978
output_response = stringified_response
19771979
# avoids clogging logs up needlessly (esp for Metadata stuff)

0 commit comments

Comments
 (0)