Partial SyWeb compatibility

This commit is contained in:
2025-10-19 00:07:23 -04:00
parent 647916b749
commit 24133be98c
2 changed files with 128 additions and 34 deletions

View File

@@ -347,3 +347,30 @@ class http_client:
headers=headers,
extensions={"sni_hostname": resolved.sni}
)
def strip_state(l) -> dict:
if not isinstance(l, list):
return l
keys_to_remove = [
"auth_events",
"prev_events",
"signatures",
"hashes",
"depth"
]
new_list = []
for d in l:
if not isinstance(d, dict):
new_list.append(d)
continue
new_dict = {}
for k, v in d.items():
if k in keys_to_remove:
continue
new_dict[k] = strip_state(v)
new_list.append(new_dict)
return new_list