Fix client unit test by sending `Hello` in `FakeServer`

Antonio Scandurra created

Change summary

crates/client/src/test.rs | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)

Detailed changes

crates/client/src/test.rs 🔗

@@ -84,9 +84,19 @@ impl FakeServer {
                         let (connection_id, io, incoming) =
                             peer.add_test_connection(server_conn, cx.background());
                         cx.background().spawn(io).detach();
-                        let mut state = state.lock();
-                        state.connection_id = Some(connection_id);
-                        state.incoming = Some(incoming);
+                        {
+                            let mut state = state.lock();
+                            state.connection_id = Some(connection_id);
+                            state.incoming = Some(incoming);
+                        }
+                        peer.send(
+                            connection_id,
+                            proto::Hello {
+                                peer_id: connection_id.0,
+                            },
+                        )
+                        .unwrap();
+
                         Ok(client_conn)
                     })
                 }