Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Actually use Fetch for dapps
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomasz Drwięga committed Dec 20, 2016
1 parent 9b226ba commit 7fd62dc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dapps/src/handlers/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
3 changes: 3 additions & 0 deletions parity/dapps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down Expand Up @@ -55,6 +56,7 @@ pub struct Dependencies {
pub client: Arc<Client>,
pub sync: Arc<SyncProvider>,
pub remote: Remote,
pub fetch: FetchClient,
}

pub fn new(configuration: Configuration, deps: Dependencies) -> Result<Option<WebappServer>, String> {
Expand Down Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion parity/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ pub fn execute(cmd: RunCmd, can_restart: bool, logger: Arc<RotatingLogger>) -> 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));

Expand Down

0 comments on commit 7fd62dc

Please sign in to comment.