From d74e044be4deefb9a6c01e4d5cb1170e35b1e9c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Thu, 6 Apr 2017 19:32:30 +0200 Subject: [PATCH] Fixing compilation without dapps. (#5410) --- parity/dapps.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/parity/dapps.rs b/parity/dapps.rs index 4cdd1e550..759eb4cde 100644 --- a/parity/dapps.rs +++ b/parity/dapps.rs @@ -82,7 +82,7 @@ impl ContractClient for FullRegistrar { // TODO: light client implementation forwarding to OnDemand and waiting for future // to resolve. pub struct Dependencies { - pub sync_status: Arc<::parity_dapps::SyncStatus>, + pub sync_status: Arc, pub contract_client: Arc, pub remote: parity_reactor::TokioRemote, pub fetch: FetchClient, @@ -103,8 +103,7 @@ pub fn new(configuration: Configuration, deps: Dependencies) ).map(Some) } -pub use self::server::Middleware; -pub use self::server::dapps_middleware; +pub use self::server::{SyncStatus, Middleware, dapps_middleware}; #[cfg(not(feature = "dapps"))] mod server { @@ -112,11 +111,12 @@ mod server { use std::path::PathBuf; use ethcore_rpc::{hyper, RequestMiddleware, RequestMiddlewareAction}; - pub struct Middleware; + pub type SyncStatus = Fn() -> bool; + pub struct Middleware; impl RequestMiddleware for Middleware { fn on_request( - &self, req: &hyper::server::Request, control: &hyper::Control + &self, _req: &hyper::server::Request, _control: &hyper::Control ) -> RequestMiddlewareAction { unreachable!() } @@ -142,6 +142,7 @@ mod server { use parity_reactor; pub type Middleware = parity_dapps::Middleware; + pub use parity_dapps::SyncStatus; pub fn dapps_middleware( deps: Dependencies,