@@ -30,8 +30,8 @@ use crate::{
30
30
use bytes:: Bytes ;
31
31
use futures:: channel:: oneshot;
32
32
use libp2p:: {
33
- connection_limits :: ConnectionLimits , core:: Multiaddr , identify:: Info as IdentifyInfo ,
34
- identity :: PublicKey , kad :: RecordKey , swarm:: NetworkBehaviour , PeerId ,
33
+ core:: Multiaddr , identify:: Info as IdentifyInfo , identity :: PublicKey , kad :: RecordKey ,
34
+ swarm:: NetworkBehaviour , PeerId ,
35
35
} ;
36
36
37
37
use parking_lot:: Mutex ;
@@ -43,7 +43,7 @@ pub use crate::request_responses::{InboundFailure, OutboundFailure, RequestId, R
43
43
44
44
/// General behaviour of the network. Combines all protocols together.
45
45
#[ derive( NetworkBehaviour ) ]
46
- #[ behaviour( to_swarm = "BehaviourOut" ) ]
46
+ #[ behaviour( out_event = "BehaviourOut" ) ]
47
47
pub struct Behaviour < B : BlockT > {
48
48
/// All the substrate-specific protocols.
49
49
substrate : Protocol < B > ,
@@ -52,8 +52,6 @@ pub struct Behaviour<B: BlockT> {
52
52
peer_info : peer_info:: PeerInfoBehaviour ,
53
53
/// Discovers nodes of the network.
54
54
discovery : DiscoveryBehaviour ,
55
- /// Connection limits.
56
- connection_limits : libp2p:: connection_limits:: Behaviour ,
57
55
/// Generic request-response protocols.
58
56
request_responses : request_responses:: RequestResponsesBehaviour ,
59
57
}
@@ -174,7 +172,6 @@ impl<B: BlockT> Behaviour<B> {
174
172
disco_config : DiscoveryConfig ,
175
173
request_response_protocols : Vec < ProtocolConfig > ,
176
174
peer_store_handle : PeerStoreHandle ,
177
- connection_limits : ConnectionLimits ,
178
175
external_addresses : Arc < Mutex < HashSet < Multiaddr > > > ,
179
176
) -> Result < Self , request_responses:: RegisterError > {
180
177
Ok ( Self {
@@ -185,7 +182,6 @@ impl<B: BlockT> Behaviour<B> {
185
182
external_addresses,
186
183
) ,
187
184
discovery : disco_config. finish ( ) ,
188
- connection_limits : libp2p:: connection_limits:: Behaviour :: new ( connection_limits) ,
189
185
request_responses : request_responses:: RequestResponsesBehaviour :: new (
190
186
request_response_protocols. into_iter ( ) ,
191
187
Box :: new ( peer_store_handle) ,
@@ -257,7 +253,7 @@ impl<B: BlockT> Behaviour<B> {
257
253
pub fn add_self_reported_address_to_dht (
258
254
& mut self ,
259
255
peer_id : & PeerId ,
260
- supported_protocols : & [ impl AsRef < str > ] ,
256
+ supported_protocols : & [ impl AsRef < [ u8 ] > ] ,
261
257
addr : Multiaddr ,
262
258
) {
263
259
self . discovery . add_self_reported_address ( peer_id, supported_protocols, addr) ;
@@ -361,9 +357,3 @@ impl From<DiscoveryOut> for BehaviourOut {
361
357
}
362
358
}
363
359
}
364
-
365
- impl From < void:: Void > for BehaviourOut {
366
- fn from ( e : void:: Void ) -> Self {
367
- void:: unreachable ( e)
368
- }
369
- }
0 commit comments