Skip to content

Commit

Permalink
feat: waku store sync 2.0 protocols & tests (#3216)
Browse files Browse the repository at this point in the history
  • Loading branch information
SionoiS authored Jan 23, 2025
1 parent 54a7a68 commit 6ee494d
Show file tree
Hide file tree
Showing 7 changed files with 1,007 additions and 12 deletions.
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

0 comments on commit 6ee494d

Please sign in to comment.