diff --git a/pallas-crypto/src/key/ed25519.rs b/pallas-crypto/src/key/ed25519.rs index e40d2fd..2af0e83 100644 --- a/pallas-crypto/src/key/ed25519.rs +++ b/pallas-crypto/src/key/ed25519.rs @@ -460,13 +460,14 @@ mod tests { message: Vec, ) -> bool { // NOTE: this test may fail but it is impossible to see this happening in normal - // condition. we are generating 32 random bytes of public key and - // 64 random bytes of signature with an randomly generated message - // of a random number of bytes in. If the message were empty, the - // probability to have a signature that matches the verify key + // condition. We are generating 32 random bytes of public key and + // 64 random bytes of signature with an randomly generated message + // of a random number of bytes in. If the message were empty, the + // probability to have a signature that matches the verify key + // would still be 1 out of 2^96. // - // if this test fails and it is not a bug, go buy a lottery ticket. + // if this test fails and it is not a bug, go buy a lottery ticket. !public_key.verify(message, &signature) } diff --git a/pallas-multiplexer/src/bearers.rs b/pallas-multiplexer/src/bearers.rs index ef5ddc1..64d1d20 100644 --- a/pallas-multiplexer/src/bearers.rs +++ b/pallas-multiplexer/src/bearers.rs @@ -123,11 +123,11 @@ impl Bearer { Ok(Bearer::Tcp(bearer)) } - pub fn accept_tcp(server: TcpListener) -> Result { - let (bearer, _) = server.accept().unwrap(); + pub fn accept_tcp(server: TcpListener) -> Result<(Self, SocketAddr), std::io::Error> { + let (bearer, remote_addr) = server.accept().unwrap(); bearer.set_nodelay(true)?; - Ok(Bearer::Tcp(bearer)) + Ok((Bearer::Tcp(bearer), remote_addr)) } #[cfg(target_family = "unix")] diff --git a/pallas-multiplexer/tests/integration.rs b/pallas-multiplexer/tests/integration.rs index e309dd2..bfec2b8 100644 --- a/pallas-multiplexer/tests/integration.rs +++ b/pallas-multiplexer/tests/integration.rs @@ -12,7 +12,7 @@ fn setup_passive_muxer() -> JoinHandle { let server = TcpListener::bind(SocketAddrV4::new(Ipv4Addr::LOCALHOST, P)).unwrap(); info!("listening for connections on port {}", P); - let bearer = Bearer::accept_tcp(server).unwrap(); + let (bearer, _) = Bearer::accept_tcp(server).unwrap(); StdPlexer::new(bearer) })