Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: waku store sync 2.0 protocols & tests #3216

Merged
merged 5 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions tests/waku_store_sync/sync_utils.nim
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import std/[options, random], chronos, chronicles

import waku/[node/peer_manager, waku_core, waku_store_sync/common], ../testlib/wakucore
import
waku/[
node/peer_manager,
waku_core,
waku_store_sync/common,
waku_store_sync/reconciliation,
waku_store_sync/transfer,
],
../testlib/wakucore

randomize()

Expand All @@ -12,7 +20,7 @@ proc randomHash*(rng: var Rand): WakuMessageHash =

return hash

#[ proc newTestWakuRecon*(
proc newTestWakuRecon*(
switch: Switch,
idsRx: AsyncQueue[SyncID],
wantsTx: AsyncQueue[(PeerId, Fingerprint)],
Expand All @@ -25,18 +33,18 @@ proc randomHash*(rng: var Rand): WakuMessageHash =
wakuArchive = nil,
relayJitter = 0.seconds,
idsRx = idsRx,
wantsTx = wantsTx,
needsTx = needsTx,
localWantsTx = wantsTx,
remoteNeedsTx = needsTx,
)

let proto = res.get()

proto.start()
switch.mount(proto)

return proto ]#
return proto

#[ proc newTestWakuTransfer*(
proc newTestWakuTransfer*(
switch: Switch,
idsTx: AsyncQueue[SyncID],
wantsRx: AsyncQueue[(PeerId, Fingerprint)],
Expand All @@ -48,11 +56,11 @@ proc randomHash*(rng: var Rand): WakuMessageHash =
peerManager = peerManager,
wakuArchive = nil,
idsTx = idsTx,
wantsRx = wantsRx,
needsRx = needsRx,
localWantsRx = wantsRx,
remoteNeedsRx = needsRx,
)

proto.start()
switch.mount(proto)

return proto ]#
return proto
Loading
Loading