Final docs

This commit is contained in:
arkpar
2016-02-03 16:43:48 +01:00
parent fe97809649
commit 42d5c09131
17 changed files with 75 additions and 189 deletions

View File

@@ -15,6 +15,7 @@ use service::NetSyncMessage;
use env_info::LastHashes;
use verification::*;
use block::*;
pub use blockchain::TreeRoute;
/// General block status
#[derive(Debug, Eq, PartialEq)]
@@ -50,8 +51,6 @@ impl fmt::Display for BlockChainInfo {
}
}
/// TODO [arkpar] Please document me
pub type TreeRoute = ::blockchain::TreeRoute;
/// Blockchain database client. Owns and manages a blockchain and a block queue.
pub trait BlockChainClient : Sync + Send {

View File

@@ -1,22 +1,21 @@
use util::*;
#[inline]
/// TODO [debris] Please document me
/// 1 Ether in Wei
pub fn ether() -> U256 { U256::exp10(18) }
#[inline]
/// TODO [debris] Please document me
/// 1 Finney in Wei
pub fn finney() -> U256 { U256::exp10(15) }
#[inline]
/// TODO [debris] Please document me
/// 1 Szabo in Wei
pub fn szabo() -> U256 { U256::exp10(12) }
#[inline]
/// TODO [debris] Please document me
/// 1 Shannon in Wei
pub fn shannon() -> U256 { U256::exp10(9) }
#[inline]
/// TODO [debris] Please document me
/// 1 Wei in Wei
pub fn wei() -> U256 { U256::exp10(0) }

View File

@@ -21,7 +21,7 @@ pub struct Ethash {
}
impl Ethash {
/// TODO [arkpar] Please document me
/// Create a new boxed instance of Ethash engine
pub fn new_boxed(spec: Spec) -> Box<Engine> {
Box::new(Ethash {
spec: spec,

View File

@@ -2,7 +2,6 @@
pub mod ext;
pub mod evm;
/// TODO [Tomusdrw] Please document me
pub mod interpreter;
#[macro_use]
pub mod factory;

View File

@@ -7,21 +7,21 @@ use rocksdb::{DB, Writable};
/// Represents index of extra data in database
#[derive(Copy, Debug, Hash, Eq, PartialEq, Clone)]
pub enum ExtrasIndex {
/// TODO [debris] Please document me
/// Block details index
BlockDetails = 0,
/// TODO [debris] Please document me
/// Block hash index
BlockHash = 1,
/// TODO [debris] Please document me
/// Transaction address index
TransactionAddress = 2,
/// TODO [debris] Please document me
/// Block log blooms index
BlockLogBlooms = 3,
/// TODO [debris] Please document me
/// Block blooms index
BlocksBlooms = 4
}
/// trait used to write Extras data to db
pub trait ExtrasWritable {
/// TODO [debris] Please document me
/// Write extra data to db
fn put_extras<K, T>(&self, hash: &K, value: &T) where
T: ExtrasIndexable + Encodable,
K: ExtrasSliceConvertable;
@@ -29,12 +29,12 @@ pub trait ExtrasWritable {
/// trait used to read Extras data from db
pub trait ExtrasReadable {
/// TODO [debris] Please document me
/// Read extra data from db
fn get_extras<K, T>(&self, hash: &K) -> Option<T> where
T: ExtrasIndexable + Decodable,
K: ExtrasSliceConvertable;
/// TODO [debris] Please document me
/// Check if extra data exists in the db
fn extras_exists<K, T>(&self, hash: &K) -> bool where
T: ExtrasIndexable,
K: ExtrasSliceConvertable;
@@ -98,7 +98,7 @@ impl ExtrasSliceConvertable for BlockNumber {
/// Types implementing this trait can be indexed in extras database
pub trait ExtrasIndexable {
/// TODO [debris] Please document me
/// Returns this data index
fn extras_index() -> ExtrasIndex;
}
@@ -111,13 +111,13 @@ impl ExtrasIndexable for H256 {
/// Familial details concerning a block
#[derive(Debug, Clone)]
pub struct BlockDetails {
/// TODO [debris] Please document me
/// Block number
pub number: BlockNumber,
/// TODO [debris] Please document me
/// Total difficulty of the block and all its parents
pub total_difficulty: U256,
/// TODO [debris] Please document me
/// Parent block hash
pub parent: H256,
/// TODO [debris] Please document me
/// List of children block hashes
pub children: Vec<H256>
}
@@ -159,7 +159,7 @@ impl Encodable for BlockDetails {
/// Log blooms of certain block
#[derive(Clone)]
pub struct BlockLogBlooms {
/// TODO [debris] Please document me
/// List of log blooms for the block
pub blooms: Vec<H2048>
}
@@ -193,7 +193,7 @@ impl Encodable for BlockLogBlooms {
/// Neighboring log blooms on certain level
pub struct BlocksBlooms {
/// TODO [debris] Please document me
/// List of block blooms.
pub blooms: [H2048; 16]
}
@@ -241,9 +241,9 @@ impl Encodable for BlocksBlooms {
/// Represents address of certain transaction within block
#[derive(Clone)]
pub struct TransactionAddress {
/// TODO [debris] Please document me
/// Block hash
pub block_hash: H256,
/// TODO [debris] Please document me
/// Transaction index within the block
pub index: u64
}

View File

@@ -15,7 +15,7 @@ pub enum SyncMessage {
BlockVerified,
}
/// TODO [arkpar] Please document me
/// IO Message type used for Network service
pub type NetSyncMessage = NetworkIoMessage<SyncMessage>;
/// Client service setup. Creates and registers client and network services with the IO subsystem.