2017-01-25 18:51:41 +01:00
|
|
|
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
|
2016-02-05 13:40:41 +01:00
|
|
|
// This file is part of Parity.
|
|
|
|
|
|
|
|
// Parity is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
|
|
|
|
// Parity is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2016-01-19 17:02:01 +01:00
|
|
|
#![warn(missing_docs)]
|
2016-02-12 22:01:23 +01:00
|
|
|
#![cfg_attr(feature="dev", feature(plugin))]
|
|
|
|
#![cfg_attr(feature="dev", plugin(clippy))]
|
2016-02-19 11:57:52 +01:00
|
|
|
|
2016-02-15 00:51:50 +01:00
|
|
|
// Clippy settings
|
2016-07-26 20:31:25 +02:00
|
|
|
// Most of the time much more readable
|
2016-02-19 11:57:52 +01:00
|
|
|
#![cfg_attr(feature="dev", allow(needless_range_loop))]
|
2016-02-15 00:51:50 +01:00
|
|
|
// Shorter than if-else
|
2016-02-19 11:57:52 +01:00
|
|
|
#![cfg_attr(feature="dev", allow(match_bool))]
|
2016-02-15 00:51:50 +01:00
|
|
|
// We use that to be more explicit about handled cases
|
2016-02-19 11:57:52 +01:00
|
|
|
#![cfg_attr(feature="dev", allow(match_same_arms))]
|
2016-07-26 20:31:25 +02:00
|
|
|
// Keeps consistency (all lines with `.clone()`).
|
2016-02-19 11:57:52 +01:00
|
|
|
#![cfg_attr(feature="dev", allow(clone_on_copy))]
|
2016-08-17 16:06:41 +02:00
|
|
|
// Some false positives when doing pattern matching.
|
|
|
|
#![cfg_attr(feature="dev", allow(needless_borrow))]
|
2016-05-17 09:34:58 +02:00
|
|
|
// TODO [todr] a lot of warnings to be fixed
|
|
|
|
#![cfg_attr(feature="dev", allow(assign_op_pattern))]
|
|
|
|
|
2016-02-10 12:50:27 +01:00
|
|
|
|
2016-01-17 13:11:25 +01:00
|
|
|
//! Ethcore-util library
|
|
|
|
//!
|
|
|
|
//! ### Rust version:
|
|
|
|
//! - nightly
|
|
|
|
//!
|
|
|
|
//! ### Supported platforms:
|
|
|
|
//! - OSX
|
|
|
|
//! - Linux
|
|
|
|
//!
|
2016-02-01 14:48:38 +01:00
|
|
|
//! ### Building:
|
2016-01-17 13:11:25 +01:00
|
|
|
//!
|
2016-02-01 14:48:38 +01:00
|
|
|
//! - Ubuntu 14.04 and later:
|
2016-01-17 13:11:25 +01:00
|
|
|
//!
|
2016-02-01 14:48:38 +01:00
|
|
|
//! ```bash
|
|
|
|
//! # 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
|
2017-03-29 15:17:27 +02:00
|
|
|
//! git clone https://github.com/paritytech/parity
|
2016-02-01 14:48:38 +01:00
|
|
|
//! cd parity
|
|
|
|
//! cargo build --release
|
|
|
|
//! ```
|
2016-02-09 16:47:21 +01:00
|
|
|
//!
|
2016-01-17 13:11:25 +01:00
|
|
|
//! - OSX:
|
|
|
|
//!
|
|
|
|
//! ```bash
|
2016-02-01 14:48:38 +01:00
|
|
|
//! # install rocksdb && multirust
|
|
|
|
//! brew update
|
2016-01-17 13:11:25 +01:00
|
|
|
//! brew install rocksdb
|
2016-02-01 14:48:38 +01:00
|
|
|
//! brew install multirust
|
2016-01-17 13:11:25 +01:00
|
|
|
//!
|
2016-02-01 14:48:38 +01:00
|
|
|
//! # install nightly and make it default
|
|
|
|
//! multirust update nightly && multirust default nightly
|
2016-01-17 13:11:25 +01:00
|
|
|
//!
|
2016-02-01 14:48:38 +01:00
|
|
|
//! # export rust LIBRARY_PATH
|
|
|
|
//! export LIBRARY_PATH=/usr/local/lib
|
|
|
|
//!
|
|
|
|
//! # download and build parity
|
2017-03-29 15:17:27 +02:00
|
|
|
//! git clone https://github.com/paritytech/parity
|
2016-02-01 14:48:38 +01:00
|
|
|
//! cd parity
|
|
|
|
//! cargo build --release
|
2016-01-17 13:11:25 +01:00
|
|
|
//! ```
|
|
|
|
|
2017-07-06 11:26:14 +02:00
|
|
|
extern crate rustc_hex;
|
2016-01-17 13:11:25 +01:00
|
|
|
extern crate rand;
|
|
|
|
extern crate rocksdb;
|
|
|
|
extern crate env_logger;
|
|
|
|
extern crate crypto as rcrypto;
|
|
|
|
extern crate secp256k1;
|
|
|
|
extern crate elastic_array;
|
2016-08-05 10:32:04 +02:00
|
|
|
extern crate time;
|
2016-02-19 15:18:20 +01:00
|
|
|
extern crate ethcore_devtools as devtools;
|
2016-02-16 02:05:36 +01:00
|
|
|
extern crate libc;
|
2016-02-22 09:04:44 +01:00
|
|
|
extern crate target_info;
|
2016-09-13 15:26:31 +02:00
|
|
|
extern crate ethcore_bigint as bigint;
|
2016-07-13 19:59:59 +02:00
|
|
|
extern crate parking_lot;
|
2016-06-29 17:16:58 +02:00
|
|
|
extern crate ansi_term;
|
2016-08-24 16:53:07 +02:00
|
|
|
extern crate tiny_keccak;
|
2016-09-01 13:36:32 +02:00
|
|
|
extern crate rlp;
|
2016-10-21 23:21:57 +02:00
|
|
|
extern crate regex;
|
2016-10-28 16:04:44 +02:00
|
|
|
extern crate lru_cache;
|
2016-09-01 13:36:32 +02:00
|
|
|
extern crate heapsize;
|
2017-03-22 06:23:40 +01:00
|
|
|
extern crate ethcore_logger;
|
2017-08-30 16:20:21 +02:00
|
|
|
extern crate hash as keccak;
|
2017-02-13 16:38:47 +01:00
|
|
|
|
2016-09-01 13:36:32 +02:00
|
|
|
#[macro_use]
|
|
|
|
extern crate log as rlog;
|
|
|
|
|
2016-01-17 13:11:25 +01:00
|
|
|
#[macro_use]
|
|
|
|
pub mod common;
|
|
|
|
pub mod error;
|
|
|
|
pub mod bytes;
|
|
|
|
pub mod misc;
|
|
|
|
pub mod hashdb;
|
|
|
|
pub mod memorydb;
|
2016-05-24 22:38:11 +02:00
|
|
|
pub mod migration;
|
2016-01-17 13:11:25 +01:00
|
|
|
pub mod overlaydb;
|
2016-01-18 12:41:31 +01:00
|
|
|
pub mod journaldb;
|
2016-02-18 03:46:24 +01:00
|
|
|
pub mod kvdb;
|
2016-01-17 13:11:25 +01:00
|
|
|
pub mod trie;
|
|
|
|
pub mod nibbleslice;
|
2016-07-04 16:57:57 +02:00
|
|
|
pub mod nibblevec;
|
2016-06-13 17:44:50 +02:00
|
|
|
pub mod snappy;
|
2016-10-28 16:04:44 +02:00
|
|
|
pub mod cache;
|
2016-01-17 13:11:25 +01:00
|
|
|
|
|
|
|
pub use misc::*;
|
|
|
|
pub use hashdb::*;
|
2016-10-26 13:53:47 +02:00
|
|
|
pub use memorydb::MemoryDB;
|
2016-01-17 13:11:25 +01:00
|
|
|
pub use overlaydb::*;
|
2016-03-11 14:45:19 +01:00
|
|
|
pub use journaldb::JournalDB;
|
2016-08-03 18:35:48 +02:00
|
|
|
pub use trie::{Trie, TrieMut, TrieDB, TrieDBMut, TrieFactory, TrieError, SecTrieDB, SecTrieDBMut};
|
2016-02-18 03:46:24 +01:00
|
|
|
pub use kvdb::*;
|
2017-07-29 21:56:42 +02:00
|
|
|
pub use error::*;
|
|
|
|
pub use bytes::*;
|
|
|
|
pub use bigint::prelude::*;
|
|
|
|
pub use bigint::hash;
|
|
|
|
|
2016-08-16 10:47:12 +02:00
|
|
|
/// 160-bit integer representing account address
|
2016-08-15 15:09:00 +02:00
|
|
|
pub type Address = H160;
|