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 {
/// 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<Transaction>,
/// TODO [Gav Wood] Please document me
/// Block uncles.
pub uncles: &'a Vec<Header>,
/// TODO [Gav Wood] Please document me
/// Transaction receipts.
pub receipts: &'a Vec<Receipt>,
/// TODO [Gav Wood] Please document me
/// State.
pub state: &'a mut State,
}

View File

@ -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<H256>,
/// 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
}