From a1cedaa994816cdfbbd16e226a15ab8466919a49 Mon Sep 17 00:00:00 2001 From: debris Date: Tue, 2 Feb 2016 16:24:37 +0100 Subject: [PATCH] ethcore block and blockchain module fixes --- ethcore/src/block.rs | 13 ++++++------- ethcore/src/blockchain.rs | 22 ++++++++-------------- 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/ethcore/src/block.rs b/ethcore/src/block.rs index 1977fb406..a2de89d13 100644 --- a/ethcore/src/block.rs +++ b/ethcore/src/block.rs @@ -20,7 +20,7 @@ pub struct Block { } impl Block { - /// Returns true iff the given bytes form a valid encoding of a block in RLP. + /// Returns true if the given bytes form a valid encoding of a block in RLP. // TODO: implement Decoder for this and have this use that. pub fn is_good(b: &[u8]) -> bool { /* @@ -73,16 +73,15 @@ pub struct ExecutedBlock { /// A set of references to `ExecutedBlock` fields that are publicly accessible. pub struct BlockRefMut<'a> { - /// TODO [Gav Wood] Please document me + /// Block header. pub header: &'a Header, - /// TODO [Gav Wood] Please document me + /// Block transactions. pub transactions: &'a Vec, - /// TODO [Gav Wood] Please document me + /// Block uncles. pub uncles: &'a Vec
, - - /// TODO [Gav Wood] Please document me + /// Transaction receipts. pub receipts: &'a Vec, - /// TODO [Gav Wood] Please document me + /// State. pub state: &'a mut State, } diff --git a/ethcore/src/blockchain.rs b/ethcore/src/blockchain.rs index 7ad124133..e2ed54c19 100644 --- a/ethcore/src/blockchain.rs +++ b/ethcore/src/blockchain.rs @@ -8,33 +8,27 @@ use transaction::*; use views::*; /// Represents a tree route between `from` block and `to` block: -/// -/// - `blocks` - a vector of hashes of all blocks, ordered from `from` to `to`. -/// -/// - `ancestor` - best common ancestor of these blocks. -/// -/// - `index` - an index where best common ancestor would be. pub struct TreeRoute { - /// TODO [debris] Please document me + /// A vector of hashes of all blocks, ordered from `from` to `to`. pub blocks: Vec, - /// TODO [debris] Please document me + /// Best common ancestor of these blocks. pub ancestor: H256, - /// TODO [debris] Please document me + /// An index where best common ancestor would be. pub index: usize } /// Represents blockchain's in-memory cache size in bytes. #[derive(Debug)] pub struct CacheSize { - /// TODO [debris] Please document me + /// Blocks cache size. pub blocks: usize, - /// TODO [debris] Please document me + /// BlockDetails cache size. pub block_details: usize, - /// TODO [debris] Please document me + /// Transaction addresses cache size. pub transaction_addresses: usize, - /// TODO [debris] Please document me + /// Logs cache size. pub block_logs: usize, - /// TODO [debris] Please document me + /// Blooms cache size. pub blocks_blooms: usize }