mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 06:57:58 +00:00
Adds construct_simple_protocol macro for simplifying the creation of protocols (#897)
* Make `on_message` take the message as `&mut Option<_>` * Make `ConsensusGossip` implement `Specialization` * Move `new_session` into `ConsensusGossip` * Adds `construct_simple_protocol` macro for simplifying the creation of protocols
This commit is contained in:
@@ -35,7 +35,7 @@ pub trait Specialization<B: BlockT>: Send + Sync + 'static {
|
||||
fn on_disconnect(&mut self, ctx: &mut Context<B>, who: NodeIndex);
|
||||
|
||||
/// Called when a network-specific message arrives.
|
||||
fn on_message(&mut self, ctx: &mut Context<B>, who: NodeIndex, message: ::message::Message<B>);
|
||||
fn on_message(&mut self, ctx: &mut Context<B>, who: NodeIndex, message: &mut Option<::message::Message<B>>);
|
||||
|
||||
/// Called on abort.
|
||||
fn on_abort(&mut self) { }
|
||||
|
||||
Reference in New Issue
Block a user