mirror of
https://github.com/waku-org/nwaku.git
synced 2025-02-02 10:07:17 +00:00
49dd6c1989
* Implement peer and connection management tests. * Fix multiple peers added on initialisation. * Remove clusterId parameter from newTestWakuNode.
13 lines
452 B
Nim
13 lines
452 B
Nim
import std/options, stew/results, libp2p/peerstore
|
|
|
|
import
|
|
../../../../waku/node/peer_manager/[waku_peer_store, peer_store/waku_peer_storage],
|
|
../../../waku_archive/archive_utils
|
|
|
|
proc newTestWakuPeerStorage*(path: Option[string] = string.none()): WakuPeerStorage =
|
|
let db = newSqliteDatabase(path)
|
|
WakuPeerStorage.new(db).value()
|
|
|
|
proc peerExists*(peerStore: PeerStore, peerId: PeerId): bool =
|
|
return peerStore[AddressBook].contains(peerId)
|