ethcore block and blockchain module fixes

This commit is contained in:
debris 2016-02-02 16:24:37 +01:00
parent cb98cbcd4b
commit a1cedaa994
2 changed files with 14 additions and 21 deletions

View File

@ -20,7 +20,7 @@ pub struct Block {
} }
impl 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. // TODO: implement Decoder for this and have this use that.
pub fn is_good(b: &[u8]) -> bool { 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. /// A set of references to `ExecutedBlock` fields that are publicly accessible.
pub struct BlockRefMut<'a> { pub struct BlockRefMut<'a> {
/// TODO [Gav Wood] Please document me /// Block header.
pub header: &'a Header, pub header: &'a Header,
/// TODO [Gav Wood] Please document me /// Block transactions.
pub transactions: &'a Vec<Transaction>, pub transactions: &'a Vec<Transaction>,
/// TODO [Gav Wood] Please document me /// Block uncles.
pub uncles: &'a Vec<Header>, pub uncles: &'a Vec<Header>,
/// Transaction receipts.
/// TODO [Gav Wood] Please document me
pub receipts: &'a Vec<Receipt>, pub receipts: &'a Vec<Receipt>,
/// TODO [Gav Wood] Please document me /// State.
pub state: &'a mut State, pub state: &'a mut State,
} }

View File

@ -8,33 +8,27 @@ use transaction::*;
use views::*; use views::*;
/// Represents a tree route between `from` block and `to` block: /// 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 { pub struct TreeRoute {
/// TODO [debris] Please document me /// A vector of hashes of all blocks, ordered from `from` to `to`.
pub blocks: Vec<H256>, pub blocks: Vec<H256>,
/// TODO [debris] Please document me /// Best common ancestor of these blocks.
pub ancestor: H256, pub ancestor: H256,
/// TODO [debris] Please document me /// An index where best common ancestor would be.
pub index: usize pub index: usize
} }
/// Represents blockchain's in-memory cache size in bytes. /// Represents blockchain's in-memory cache size in bytes.
#[derive(Debug)] #[derive(Debug)]
pub struct CacheSize { pub struct CacheSize {
/// TODO [debris] Please document me /// Blocks cache size.
pub blocks: usize, pub blocks: usize,
/// TODO [debris] Please document me /// BlockDetails cache size.
pub block_details: usize, pub block_details: usize,
/// TODO [debris] Please document me /// Transaction addresses cache size.
pub transaction_addresses: usize, pub transaction_addresses: usize,
/// TODO [debris] Please document me /// Logs cache size.
pub block_logs: usize, pub block_logs: usize,
/// TODO [debris] Please document me /// Blooms cache size.
pub blocks_blooms: usize pub blocks_blooms: usize
} }