mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 15:11:03 +00:00
Update networking code to libp2p 0.14 (#4383)
* Entirely update substrate-telemetry to futures 0.3 * Add a Closed error * Update to libp2p 0.14 * More work * More work * More work * More work * Fix warnings * Remove unwrap() * Work on tests fixing * Fix network tests * Fix external network tests * Update libp2p and restore Yamux in discovery test * Ignore DNS if initializatio nfails * Restore variables ordering * Forgot browser-utils * Fix downfall after merge * Fix tests
This commit is contained in:
committed by
Gavin Wood
parent
6e572a9477
commit
ca997cf1e4
@@ -59,6 +59,7 @@ pub use self::state_machine::{TopicNotification, MessageIntent};
|
||||
pub use self::state_machine::{Validator, ValidatorContext, ValidationResult};
|
||||
pub use self::state_machine::DiscardAll;
|
||||
|
||||
use futures::prelude::*;
|
||||
use sc_network::{specialization::NetworkSpecialization, Event, ExHashT, NetworkService, PeerId, ReputationChange};
|
||||
use sp_runtime::{traits::Block as BlockT, ConsensusEngineId};
|
||||
use std::sync::Arc;
|
||||
@@ -97,7 +98,7 @@ pub trait Network<B: BlockT> {
|
||||
|
||||
impl<B: BlockT, S: NetworkSpecialization<B>, H: ExHashT> Network<B> for Arc<NetworkService<B, S, H>> {
|
||||
fn event_stream(&self) -> Box<dyn futures01::Stream<Item = Event, Error = ()> + Send> {
|
||||
Box::new(NetworkService::event_stream(self))
|
||||
Box::new(NetworkService::event_stream(self).map(|v| Ok::<_, ()>(v)).compat())
|
||||
}
|
||||
|
||||
fn report_peer(&self, peer_id: PeerId, reputation: ReputationChange) {
|
||||
|
||||
Reference in New Issue
Block a user