cleanup ethcore public interfaces

This commit is contained in:
debris 2016-02-02 15:29:53 +01:00
parent b3eb2b26d5
commit 30dc9d857d
14 changed files with 98 additions and 126 deletions

View File

@ -1,3 +1,5 @@
//! Single account in the system.
use util::*; use util::*;
use pod_account::*; use pod_account::*;

View File

@ -1,3 +1,5 @@
//! Diff between two accounts.
use util::*; use util::*;
use pod_account::*; use pod_account::*;

View File

@ -1,3 +1,5 @@
//! Ethcore basic typenames.
use util::*; use util::*;
/// Type for a 2048-bit log-bloom, as used by our blocks. /// Type for a 2048-bit log-bloom, as used by our blocks.

View File

@ -1,3 +1,5 @@
//! Blockchain block.
#![allow(ptr_arg)] // Because of &LastHashes -> &Vec<_> #![allow(ptr_arg)] // Because of &LastHashes -> &Vec<_>
use common::*; use common::*;
@ -394,4 +396,4 @@ mod tests {
assert_eq!(orig_db.keys(), db.keys()); assert_eq!(orig_db.keys(), db.keys());
assert!(orig_db.keys().iter().filter(|k| orig_db.get(k.0) != db.get(k.0)).next() == None); assert!(orig_db.keys().iter().filter(|k| orig_db.get(k.0) != db.get(k.0)).next() == None);
} }
} }

View File

@ -1,4 +1,4 @@
//! Fast access to blockchain data. //! Blockchain database.
use util::*; use util::*;
use rocksdb::{DB, WriteBatch, Writable}; use rocksdb::{DB, WriteBatch, Writable};

View File

@ -1,3 +1,5 @@
//! Blockchain database client.
use util::*; use util::*;
use rocksdb::{Options, DB}; use rocksdb::{Options, DB};
use blockchain::{BlockChain, BlockProvider, CacheSize}; use blockchain::{BlockChain, BlockProvider, CacheSize};

View File

