@@ -4,8 +4,9 @@ use libp2p::Multiaddr;
4
4
use node:: {
5
5
event_source:: Event ,
6
6
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 ,
9
10
} ,
10
11
State ,
11
12
} ;
@@ -19,6 +20,22 @@ pub fn match_addr_with_port_and_peer_id(
19
20
peer_id : PeerId ,
20
21
) -> impl Fn ( & P2pConnectionOutgoingInitOpts ) -> bool {
21
22
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,
22
39
P2pConnectionOutgoingInitOpts :: LibP2P ( libp2p_opts) => {
23
40
& libp2p_opts. peer_id == & peer_id && libp2p_opts. port == port
24
41
}
@@ -352,7 +369,11 @@ where
352
369
/// Runs cluster until there is a `quiet_dur` period of no events, returning
353
370
/// `Ok(true)` in this case. If there is no such period for `timeout` period of
354
371
/// 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 > {
356
377
let timeout = Instant :: now ( ) + timeout;
357
378
while driver. run_until ( quiet_dur, |_, _, _| true ) . await ? {
358
379
if Instant :: now ( ) >= timeout {
0 commit comments