Sync IPC interface (#1584)

* chain notify trait

* replaced network service with io service

* fix ethcore crate warnings

* refactored network service without generic

* ethcore fix

* ethsync refactoring

* proper linking of notify

* manage network interface

* rpc crate rebinding

* full rewire

* sync internal io service

* fix deadlock

* fix warnings and removed async io

* sync imported message propagation

* fix rpc warnings

* binart warnings

* test fixes

* rpc mocks and tests

* fix util doctest

* fix message name and removed empty notifier

* pointers mess & dark mode fixed

* fixed sync doctest

* added few warnings

* fix review

* new convention match

* fix error unwraps

* doctest fix

* basic library re-layout

* missing files to relayout

* duplicating network config on sync level

* binary serializers for config

* ipc endpoint for manage

* ipc endpoint for sync

* handshake sorting out

* sorting out the multi-interface dispatch scenario

* fixing tests

* fix doctest
This commit is contained in:
Nikolay Volf
2016-07-14 12:07:33 +02:00
committed by Arkadiy Paronyan
parent 8d0e05adb7
commit 44bc8a08fb
17 changed files with 372 additions and 204 deletions

View File

@@ -610,6 +610,7 @@ impl From<::semver::Version> for BinVersion {
}
}
binary_fixed_size!(u16);
binary_fixed_size!(u64);
binary_fixed_size!(u32);
binary_fixed_size!(usize);

View File

@@ -29,7 +29,7 @@ pub struct Handshake {
/// Allows to configure custom version and custom handshake response for
/// ipc host
pub trait IpcConfig {
pub trait IpcConfig<I: ?Sized> {
/// Current service api version
/// Should be increased if any of the methods changes signature
fn api_version() -> Version {
@@ -60,7 +60,7 @@ pub enum Error {
/// Allows implementor to be attached to generic worker and dispatch rpc requests
/// over IPC
pub trait IpcInterface<T>: IpcConfig {
pub trait IpcInterface<I :?Sized> : IpcConfig<I> {
/// reads the message from io, dispatches the call and returns serialized result
fn dispatch<R>(&self, r: &mut R) -> Vec<u8> where R: Read;