Skip to content
Merged
Prev Previous commit
Next Next commit
fix aleph-node
  • Loading branch information
Michal Swietek committed Nov 22, 2022
commit d6eea089ced912e3125b73bbdeaa78a49c9d00cf
11 changes: 6 additions & 5 deletions finality-aleph/src/substrate_network.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{borrow::Cow, collections::HashSet, fmt, iter, pin::Pin, sync::Arc};
use std::{collections::HashSet, fmt, iter, pin::Pin, sync::Arc};

use async_trait::async_trait;
use futures::stream::{Stream, StreamExt};
Expand All @@ -8,8 +8,9 @@ use sc_network::{
multiaddr::Protocol as MultiaddressProtocol, Event as SubstrateEvent, ExHashT, Multiaddr,
NetworkService, NetworkSyncForkRequest, PeerId,
};
use sc_network_common::service::{
NetworkEventStream as _, NetworkNotification, NetworkPeers, NotificationSender,
use sc_network_common::{
protocol::ProtocolName,
service::{NetworkEventStream as _, NetworkNotification, NetworkPeers, NotificationSender},
};
use sp_api::NumberFor;
use sp_consensus::SyncOracle;
Expand Down Expand Up @@ -46,10 +47,10 @@ impl<B: Block, H: ExHashT> RequestBlocks<B> for Arc<NetworkService<B, H>> {
const AUTHENTICATION_PROTOCOL_NAME: &str = "/aleph/1";

/// Returns the canonical name of the protocol.
pub fn protocol_name(protocol: &Protocol) -> Cow<'static, str> {
pub fn protocol_name(protocol: &Protocol) -> ProtocolName {
use Protocol::*;
match protocol {
Authentication => Cow::Borrowed(AUTHENTICATION_PROTOCOL_NAME),
Authentication => ProtocolName::Static(AUTHENTICATION_PROTOCOL_NAME),
}
}

Expand Down