This commit is contained in:
Nikolay Volf 2016-05-15 02:32:53 +03:00
parent 9e7968c92e
commit d67d1eb355
3 changed files with 8 additions and 4 deletions

View File

@ -85,7 +85,7 @@ extern crate num_cpus;
extern crate crossbeam; extern crate crossbeam;
extern crate ethjson; extern crate ethjson;
extern crate bloomchain; 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(test)] extern crate ethcore_devtools as devtools;
#[cfg(feature = "jit" )] extern crate evmjit; #[cfg(feature = "jit" )] extern crate evmjit;

View File

@ -18,9 +18,13 @@
use util::hash::H256; use util::hash::H256;
use header::BlockNumber; use header::BlockNumber;
use ipc::binary::BinaryConvertError;
use ipc::binary::BinaryConvertable;
use std::mem;
use std::collections::VecDeque;
/// Uniquely identifies block. /// Uniquely identifies block.
#[derive(Debug, PartialEq, Clone, Hash, Eq)] #[derive(Debug, PartialEq, Clone, Hash, Eq, Binary)]
pub enum BlockId { pub enum BlockId {
/// Block's sha3. /// Block's sha3.
/// Querying by hash is always faster. /// Querying by hash is always faster.
@ -34,7 +38,7 @@ pub enum BlockId {
} }
/// Uniquely identifies transaction. /// Uniquely identifies transaction.
#[derive(Debug, PartialEq, Clone, Hash, Eq)] #[derive(Debug, PartialEq, Clone, Hash, Eq, Binary)]
pub enum TransactionId { pub enum TransactionId {
/// Transaction's sha3. /// Transaction's sha3.
Hash(H256), Hash(H256),
@ -58,4 +62,3 @@ pub struct UncleId (
/// Position in block. /// Position in block.
pub usize pub usize
); );

View File

@ -389,6 +389,7 @@ pub fn serialize<T: BinaryConvertable>(t: &T) -> Result<Vec<u8>, BinaryConvertEr
Ok(buff.into_inner()) Ok(buff.into_inner())
} }
#[macro_export]
macro_rules! binary_fixed_size { macro_rules! binary_fixed_size {
($target_ty: ty) => { ($target_ty: ty) => {
impl BinaryConvertable for $target_ty { impl BinaryConvertable for $target_ty {