mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 10:27:59 +00:00
Replace NodeIndex with PeerId everywhere (#2077)
* Replace NodeIndex with PeerId * Fix tests * More test fixing * Whitespace
This commit is contained in:
committed by
Arkadiy Paronyan
parent
6fa40ec199
commit
6e394464b8
@@ -16,7 +16,7 @@
|
||||
|
||||
//! Specializations of the substrate network protocol to allow more complex forms of communication.
|
||||
|
||||
use crate::NodeIndex;
|
||||
use crate::PeerId;
|
||||
use runtime_primitives::traits::Block as BlockT;
|
||||
use crate::protocol::Context;
|
||||
|
||||
@@ -26,13 +26,13 @@ pub trait NetworkSpecialization<B: BlockT>: Send + Sync + 'static {
|
||||
fn status(&self) -> Vec<u8>;
|
||||
|
||||
/// Called when a peer successfully handshakes.
|
||||
fn on_connect(&mut self, ctx: &mut Context<B>, who: NodeIndex, status: crate::message::Status<B>);
|
||||
fn on_connect(&mut self, ctx: &mut Context<B>, who: PeerId, status: crate::message::Status<B>);
|
||||
|
||||
/// Called when a peer is disconnected. If the peer ID is unknown, it should be ignored.
|
||||
fn on_disconnect(&mut self, ctx: &mut Context<B>, who: NodeIndex);
|
||||
fn on_disconnect(&mut self, ctx: &mut Context<B>, who: PeerId);
|
||||
|
||||
/// Called when a network-specific message arrives.
|
||||
fn on_message(&mut self, ctx: &mut Context<B>, who: NodeIndex, message: &mut Option<crate::message::Message<B>>);
|
||||
fn on_message(&mut self, ctx: &mut Context<B>, who: PeerId, message: &mut Option<crate::message::Message<B>>);
|
||||
|
||||
/// Called on abort.
|
||||
fn on_abort(&mut self) { }
|
||||
|
||||
Reference in New Issue
Block a user