Derive IPC interface only when ipc feature is on (#2463)
* derive -> ipc * accident repair * conditional ipc deriving * fix test
This commit is contained in:
@@ -18,7 +18,7 @@ extern crate ethcore_ipc_codegen;
|
||||
|
||||
fn main() {
|
||||
ethcore_ipc_codegen::derive_binary("src/types/mod.rs.in").unwrap();
|
||||
ethcore_ipc_codegen::derive_ipc("src/client/traits.rs").unwrap();
|
||||
ethcore_ipc_codegen::derive_ipc("src/snapshot/snapshot_service_trait.rs").unwrap();
|
||||
ethcore_ipc_codegen::derive_ipc("src/client/chain_notify.rs").unwrap();
|
||||
ethcore_ipc_codegen::derive_ipc_cond("src/client/traits.rs", cfg!(feature="ipc")).unwrap();
|
||||
ethcore_ipc_codegen::derive_ipc_cond("src/snapshot/snapshot_service_trait.rs", cfg!(feature="ipc")).unwrap();
|
||||
ethcore_ipc_codegen::derive_ipc_cond("src/client/chain_notify.rs", cfg!(feature="ipc")).unwrap();
|
||||
}
|
||||
|
||||
@@ -30,13 +30,20 @@ pub use self::test_client::{TestBlockChainClient, EachBlockWith};
|
||||
pub use types::trace_filter::Filter as TraceFilter;
|
||||
pub use executive::{Executed, Executive, TransactOptions};
|
||||
pub use env_info::{LastHashes, EnvInfo};
|
||||
pub use self::chain_notify::{ChainNotify, ChainNotifyClient};
|
||||
pub use self::chain_notify::ChainNotify;
|
||||
|
||||
pub use types::call_analytics::CallAnalytics;
|
||||
pub use block_import_error::BlockImportError;
|
||||
pub use transaction_import::TransactionImportResult;
|
||||
pub use transaction_import::TransactionImportError;
|
||||
pub use self::traits::{BlockChainClient, MiningBlockChainClient, RemoteClient};
|
||||
pub use self::traits::{BlockChainClient, MiningBlockChainClient};
|
||||
|
||||
/// IPC interfaces
|
||||
#[cfg(feature="ipc")]
|
||||
pub mod remote {
|
||||
pub use super::traits::RemoteClient;
|
||||
pub use super::chain_notify::ChainNotifyClient;
|
||||
}
|
||||
|
||||
mod traits {
|
||||
#![allow(dead_code, unused_assignments, unused_variables, missing_docs)] // codegen issues
|
||||
|
||||
@@ -51,7 +51,7 @@ use rand::{Rng, OsRng};
|
||||
pub use self::error::Error;
|
||||
|
||||
pub use self::service::{Service, DatabaseRestore};
|
||||
pub use self::traits::{SnapshotService, RemoteSnapshotService};
|
||||
pub use self::traits::SnapshotService;
|
||||
pub use self::watcher::Watcher;
|
||||
pub use types::snapshot_manifest::ManifestData;
|
||||
pub use types::restoration_status::RestorationStatus;
|
||||
@@ -67,6 +67,12 @@ mod watcher;
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
/// IPC interfaces
|
||||
#[cfg(feature="ipc")]
|
||||
pub mod remote {
|
||||
pub use super::traits::RemoteSnapshotService;
|
||||
}
|
||||
|
||||
mod traits {
|
||||
#![allow(dead_code, unused_assignments, unused_variables, missing_docs)] // codegen issues
|
||||
include!(concat!(env!("OUT_DIR"), "/snapshot_service_trait.rs"));
|
||||
|
||||
@@ -16,4 +16,5 @@
|
||||
|
||||
pub mod helpers;
|
||||
mod client;
|
||||
#[cfg(feature="ipc")]
|
||||
mod rpc;
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
use nanoipc;
|
||||
use std::sync::Arc;
|
||||
use std::sync::atomic::{Ordering, AtomicBool};
|
||||
use client::{Client, BlockChainClient, ClientConfig, RemoteClient, BlockID};
|
||||
use client::{Client, BlockChainClient, ClientConfig, BlockID};
|
||||
use client::remote::RemoteClient;
|
||||
use tests::helpers::*;
|
||||
use devtools::*;
|
||||
use miner::Miner;
|
||||
|
||||
Reference in New Issue
Block a user