Fix PeerPool tests.
This commit is contained in:
parent
830f1255c4
commit
a0c547fe32
|
@ -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]())
|
||||||
|
|
Loading…
Reference in New Issue