Partial SyWeb compatibility
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user