Client IPC Interface (#1493)

* btree map serializer

* serde tests

* state diff serialization

* basic layout

* more missing serializaers

* uncle returns rlp

* block queue info

* sorting with transaction result

* sorting out util imports

* transaction import result sorting also

* sorting filters & ranges

* error sorting out

* deriving ipc service compiling

* rpc & sync recompile

* sorting rpc using uncles

* fix compilation

* fix merging bugs

* fix unused imports

* fix all warnings

* tests stub

* some merge bugs

* ethcore compilation

* fix rpc compilation

* deriving attribute

* tests (and fixes)

* rpc test working

* fix warnings again

* rs.in -> rs

* missing attribute

* refactored tree changes

* paste reformat mess fix

* pub mod actually

* intendation fix
This commit is contained in:
Nikolay Volf
2016-07-07 11:39:32 +04:00
committed by Gav Wood
parent d7e225c0af
commit 8282c7dd50
32 changed files with 362 additions and 158 deletions

View File

@@ -315,6 +315,31 @@ impl BinaryConvertable for String {
}
}
impl<T> BinaryConvertable for Range<T> where T: BinaryConvertable {
fn size(&self) -> usize {
mem::size_of::<T>() * 2
}
fn from_empty_bytes() -> Result<Self, BinaryConvertError> {
Err(BinaryConvertError)
}
fn to_bytes(&self, buffer: &mut[u8], length_stack: &mut VecDeque<usize>) -> Result<(), BinaryConvertError> {
try!(self.start.to_bytes(&mut buffer[..mem::size_of::<T>()], length_stack));
try!(self.end.to_bytes(&mut buffer[mem::size_of::<T>() + 1..], length_stack));
Ok(())
}
fn from_bytes(buffer: &[u8], length_stack: &mut VecDeque<usize>) -> Result<Self, BinaryConvertError> {
Ok(try!(T::from_bytes(&buffer[..mem::size_of::<T>()], length_stack))..try!(T::from_bytes(&buffer[mem::size_of::<T>()+1..], length_stack)))
}
fn len_params() -> usize {
assert_eq!(0, T::len_params());
0
}
}
impl<T> BinaryConvertable for ::std::cell::RefCell<T> where T: BinaryConvertable {
fn size(&self) -> usize {
self.borrow().size()
@@ -539,8 +564,6 @@ binary_fixed_size!(U512);
binary_fixed_size!(H256);
binary_fixed_size!(H2048);
binary_fixed_size!(Address);
binary_fixed_size!(Range<usize>);
binary_fixed_size!(Range<u64>);
#[test]
fn vec_serialize() {

View File

@@ -91,7 +91,7 @@ pub fn invoke<W>(method_num: u16, params: &Option<Vec<u8>>, w: &mut W) where W:
}
/// IpcSocket, read/write generalization
pub trait IpcSocket: Read + Write + Sync {
pub trait IpcSocket: Read + Write + Sync + Send {
}
/// Basically something that needs only socket to be spawned