Fix PeerPool tests.

This commit is contained in:
cheatfate 2020-11-26 22:50:38 +02:00
parent 830f1255c4
commit a0c547fe32
No known key found for this signature in database
GPG Key ID: 46ADD633A7201F95
1 changed files with 3 additions and 0 deletions

View File

@ -28,6 +28,9 @@ func getFuture(peer: PeerTest): Future[void] =
func `<`(a, b: PeerTest): bool = func `<`(a, b: PeerTest): bool =
`<`(a.weight, b.weight) `<`(a.weight, b.weight)
proc isAlive*(peer: PeerTest): bool =
not(peer.future.finished())
proc init*(t: typedesc[PeerTest], id: string = "", proc init*(t: typedesc[PeerTest], id: string = "",
weight: int = 0): PeerTest = weight: int = 0): PeerTest =
PeerTest(id: id, weight: weight, future: newFuture[void]()) PeerTest(id: id, weight: weight, future: newFuture[void]())