@@ -84,9 +84,9 @@ async fn substream_accepted() {
84
84
// connect peer and verify it's in closed state
85
85
notif. next_event ( ) . await ;
86
86
87
- match notif. peers . get ( & peer) . unwrap ( ) . state {
87
+ match & notif. peers . get ( & peer) . unwrap ( ) . state {
88
88
PeerState :: Closed { .. } => { }
89
- _ => panic ! ( "invalid state for peer" ) ,
89
+ state => panic ! ( "invalid state for peer: {state:?} " ) ,
90
90
}
91
91
92
92
// open inbound substream and verify that peer state has changed to `Validating`
@@ -182,9 +182,9 @@ async fn substream_rejected() {
182
182
// connect peer and verify it's in closed state
183
183
notif. on_connection_established ( peer) . await . unwrap ( ) ;
184
184
185
- match notif. peers . get ( & peer) . unwrap ( ) . state {
185
+ match & notif. peers . get ( & peer) . unwrap ( ) . state {
186
186
PeerState :: Closed { .. } => { }
187
- _ => panic ! ( "invalid state for peer" ) ,
187
+ state => panic ! ( "invalid state for peer: {state:?} " ) ,
188
188
}
189
189
190
190
// open inbound substream and verify that peer state has changed to `Validating`
@@ -271,9 +271,9 @@ async fn accept_fails_due_to_closed_substream() {
271
271
// connect peer and verify it's in closed state
272
272
notif. next_event ( ) . await ;
273
273
274
- match notif. peers . get ( & peer) . unwrap ( ) . state {
274
+ match & notif. peers . get ( & peer) . unwrap ( ) . state {
275
275
PeerState :: Closed { .. } => { }
276
- _ => panic ! ( "invalid state for peer" ) ,
276
+ state => panic ! ( "invalid state for peer: {state:?} " ) ,
277
277
}
278
278
279
279
// open inbound substream and verify that peer state has changed to `InboundOpen`
@@ -329,7 +329,10 @@ async fn accept_fails_due_to_closed_substream() {
329
329
}
330
330
notif. on_handshake_event ( peer, event) . await ;
331
331
332
- // TODO: https://github.com/paritytech/litep2p/issues/340 check state
332
+ match & notif. peers . get ( & peer) . unwrap ( ) . state {
333
+ PeerState :: Closed { .. } => { }
334
+ state => panic ! ( "invalid state for peer: {state:?}" ) ,
335
+ }
333
336
}
334
337
335
338
#[ tokio:: test]
0 commit comments