add replicate dvms, minor fixes, add otherstuff tests

This commit is contained in:
Believethehype
2024-11-05 19:42:04 +01:00
parent 972785d28d
commit ff327e9117
5 changed files with 960 additions and 6 deletions

View File

@@ -105,9 +105,12 @@ def post_process_list_to_events(result):
if len(result_list) == 0:
return "No results found"
for tag in result_list:
e_tag = Tag.parse(tag)
result_str = result_str + "nostr:" + EventId.from_hex(
e_tag.as_vec()[1]).to_bech32() + "\n"
try:
e_tag = Tag.parse(tag)
id = EventId.from_hex(e_tag.as_vec()[1]).to_bech32()
result_str = result_str + "nostr:" + id + "\n"
except Exception as e:
print(e)
return result_str
@@ -117,9 +120,12 @@ def post_process_list_to_users(result):
if len(result_list) == 0:
return "No results found"
for tag in result_list:
p_tag = Tag.parse(tag)
result_str = result_str + "nostr:" + PublicKey.parse(
p_tag.as_vec()[1]).to_bech32() + "\n"
try:
p_tag = Tag.parse(tag)
key = PublicKey.parse(p_tag.as_vec()[1]).to_bech32()
result_str = result_str + "nostr:" + key + "\n"
except Exception as e:
print(e)
return result_str