diff --git a/ethcore/src/lib.rs b/ethcore/src/lib.rs index 949b4100d..0b62ec4fb 100644 --- a/ethcore/src/lib.rs +++ b/ethcore/src/lib.rs @@ -85,7 +85,7 @@ extern crate num_cpus; extern crate crossbeam; extern crate ethjson; extern crate bloomchain; -extern crate ethcore_ipc as ipc; +#[macro_use] extern crate ethcore_ipc as ipc; #[cfg(test)] extern crate ethcore_devtools as devtools; #[cfg(feature = "jit" )] extern crate evmjit; diff --git a/ethcore/src/types/ids.rs b/ethcore/src/types/ids.rs index 7d5a4c5fc..2250c8dfe 100644 --- a/ethcore/src/types/ids.rs +++ b/ethcore/src/types/ids.rs @@ -18,9 +18,13 @@ use util::hash::H256; use header::BlockNumber; +use ipc::binary::BinaryConvertError; +use ipc::binary::BinaryConvertable; +use std::mem; +use std::collections::VecDeque; /// Uniquely identifies block. -#[derive(Debug, PartialEq, Clone, Hash, Eq)] +#[derive(Debug, PartialEq, Clone, Hash, Eq, Binary)] pub enum BlockId { /// Block's sha3. /// Querying by hash is always faster. @@ -34,7 +38,7 @@ pub enum BlockId { } /// Uniquely identifies transaction. -#[derive(Debug, PartialEq, Clone, Hash, Eq)] +#[derive(Debug, PartialEq, Clone, Hash, Eq, Binary)] pub enum TransactionId { /// Transaction's sha3. Hash(H256), @@ -58,4 +62,3 @@ pub struct UncleId ( /// Position in block. pub usize ); - diff --git a/ipc/rpc/src/binary.rs b/ipc/rpc/src/binary.rs index 58ab38bf1..4fb359f7c 100644 --- a/ipc/rpc/src/binary.rs +++ b/ipc/rpc/src/binary.rs @@ -389,6 +389,7 @@ pub fn serialize(t: &T) -> Result, BinaryConvertEr Ok(buff.into_inner()) } +#[macro_export] macro_rules! binary_fixed_size { ($target_ty: ty) => { impl BinaryConvertable for $target_ty {