MCPcopy Create free account
hub / github.com/ceramicnetwork/rust-ceramic / wait_connected

Function wait_connected

p2p/tests/node.rs:232–241  ·  view source on GitHub ↗

Waits until a emits event that it is connected to b and b emits an event that it is connected to a.

(a: &mut TestRunner, b: &mut TestRunner)

Source from the content-addressed store, hash-verified

230// Waits until a emits event that it is connected to b
231// and b emits an event that it is connected to a.
232async fn wait_connected(a: &mut TestRunner, b: &mut TestRunner) {
233 while let Some(event) = a.network_events.recv().await {
234 match event {
235 NetworkEvent::PeerConnected(id) if id == b.peer_id => {
236 break;
237 }
238 _ => {}
239 }
240 }
241}
242
243#[test(tokio::test)]
244async fn test_cancel_listen_for_identify() -> Result<()> {

Callers 1

wait_bi_connectedFunction · 0.85

Calls 1

recvMethod · 0.80

Tested by

no test coverage detected