diff --git a/dapps/src/handlers/fetch.rs b/dapps/src/handlers/fetch.rs index 1b02bcd2189..bf096fe180a 100644 --- a/dapps/src/handlers/fetch.rs +++ b/dapps/src/handlers/fetch.rs @@ -16,7 +16,7 @@ //! Hyper Server Handler that fetches a file during a request (proxy). -use std::fmt; +use std::{fs, fmt}; use std::path::PathBuf; use std::sync::{mpsc, Arc}; use std::sync::atomic::{AtomicBool, Ordering}; diff --git a/parity/dapps.rs b/parity/dapps.rs index 32682e8f63b..7f0550427e2 100644 --- a/parity/dapps.rs +++ b/parity/dapps.rs @@ -21,6 +21,7 @@ use ethcore::client::Client; use ethsync::SyncProvider; use helpers::replace_home; use dir::default_data_path; +use hash_fetch::fetch::Client as FetchClient; use parity_reactor::Remote; #[derive(Debug, PartialEq, Clone)] @@ -55,6 +56,7 @@ pub struct Dependencies { pub client: Arc, pub sync: Arc, pub remote: Remote, + pub fetch: FetchClient, } pub fn new(configuration: Configuration, deps: Dependencies) -> Result, String> { @@ -135,6 +137,7 @@ mod server { ); let sync = deps.sync.clone(); let client = deps.client.clone(); + server.with_fetch(deps.fetch.clone()); server.with_sync_status(Arc::new(move || is_major_importing(Some(sync.status().state), client.queue_info()))); server.with_signer_address(signer_address); diff --git a/parity/run.rs b/parity/run.rs index dd693e22eca..1359a9247f2 100644 --- a/parity/run.rs +++ b/parity/run.rs @@ -376,7 +376,7 @@ pub fn execute(cmd: RunCmd, can_restart: bool, logger: Arc) -> R client: client.clone(), sync: sync_provider.clone(), remote: event_loop.remote(), - // fetch: fetch.clone(), + fetch: fetch.clone(), }; let dapps_server = try!(dapps::new(cmd.dapps_conf.clone(), dapps_deps));