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:
Bastian Köcher
2018-10-12 13:10:36 +02:00
committed by Gav Wood
parent 671b0e0007
commit db427cb45c
7 changed files with 167 additions and 74 deletions
+3
View File
@@ -49,6 +49,7 @@ extern crate substrate_test_client as test_client;
mod service;
mod sync;
#[macro_use]
mod protocol;
mod io;
mod config;
@@ -74,3 +75,5 @@ pub use message::{generic as generic_message, RequestId, BftMessage, LocalizedBf
pub use error::Error;
pub use config::{Roles, ProtocolConfig};
pub use on_demand::{OnDemand, OnDemandService, RemoteResponse};
#[doc(hidden)]
pub use runtime_primitives::traits::Block as BlockT;