1919// DEALINGS IN THE SOFTWARE.
2020
2121use crate :: {
22- crypto:: ed25519:: Keypair ,
2322 mock:: substream:: { DummySubstream , MockSubstream } ,
2423 protocol:: {
2524 request_response:: {
@@ -30,17 +29,17 @@ use crate::{
3029 } ,
3130 substream:: Substream ,
3231 transport:: {
33- manager:: { limits :: ConnectionLimitsConfig , TransportManager } ,
32+ manager:: { TransportManager , TransportManagerBuilder } ,
3433 KEEP_ALIVE_TIMEOUT ,
3534 } ,
3635 types:: { RequestId , SubstreamId } ,
37- BandwidthSink , Error , PeerId , ProtocolName ,
36+ Error , PeerId , ProtocolName ,
3837} ;
3938
4039use futures:: StreamExt ;
4140use tokio:: sync:: mpsc:: Sender ;
4241
43- use std:: { collections :: HashSet , task:: Poll } ;
42+ use std:: task:: Poll ;
4443
4544// create new protocol for testing
4645fn protocol ( ) -> (
@@ -49,21 +48,15 @@ fn protocol() -> (
4948 TransportManager ,
5049 Sender < InnerTransportEvent > ,
5150) {
52- let ( manager, handle) = TransportManager :: new (
53- Keypair :: generate ( ) ,
54- HashSet :: new ( ) ,
55- BandwidthSink :: new ( ) ,
56- 8usize ,
57- ConnectionLimitsConfig :: default ( ) ,
58- ) ;
51+ let manager = TransportManagerBuilder :: new ( ) . build ( ) ;
5952
6053 let peer = PeerId :: random ( ) ;
6154 let ( transport_service, tx) = TransportService :: new (
6255 peer,
6356 ProtocolName :: from ( "/notif/1" ) ,
6457 Vec :: new ( ) ,
6558 std:: sync:: Arc :: new ( Default :: default ( ) ) ,
66- handle ,
59+ manager . transport_manager_handle ( ) ,
6760 KEEP_ALIVE_TIMEOUT ,
6861 ) ;
6962 let ( config, handle) =
0 commit comments