light: conditional compilation
This commit is contained in:
parent
60680e1913
commit
b38d95328d
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -298,7 +298,6 @@ dependencies = [
|
||||
"ethcore-ipc 1.4.0",
|
||||
"ethcore-ipc-codegen 1.4.0",
|
||||
"ethcore-ipc-nano 1.4.0",
|
||||
"ethcore-network 1.5.0",
|
||||
"ethcore-util 1.5.0",
|
||||
"ethjson 0.1.0",
|
||||
"ethkey 0.2.0",
|
||||
|
@ -80,6 +80,7 @@ ethstore-cli = ["ethcore/ethstore-cli"]
|
||||
evm-debug = ["ethcore/evm-debug"]
|
||||
evm-debug-tests = ["ethcore/evm-debug-tests"]
|
||||
slow-blocks = ["ethcore/slow-blocks"]
|
||||
light = ["ethcore/light"]
|
||||
|
||||
[[bin]]
|
||||
path = "parity/main.rs"
|
||||
|
@ -58,5 +58,6 @@ dev = ["clippy"]
|
||||
default = []
|
||||
benches = []
|
||||
ipc = []
|
||||
light = []
|
||||
ethkey-cli = ["ethkey/cli"]
|
||||
ethstore-cli = ["ethstore/cli"]
|
||||
|
@ -52,7 +52,7 @@ use blockchain::{BlockChain, BlockProvider, TreeRoute, ImportRoute};
|
||||
use client::{
|
||||
BlockID, TransactionID, UncleID, TraceId, ClientConfig, BlockChainClient,
|
||||
MiningBlockChainClient, TraceFilter, CallAnalytics, BlockImportError, Mode,
|
||||
ChainNotify, PruningInfo, ProvingBlockChainClient,
|
||||
ChainNotify, PruningInfo,
|
||||
};
|
||||
use client::Error as ClientError;
|
||||
use env_info::EnvInfo;
|
||||
@ -1377,7 +1377,8 @@ impl MayPanic for Client {
|
||||
}
|
||||
}
|
||||
|
||||
impl ProvingBlockChainClient for Client {
|
||||
#[cfg(feature = "light")]
|
||||
impl ::client::ProvingBlockChainClient for Client {
|
||||
fn prove_storage(&self, key1: H256, key2: H256, from_level: u32, id: BlockID) -> Vec<Bytes> {
|
||||
self.state_at(id)
|
||||
.and_then(move |state| state.prove_storage(key1, key2, from_level).ok())
|
||||
|
@ -27,7 +27,10 @@ pub use self::config::{Mode, ClientConfig, DatabaseCompactionProfile, BlockChain
|
||||
pub use self::error::Error;
|
||||
pub use self::test_client::{TestBlockChainClient, EachBlockWith};
|
||||
pub use self::chain_notify::ChainNotify;
|
||||
pub use self::traits::{BlockChainClient, MiningBlockChainClient, ProvingBlockChainClient};
|
||||
pub use self::traits::{BlockChainClient, MiningBlockChainClient};
|
||||
|
||||
#[cfg(feature = "light")]
|
||||
pub use self::traits::ProvingBlockChainClient;
|
||||
|
||||
pub use types::ids::*;
|
||||
pub use types::trace_filter::Filter as TraceFilter;
|
||||
|
@ -278,6 +278,7 @@ pub trait MiningBlockChainClient: BlockChainClient {
|
||||
}
|
||||
|
||||
/// Extended client interface for providing proofs of the state.
|
||||
#[cfg(feature = "light")]
|
||||
pub trait ProvingBlockChainClient: BlockChainClient {
|
||||
/// Prove account storage at a specific block id.
|
||||
///
|
||||
|
@ -31,6 +31,8 @@ use transaction::SignedTransaction;
|
||||
use state_db::StateDB;
|
||||
|
||||
use util::*;
|
||||
|
||||
#[cfg(feature = "light")]
|
||||
use util::trie::recorder::{Recorder, BasicRecorder as TrieRecorder};
|
||||
|
||||
mod account;
|
||||
@ -762,6 +764,7 @@ impl State {
|
||||
}
|
||||
|
||||
// LES state proof implementations.
|
||||
#[cfg(feature = "light")]
|
||||
impl State {
|
||||
/// Prove an account's existence or nonexistence in the state trie.
|
||||
/// Returns a merkle proof of the account's trie node with all nodes before `from_level`
|
||||
|
Loading…
Reference in New Issue
Block a user