From 14bcca54d2a1bf309507ce3b802d400a41032d41 Mon Sep 17 00:00:00 2001 From: Nikolay Volf Date: Fri, 6 May 2016 00:47:47 +0400 Subject: [PATCH] block status moved --- ethcore/src/client/client.rs | 14 +------------- ethcore/src/types/block_status.rs | 30 ++++++++++++++++++++++++++++++ ethcore/src/types/executed.rs | 2 -- ethcore/src/types/ids.rs | 3 --- ethcore/src/types/mod.rs | 1 + 5 files changed, 32 insertions(+), 18 deletions(-) create mode 100644 ethcore/src/types/block_status.rs diff --git a/ethcore/src/client/client.rs b/ethcore/src/client/client.rs index e9aba8415..168e49ec3 100644 --- a/ethcore/src/client/client.rs +++ b/ethcore/src/client/client.rs @@ -45,19 +45,7 @@ pub use blockchain::CacheSize as BlockChainCacheSize; use trace::{TraceDB, ImportRequest as TraceImportRequest, LocalizedTrace, Database as TraceDatabase}; use trace; pub use types::blockchain_info::BlockChainInfo; - -/// General block status -#[derive(Debug, Eq, PartialEq)] -pub enum BlockStatus { - /// Part of the blockchain. - InChain, - /// Queued for import. - Queued, - /// Known as bad. - Bad, - /// Unknown. - Unknown, -} +pub use types::block_status::BlockStatus; impl fmt::Display for BlockChainInfo { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { diff --git a/ethcore/src/types/block_status.rs b/ethcore/src/types/block_status.rs new file mode 100644 index 000000000..60776748c --- /dev/null +++ b/ethcore/src/types/block_status.rs @@ -0,0 +1,30 @@ +// Copyright 2015, 2016 Ethcore (UK) Ltd. +// This file is part of Parity. + +// Parity is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Parity is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Parity. If not, see . + +//! Block status description module + +/// General block status +#[derive(Debug, Eq, PartialEq)] +pub enum BlockStatus { + /// Part of the blockchain. + InChain, + /// Queued for import. + Queued, + /// Known as bad. + Bad, + /// Unknown. + Unknown, +} diff --git a/ethcore/src/types/executed.rs b/ethcore/src/types/executed.rs index 92e297eec..cd671269f 100644 --- a/ethcore/src/types/executed.rs +++ b/ethcore/src/types/executed.rs @@ -20,8 +20,6 @@ use util::*; use trace::Trace; use types::log_entry::LogEntry; - - /// Transaction execution receipt. #[derive(Debug, PartialEq, Clone)] pub struct Executed { diff --git a/ethcore/src/types/ids.rs b/ethcore/src/types/ids.rs index 39a19c82d..cdab4ee3f 100644 --- a/ethcore/src/types/ids.rs +++ b/ethcore/src/types/ids.rs @@ -60,6 +60,3 @@ pub struct UncleId ( pub usize ); -sized_binary_map!(TransactionId); -sized_binary_map!(UncleId); -sized_binary_map!(BlockId); diff --git a/ethcore/src/types/mod.rs b/ethcore/src/types/mod.rs index 9ad2fe74b..369591dfd 100644 --- a/ethcore/src/types/mod.rs +++ b/ethcore/src/types/mod.rs @@ -24,3 +24,4 @@ pub mod blockchain_info; pub mod log_entry; pub mod trace_types; pub mod executed; +pub mod block_status;