light: conditional compilation

This commit is contained in:
Robert Habermeier
2016-12-07 10:50:18 +01:00
parent 60680e1913
commit b38d95328d
7 changed files with 13 additions and 4 deletions

View File

@@ -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())

View File

@@ -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;

View File

@@ -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.
///