@@ -3,6 +3,7 @@ use cfx_internal_common::{
33 impl_db_encoding_as_rlp, DatabaseDecodable , DatabaseEncodable ,
44} ;
55use cfx_types:: { Address , Bloom , H256 , U256 } ;
6+ pub use cfxcore_types:: block_data_manager:: BlockStatus ;
67use malloc_size_of:: { MallocSizeOf , MallocSizeOfOps } ;
78use malloc_size_of_derive:: MallocSizeOf as DeriveMallocSizeOf ;
89use primitives:: BlockReceipts ;
@@ -276,31 +277,6 @@ impl Decodable for LocalBlockInfo {
276277 }
277278}
278279
279- /// The validity status of a block. If a block's status among all honest nodes
280- /// is guaranteed to have no conflict, which means if some honest nodes think a
281- /// block is not `Pending`, their decision will be the same status.
282- #[ derive( Copy , Clone , PartialEq , DeriveMallocSizeOf ) ]
283- pub enum BlockStatus {
284- Valid = 0 ,
285- Invalid = 1 ,
286- PartialInvalid = 2 ,
287- Pending = 3 ,
288- }
289-
290- impl BlockStatus {
291- fn from_db_status ( db_status : u8 ) -> Self {
292- match db_status {
293- 0 => BlockStatus :: Valid ,
294- 1 => BlockStatus :: Invalid ,
295- 2 => BlockStatus :: PartialInvalid ,
296- 3 => BlockStatus :: Pending ,
297- _ => panic ! ( "Read unknown block status from db" ) ,
298- }
299- }
300-
301- pub fn to_db_status ( & self ) -> u8 { * self as u8 }
302- }
303-
304280/// The checkpoint information stored in the database
305281#[ derive( RlpEncodable , RlpDecodable , Clone ) ]
306282pub struct CheckpointHashes {
0 commit comments