mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2025-09-10 00:09:04 +00:00
Add manifest identifier constant and update Nostr client
This commit is contained in:
@@ -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()
|
||||
|
@@ -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()
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user