@@ -34,7 +34,6 @@ use libp2p::{
3434
3535use sc_consensus:: import_queue:: { IncomingBlock , RuntimeOrigin } ;
3636use sc_network_common:: {
37- config:: ProtocolId ,
3837 protocol:: {
3938 event:: DhtEvent ,
4039 role:: { ObservedRole , Roles } ,
@@ -79,7 +78,7 @@ pub enum BehaviourOut<B: BlockT> {
7978 JustificationImport ( RuntimeOrigin , B :: Hash , NumberFor < B > , Justifications ) ,
8079
8180 /// Started a random iterative Kademlia discovery query.
82- RandomKademliaStarted ( Vec < ProtocolId > ) ,
81+ RandomKademliaStarted ,
8382
8483 /// We have received a request from a peer and answered it.
8584 ///
@@ -267,25 +266,20 @@ where
267266 self . discovery . add_known_address ( peer_id, addr)
268267 }
269268
270- /// Returns the number of nodes in each Kademlia kbucket for each Kademlia instance .
269+ /// Returns the number of nodes in each Kademlia kbucket.
271270 ///
272- /// Identifies Kademlia instances by their [`ProtocolId`] and kbuckets by the base 2 logarithm
273- /// of their lower bound.
274- pub fn num_entries_per_kbucket (
275- & mut self ,
276- ) -> impl ExactSizeIterator < Item = ( & ProtocolId , Vec < ( u32 , usize ) > ) > {
271+ /// Identifies kbuckets by the base 2 logarithm of their lower bound.
272+ pub fn num_entries_per_kbucket ( & mut self ) -> Option < Vec < ( u32 , usize ) > > {
277273 self . discovery . num_entries_per_kbucket ( )
278274 }
279275
280276 /// Returns the number of records in the Kademlia record stores.
281- pub fn num_kademlia_records ( & mut self ) -> impl ExactSizeIterator < Item = ( & ProtocolId , usize ) > {
277+ pub fn num_kademlia_records ( & mut self ) -> Option < usize > {
282278 self . discovery . num_kademlia_records ( )
283279 }
284280
285281 /// Returns the total size in bytes of all the records in the Kademlia record stores.
286- pub fn kademlia_records_total_size (
287- & mut self ,
288- ) -> impl ExactSizeIterator < Item = ( & ProtocolId , usize ) > {
282+ pub fn kademlia_records_total_size ( & mut self ) -> Option < usize > {
289283 self . discovery . kademlia_records_total_size ( )
290284 }
291285
@@ -438,8 +432,7 @@ impl<B: BlockT> From<DiscoveryOut> for BehaviourOut<B> {
438432 BehaviourOut :: Dht ( DhtEvent :: ValuePut ( key) , duration) ,
439433 DiscoveryOut :: ValuePutFailed ( key, duration) =>
440434 BehaviourOut :: Dht ( DhtEvent :: ValuePutFailed ( key) , duration) ,
441- DiscoveryOut :: RandomKademliaStarted ( protocols) =>
442- BehaviourOut :: RandomKademliaStarted ( protocols) ,
435+ DiscoveryOut :: RandomKademliaStarted => BehaviourOut :: RandomKademliaStarted ,
443436 }
444437 }
445438}
0 commit comments