diff --git a/network/test/src/lib.rs b/network/test/src/lib.rs index f8afc4fb0cb4..14463d7a42a2 100644 --- a/network/test/src/lib.rs +++ b/network/test/src/lib.rs @@ -758,13 +758,13 @@ pub trait TestNetFactory: Sized { futures::executor::block_on(futures::future::poll_fn::<(), _>(|cx| self.poll_until_idle(cx))); } - /// Polls the testnet. Processes all the pending actions and returns `NotReady`. + /// Polls the testnet. Processes all the pending actions. fn poll(&mut self, cx: &mut FutureContext) { self.mut_peers(|peers| { for peer in peers { trace!(target: "sync", "-- Polling {}", peer.id()); - if let Poll::Ready(res) = Pin::new(&mut peer.network).poll(cx) { - res.unwrap(); + if let Poll::Ready(()) = peer.network.poll_unpin(cx) { + panic!("NetworkWorker has terminated unexpectedly.") } trace!(target: "sync", "-- Polling complete {}", peer.id());