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
+7 -3
View File
@@ -38,9 +38,13 @@ use futures::sync::mpsc;
// Type aliases.
// These exist mainly to avoid typing `<F as Factory>::Foo` all over the code.
/// Network service type for a factory.
pub type NetworkService<F> =
network::NetworkService<<F as ServiceFactory>::Block, <F as ServiceFactory>::NetworkProtocol>;
/// Network service type for `Components`.
pub type NetworkService<C> = network::NetworkService<
ComponentBlock<C>,
<<C as Components>::Factory as ServiceFactory>::NetworkProtocol,
ComponentExHash<C>
>;
/// Code executor type for a factory.
pub type CodeExecutor<F> = NativeExecutor<<F as ServiceFactory>::RuntimeDispatch>;