diff --git a/misc/mdns/src/lib.rs b/misc/mdns/src/lib.rs index 8e2836feb22..b388fdcc129 100644 --- a/misc/mdns/src/lib.rs +++ b/misc/mdns/src/lib.rs @@ -569,7 +569,7 @@ mod tests { match packet { MdnsPacket::Query(query) => { - query.respond(peer_id.clone(), None, Duration::from_secs(120)); + query.respond(peer_id.clone(), None, Duration::from_secs(120)).unwrap(); } MdnsPacket::Response(response) => { for peer in response.discovered_peers() { diff --git a/muxers/mplex/tests/two_peers.rs b/muxers/mplex/tests/two_peers.rs index caf081a233a..8a32c7c41af 100644 --- a/muxers/mplex/tests/two_peers.rs +++ b/muxers/mplex/tests/two_peers.rs @@ -24,16 +24,16 @@ extern crate libp2p_mplex as multiplex; extern crate libp2p_core as swarm; extern crate libp2p_tcp_transport as tcp; extern crate tokio; -extern crate tokio_io; -use futures::future::Future; -use futures::{Sink, Stream}; +use futures::prelude::*; use std::sync::{Arc, mpsc}; use std::thread; use swarm::{muxing, Transport}; use tcp::TcpConfig; -use tokio_io::codec::length_delimited::Framed; -use tokio::runtime::current_thread::Runtime; +use tokio::{ + codec::length_delimited::Builder, + runtime::current_thread::Runtime +}; #[test] fn client_to_server_outbound() { @@ -55,7 +55,7 @@ fn client_to_server_outbound() { .map_err(|(err, _)| err) .and_then(|(client, _)| client.unwrap().0) .and_then(|client| muxing::outbound_from_ref_and_wrap(Arc::new(client))) - .map(|client| Framed::<_, bytes::BytesMut>::new(client.unwrap())) + .map(|client| Builder::new().new_read(client.unwrap())) .and_then(|client| { client .into_future() @@ -78,7 +78,7 @@ fn client_to_server_outbound() { .dial(rx.recv().unwrap()) .unwrap() .and_then(|client| muxing::inbound_from_ref_and_wrap(Arc::new(client))) - .map(|server| Framed::<_, bytes::BytesMut>::new(server.unwrap())) + .map(|server| Builder::new().new_write(server.unwrap())) .and_then(|server| server.send("hello world".into())) .map(|_| ()); @@ -107,7 +107,7 @@ fn client_to_server_inbound() { .map_err(|(err, _)| err) .and_then(|(client, _)| client.unwrap().0) .and_then(|client| muxing::inbound_from_ref_and_wrap(Arc::new(client))) - .map(|client| Framed::<_, bytes::BytesMut>::new(client.unwrap())) + .map(|client| Builder::new().new_read(client.unwrap())) .and_then(|client| { client .into_future() @@ -130,7 +130,7 @@ fn client_to_server_inbound() { .dial(rx.recv().unwrap()) .unwrap() .and_then(|client| muxing::outbound_from_ref_and_wrap(Arc::new(client))) - .map(|server| Framed::<_, bytes::BytesMut>::new(server.unwrap())) + .map(|server| Builder::new().new_write(server.unwrap())) .and_then(|server| server.send("hello world".into())) .map(|_| ()); diff --git a/protocols/kad/src/protocol.rs b/protocols/kad/src/protocol.rs index ba34727083b..b708bbeac00 100644 --- a/protocols/kad/src/protocol.rs +++ b/protocols/kad/src/protocol.rs @@ -458,6 +458,7 @@ mod tests { extern crate libp2p_tcp_transport; extern crate tokio; + /*// TODO: restore use self::libp2p_tcp_transport::TcpConfig; use self::tokio::runtime::current_thread::Runtime; use futures::{Future, Sink, Stream}; @@ -467,7 +468,6 @@ mod tests { use std::sync::mpsc; use std::thread; - /*// TODO: restore #[test] fn correct_transfer() { // We open a server and a client, send a message between the two, and check that they were