mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-19 22:51: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
@@ -12,7 +12,7 @@ futures01 = { package = "futures", version = "0.1.29" }
|
||||
futures = { version = "0.3.1", features = ["compat"] }
|
||||
futures-timer = "0.4.0"
|
||||
lru = "0.1.2"
|
||||
libp2p = { version = "0.13.2", default-features = false, features = ["libp2p-websocket"] }
|
||||
libp2p = { version = "0.14.0-alpha.1", default-features = false, features = ["libp2p-websocket"] }
|
||||
sc-network = { version = "0.8", path = "../network" }
|
||||
parking_lot = "0.9.0"
|
||||
sp-runtime = { version = "2.0.0", path = "../../primitives/runtime" }
|
||||
|
||||
@@ -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