No-ui compilation feature

This commit is contained in:
Tomasz Drwięga
2016-07-12 20:15:36 +02:00
parent b37ceccf02
commit 11cae70cdd
7 changed files with 29 additions and 7 deletions

View File

@@ -51,6 +51,7 @@ extern crate ethcore_util as util;
extern crate ethcore_rpc as rpc;
extern crate jsonrpc_core;
extern crate ws;
#[cfg(not(feature = "no-ui"))]
extern crate parity_dapps_signer as signer;
mod authcode_store;

View File

@@ -17,7 +17,6 @@
//! Session handlers factory.
use ws;
use signer;
use authcode_store::AuthCodes;
use std::path::{PathBuf, Path};
use std::sync::Arc;
@@ -25,6 +24,26 @@ use std::str::FromStr;
use jsonrpc_core::IoHandler;
use util::H256;
#[cfg(not(feature = "no-ui"))]
mod signer {
use signer;
pub fn handle(req: &str) -> Option<signer::File> {
signer::handle(req)
}
}
#[cfg(feature = "no-ui")]
mod signer {
pub struct File {
pub content: String,
pub mime: String,
}
pub fn handle(_req: &str) -> Option<File> {
None
}
}
fn origin_is_allowed(self_origin: &str, header: Option<&[u8]>) -> bool {
match header {
None => false,