From a0c547fe32293aa832f87fe226a28760c0d7e397 Mon Sep 17 00:00:00 2001 From: cheatfate Date: Thu, 26 Nov 2020 22:50:38 +0200 Subject: [PATCH] Fix PeerPool tests. --- tests/test_peer_pool.nim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_peer_pool.nim b/tests/test_peer_pool.nim index 3cbe93f01..f2148381a 100644 --- a/tests/test_peer_pool.nim +++ b/tests/test_peer_pool.nim @@ -28,6 +28,9 @@ func getFuture(peer: PeerTest): Future[void] = func `<`(a, b: PeerTest): bool = `<`(a.weight, b.weight) +proc isAlive*(peer: PeerTest): bool = + not(peer.future.finished()) + proc init*(t: typedesc[PeerTest], id: string = "", weight: int = 0): PeerTest = PeerTest(id: id, weight: weight, future: newFuture[void]())