Fixing compilation without dapps. (#5410)

This commit is contained in:
Tomasz Drwięga 2017-04-06 19:32:30 +02:00 committed by Arkadiy Paronyan
parent 89a4cb08e8
commit d74e044be4

View File

@ -82,7 +82,7 @@ impl ContractClient for FullRegistrar {
// TODO: light client implementation forwarding to OnDemand and waiting for future // TODO: light client implementation forwarding to OnDemand and waiting for future
// to resolve. // to resolve.
pub struct Dependencies { pub struct Dependencies {
pub sync_status: Arc<::parity_dapps::SyncStatus>, pub sync_status: Arc<SyncStatus>,
pub contract_client: Arc<ContractClient>, pub contract_client: Arc<ContractClient>,
pub remote: parity_reactor::TokioRemote, pub remote: parity_reactor::TokioRemote,
pub fetch: FetchClient, pub fetch: FetchClient,
@ -103,8 +103,7 @@ pub fn new(configuration: Configuration, deps: Dependencies)
).map(Some) ).map(Some)
} }
pub use self::server::Middleware; pub use self::server::{SyncStatus, Middleware, dapps_middleware};
pub use self::server::dapps_middleware;
#[cfg(not(feature = "dapps"))] #[cfg(not(feature = "dapps"))]
mod server { mod server {
@ -112,11 +111,12 @@ mod server {
use std::path::PathBuf; use std::path::PathBuf;
use ethcore_rpc::{hyper, RequestMiddleware, RequestMiddlewareAction}; use ethcore_rpc::{hyper, RequestMiddleware, RequestMiddlewareAction};
pub struct Middleware; pub type SyncStatus = Fn() -> bool;
pub struct Middleware;
impl RequestMiddleware for Middleware { impl RequestMiddleware for Middleware {
fn on_request( fn on_request(
&self, req: &hyper::server::Request<hyper::net::HttpStream>, control: &hyper::Control &self, _req: &hyper::server::Request<hyper::net::HttpStream>, _control: &hyper::Control
) -> RequestMiddlewareAction { ) -> RequestMiddlewareAction {
unreachable!() unreachable!()
} }
@ -142,6 +142,7 @@ mod server {
use parity_reactor; use parity_reactor;
pub type Middleware = parity_dapps::Middleware<FetchClient>; pub type Middleware = parity_dapps::Middleware<FetchClient>;
pub use parity_dapps::SyncStatus;
pub fn dapps_middleware( pub fn dapps_middleware(
deps: Dependencies, deps: Dependencies,