@@ -4,8 +4,9 @@ use libp2p::Multiaddr;
44use node:: {
55 event_source:: Event ,
66 p2p:: {
7- connection:: outgoing:: P2pConnectionOutgoingInitOpts , P2pConnectionEvent , P2pEvent ,
8- P2pListenEvent , P2pListenerId , PeerId ,
7+ connection:: outgoing:: P2pConnectionOutgoingInitOpts ,
8+ webrtc:: { Host , HttpSignalingInfo , SignalingMethod } ,
9+ P2pConnectionEvent , P2pEvent , P2pListenEvent , P2pListenerId , PeerId ,
910 } ,
1011 State ,
1112} ;
@@ -19,6 +20,22 @@ pub fn match_addr_with_port_and_peer_id(
1920 peer_id : PeerId ,
2021) -> impl Fn ( & P2pConnectionOutgoingInitOpts ) -> bool {
2122 move |conn_opt| match conn_opt {
23+ P2pConnectionOutgoingInitOpts :: WebRTC {
24+ peer_id : pid,
25+ signaling :
26+ SignalingMethod :: Http ( HttpSignalingInfo {
27+ host : Host :: Ipv4 ( _ip4) ,
28+ port : p,
29+ } ) ,
30+ }
31+ | P2pConnectionOutgoingInitOpts :: WebRTC {
32+ peer_id : pid,
33+ signaling :
34+ SignalingMethod :: Https ( HttpSignalingInfo {
35+ host : Host :: Ipv4 ( _ip4) ,
36+ port : p,
37+ } ) ,
38+ } => & peer_id == pid && port == * p,
2239 P2pConnectionOutgoingInitOpts :: LibP2P ( libp2p_opts) => {
2340 & libp2p_opts. peer_id == & peer_id && libp2p_opts. port == port
2441 }
@@ -352,7 +369,11 @@ where
352369/// Runs cluster until there is a `quiet_dur` period of no events, returning
353370/// `Ok(true)` in this case. If there is no such period for `timeout` period of
354371/// time, then returns `Ok(false)`
355- pub async fn run_until_no_events < ' cluster > ( driver : & mut Driver < ' cluster > , quiet_dur : Duration , timeout : Duration ) -> anyhow:: Result < bool > {
372+ pub async fn run_until_no_events < ' cluster > (
373+ driver : & mut Driver < ' cluster > ,
374+ quiet_dur : Duration ,
375+ timeout : Duration ,
376+ ) -> anyhow:: Result < bool > {
356377 let timeout = Instant :: now ( ) + timeout;
357378 while driver. run_until ( quiet_dur, |_, _, _| true ) . await ? {
358379 if Instant :: now ( ) >= timeout {
0 commit comments