Add ProtocolBehaviour (#2922)

* Add ProtocolBehaviour

* Fix tests

* Line widths

* Address concerns

* Apply suggestions from code review

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>

* Remove TODO
This commit is contained in:
Pierre Krieger
2019-06-24 13:22:03 +02:00
committed by Gavin Wood
parent 48aa32bece
commit e919d03331
6 changed files with 643 additions and 239 deletions
@@ -125,9 +125,10 @@ pub(crate) fn global_topic<B: BlockT>(set_id: u64) -> B::Hash {
<<B::Header as HeaderT>::Hashing as HashT>::hash(format!("{}-GLOBAL", set_id).as_bytes())
}
impl<B, S> Network<B> for Arc<NetworkService<B, S>> where
impl<B, S, H> Network<B> for Arc<NetworkService<B, S, H>> where
B: BlockT,
S: network::specialization::NetworkSpecialization<B>,
H: network::ExHashT,
{
type In = NetworkStream;