@ -93,7 +93,6 @@ fn test_create_vm() {
} }
/// Create tests by injecting different VM factories /// Create tests by injecting different VM factories
#[macro_export]
macro_rules! evm_test( macro_rules! evm_test(
($name_test: ident: $name_jit: ident, $name_int: ident) => { ($name_test: ident: $name_jit: ident, $name_int: ident) => {
#[test] #[test]
@ -109,7 +108,6 @@ macro_rules! evm_test(
); );
/// Create ignored tests by injecting different VM factories /// Create ignored tests by injecting different VM factories
#[macro_export]
macro_rules! evm_test_ignore( macro_rules! evm_test_ignore(
($name_test: ident: $name_jit: ident, $name_int: ident) => { ($name_test: ident: $name_jit: ident, $name_int: ident) => {
#[test] #[test]

View File

@ -1,3 +1,5 @@
//! Blockchain DB extras.
use util::*; use util::*;
use header::BlockNumber; use header::BlockNumber;
use rocksdb::{DB, Writable}; use rocksdb::{DB, Writable};

View File

@ -1,3 +1,5 @@
//! Block header.
use util::*; use util::*;
use basic_types::*; use basic_types::*;
use time::now_utc; use time::now_utc;

View File

@ -2,82 +2,66 @@
#![feature(cell_extras)] #![feature(cell_extras)]
#![feature(augmented_assignments)] #![feature(augmented_assignments)]
#![feature(plugin)] #![feature(plugin)]
//#![plugin(interpolate_idents)]
#![plugin(clippy)] #![plugin(clippy)]
#![allow(needless_range_loop, match_bool)] #![allow(needless_range_loop, match_bool)]
//! Ethcore's ethereum implementation //! Ethcore library
//! //!
//! ### Rust version //! ### Rust version:
//! - beta
//! - nightly //! - nightly
//! //!
//! ### Supported platforms: //! ### Supported platforms:
//! - OSX //! - OSX
//! - Linux/Ubuntu //! - Linux
//! //!
//! ### Dependencies: //! ### Building:
//! - RocksDB 3.13
//! - LLVM 3.7 (optional, required for `jit`)
//! - evmjit (optional, required for `jit`)
//! //!
//! ### Dependencies Installation //! - Ubuntu 14.04 and later:
//! //!
//! - OSX
//!
//! - rocksdb
//! ```bash //! ```bash
//! brew install rocksdb //! # install rocksdb
//! add-apt-repository "deb http://ppa.launchpad.net/giskou/librocksdb/ubuntu trusty main"
//! apt-get update
//! apt-get install -y --force-yes librocksdb
//!
//! # install multirust
//! curl -sf https://raw.githubusercontent.com/brson/multirust/master/blastoff.sh | sh -s -- --yes
//!
//! # install nightly and make it default
//! multirust update nightly && multirust default nightly
//!
//! # export rust LIBRARY_PATH
//! export LIBRARY_PATH=/usr/local/lib
//!
//! # download and build parity
//! git clone https://github.com/ethcore/parity
//! cd parity
//! cargo build --release
//! ``` //! ```
//!
//! - OSX:
//! //!
//! - llvm //! ```bash
//! # install rocksdb && multirust
//! brew update
//! brew install rocksdb
//! brew install multirust
//! //!
//! - download llvm 3.7 from http://llvm.org/apt/ //! # install nightly and make it default
//! multirust update nightly && multirust default nightly
//! //!
//! ```bash //! # export rust LIBRARY_PATH
//! cd llvm-3.7.0.src //! export LIBRARY_PATH=/usr/local/lib
//! mkdir build && cd $_
//! cmake -G "Unix Makefiles" .. -DCMAKE_C_FLAGS_RELEASE= -DCMAKE_CXX_FLAGS_RELEASE= -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/llvm/3.7 -DCMAKE_BUILD_TYPE=Release
//! make && make install
//! ```
//! - evmjit
//! //!
//! - download from https://github.com/debris/evmjit //! # download and build parity
//! //! git clone https://github.com/ethcore/parity
//! ```bash //! cd parity
//! cd evmjit //! cargo build --release
//! mkdir build && cd $_ //! ```
//! cmake -DLLVM_DIR=/usr/local/lib/llvm-3.7/share/llvm/cmake ..
//! make && make install #[macro_use] extern crate log;
//! ``` #[macro_use] extern crate ethcore_util as util;
//! #[macro_use] extern crate lazy_static;
//! - Linux/Ubuntu
//!
//! - rocksdb
//!
//! ```bash
//! wget https://github.com/facebook/rocksdb/archive/rocksdb-3.13.tar.gz
//! tar xvf rocksdb-3.13.tar.gz && cd rocksdb-rocksdb-3.13 && make shared_lib
//! sudo make install
//! ```
//!
//! - llvm
//!
//! - install using packages from http://llvm.org/apt/
//!
//! - evmjit
//!
//! - download from https://github.com/debris/evmjit
//!
//! ```bash
//! cd evmjit
//! mkdir build && cd $_
//! cmake .. && make
//! sudo make install
//! sudo ldconfig
//! ```
#[macro_use]
extern crate log;
extern crate rustc_serialize; extern crate rustc_serialize;
extern crate flate2; extern crate flate2;
extern crate rocksdb; extern crate rocksdb;
@ -86,73 +70,42 @@ extern crate crypto;
extern crate time; extern crate time;
extern crate env_logger; extern crate env_logger;
extern crate num_cpus; extern crate num_cpus;
#[cfg(feature = "jit" )]
extern crate evmjit;
#[macro_use]
extern crate ethcore_util as util;
extern crate crossbeam; extern crate crossbeam;
#[macro_use]
extern crate lazy_static;
// NOTE: Add doc parser exception for these pub declarations. #[cfg(feature = "jit" )] extern crate evmjit;
/// TODO [Gav Wood] Please document me pub mod block;
pub mod common; pub mod blockchain;
/// TODO [Tomusdrw] Please document me pub mod client;
pub mod basic_types;
#[macro_use]
pub mod evm;
pub mod error; pub mod error;
/// TODO [Gav Wood] Please document me pub mod ethereum;
pub mod log_entry;
/// TODO [Gav Wood] Please document me
pub mod env_info;
/// TODO [Gav Wood] Please document me
pub mod pod_account;
/// TODO [Gav Wood] Please document me
pub mod pod_state;
/// TODO [Gav Wood] Please document me
pub mod account_diff;
/// TODO [Gav Wood] Please document me
pub mod state_diff;
/// TODO [Gav Wood] Please document me
pub mod engine;
/// TODO [Gav Wood] Please document me
pub mod state;
/// TODO [Gav Wood] Please document me
pub mod account;
pub mod action_params;
/// TODO [debris] Please document me
pub mod header; pub mod header;
/// TODO [Gav Wood] Please document me pub mod service;
pub mod transaction;
/// TODO [Gav Wood] Please document me
pub mod receipt;
/// TODO [Gav Wood] Please document me
pub mod null_engine;
/// TODO [Gav Wood] Please document me
pub mod builtin;
/// TODO [debris] Please document me
pub mod spec; pub mod spec;
pub mod views; pub mod views;
pub mod blockchain;
/// TODO [Gav Wood] Please document me
pub mod extras;
/// TODO [arkpar] Please document me
pub mod substate;
/// TODO [Gav Wood] Please document me
pub mod service;
pub mod executive;
pub mod externalities;
#[cfg(test)] mod common;
mod tests; mod basic_types;
mod evm;
mod log_entry;
mod env_info;
mod pod_account;
mod pod_state;
mod account_diff;
mod state_diff;
mod engine;
mod state;
mod account;
mod action_params;
mod transaction;
mod receipt;
mod null_engine;
mod builtin;
mod extras;
mod substate;
mod executive;
mod externalities;
mod verification;
mod block_queue;
/// TODO [arkpar] Please document me #[cfg(test)] mod tests;
pub mod client;
/// TODO [arkpar] Please document me
pub mod block;
/// TODO [arkpar] Please document me
pub mod verification;
pub mod block_queue;
pub mod ethereum;

View File

@ -1,3 +1,5 @@
//! Creates and registers client and network services.
use util::*; use util::*;
use spec::Spec; use spec::Spec;
use error::*; use error::*;
@ -109,4 +111,4 @@ mod tests {
let service = ClientService::start(spec, NetworkConfiguration::new()); let service = ClientService::start(spec, NetworkConfiguration::new());
assert!(service.is_ok()); assert!(service.is_ok());
} }
} }

View File

@ -1,3 +1,5 @@
//! Parameters for a block chain.
use common::*; use common::*;
use flate2::read::GzDecoder; use flate2::read::GzDecoder;
use engine::*; use engine::*;

View File

@ -1,3 +1,4 @@
//! Execution environment substate.
use common::*; use common::*;
/// State changes which should be applied in finalize, /// State changes which should be applied in finalize,
@ -57,4 +58,4 @@ mod tests {
assert_eq!(sub_state.sstore_clears_count, x!(12)); assert_eq!(sub_state.sstore_clears_count, x!(12));
assert_eq!(sub_state.suicides.len(), 1); assert_eq!(sub_state.suicides.len(), 1);
} }
} }

View File

@ -1,3 +1,5 @@
//! Transaction data structure.
use util::*; use util::*;
use basic_types::*; use basic_types::*;
use error::*; use error::*;