Add manifest identifier constant and update Nostr client

This commit is contained in:
thePR0M3TH3AN
2025-07-24 17:23:57 -04:00
parent 39114b0b8a
commit b70585c55e
5 changed files with 35 additions and 18 deletions

View File

@@ -44,7 +44,7 @@ def test_full_sync_roundtrip(dummy_nostr_client):
# Manager A publishes initial snapshot
pm_a.entry_manager.add_entry("site1", 12)
pm_a.sync_vault()
manifest_id = relay.manifests[-1].id
manifest_id = relay.manifests[-1].tags[0]
# Manager B retrieves snapshot
result = pm_b.attempt_initial_sync()

View File

@@ -44,7 +44,7 @@ def test_full_sync_roundtrip(dummy_nostr_client):
# Manager A publishes initial snapshot
pm_a.entry_manager.add_entry("site1", 12)
pm_a.sync_vault()
manifest_id = relay.manifests[-1].id
manifest_id = relay.manifests[-1].tags[0]
# Manager B retrieves snapshot
result = pm_b.attempt_initial_sync()

View File

@@ -54,7 +54,7 @@ def test_publish_and_fetch_deltas(dummy_nostr_client):
client, relay = dummy_nostr_client
base = b"base"
manifest, _ = asyncio.run(client.publish_snapshot(base))
manifest_id = relay.manifests[-1].id
manifest_id = relay.manifests[-1].tags[0]
d1 = b"d1"
d2 = b"d2"
asyncio.run(client.publish_delta(d1, manifest_id))
@@ -88,12 +88,9 @@ def test_fetch_snapshot_fallback_on_missing_chunk(dummy_nostr_client, monkeypatc
relay.filters.clear()
fetched_manifest, chunk_bytes = asyncio.run(client.fetch_latest_snapshot())
result = asyncio.run(client.fetch_latest_snapshot())
assert gzip.decompress(b"".join(chunk_bytes)) == data1
assert [c.event_id for c in fetched_manifest.chunks] == [
c.event_id for c in manifest1.chunks
]
assert result is None
attempts = sum(
1

View File

@@ -84,7 +84,7 @@ def test_publish_snapshot_success():
) as mock_send:
manifest, event_id = asyncio.run(client.publish_snapshot(b"data"))
assert isinstance(manifest, Manifest)
assert event_id == "abcd"
assert event_id == "seedpass-manifest-fp"
assert mock_send.await_count >= 1