Remove the dapps system (#9017)

* Remove the dapps system from Parity

* Move node-health outside of dapps

* Fix set dapps list test

* Update Cargo.lock

* Deprecate options

* Add _legacy_ prefixes in Dapps

* Fix tests

* Fix deprecatedness of dapps-path
This commit is contained in:
Pierre Krieger
2018-07-11 12:19:54 +02:00
committed by Afri Schoedon
parent fe678dcd2f
commit 494eb4ab6b
79 changed files with 165 additions and 6105 deletions

View File

@@ -131,14 +131,41 @@ use http::tokio_core;
pub type HttpServer = http::Server;
/// Start http server asynchronously and returns result with `Server` handle on success or an error.
pub fn start_http<M, S, H, T, R>(
pub fn start_http<M, S, H, T>(
addr: &SocketAddr,
cors_domains: http::DomainsValidation<http::AccessControlAllowOrigin>,
allowed_hosts: http::DomainsValidation<http::Host>,
handler: H,
remote: tokio_core::reactor::Remote,
extractor: T,
middleware: Option<R>,
threads: usize,
max_payload: usize,
) -> ::std::io::Result<HttpServer> where
M: jsonrpc_core::Metadata,
S: jsonrpc_core::Middleware<M>,
H: Into<jsonrpc_core::MetaIoHandler<M, S>>,
T: HttpMetaExtractor<Metadata=M>,
{
let extractor = http_common::MetaExtractor::new(extractor);
Ok(http::ServerBuilder::with_meta_extractor(handler, extractor)
.threads(threads)
.event_loop_remote(remote)
.cors(cors_domains.into())
.allowed_hosts(allowed_hosts.into())
.max_request_body_size(max_payload * 1024 * 1024)
.start_http(addr)?)
}
/// Same as `start_http`, but takes an additional `middleware` parameter that is introduced as a
/// hyper middleware.
pub fn start_http_with_middleware<M, S, H, T, R>(
addr: &SocketAddr,
cors_domains: http::DomainsValidation<http::AccessControlAllowOrigin>,
allowed_hosts: http::DomainsValidation<http::Host>,
handler: H,
remote: tokio_core::reactor::Remote,
extractor: T,
middleware: R,
threads: usize,
max_payload: usize,
) -> ::std::io::Result<HttpServer> where
@@ -149,18 +176,14 @@ pub fn start_http<M, S, H, T, R>(
R: RequestMiddleware,
{
let extractor = http_common::MetaExtractor::new(extractor);
let mut builder = http::ServerBuilder::with_meta_extractor(handler, extractor)
Ok(http::ServerBuilder::with_meta_extractor(handler, extractor)
.threads(threads)
.event_loop_remote(remote)
.cors(cors_domains.into())
.allowed_hosts(allowed_hosts.into())
.max_request_body_size(max_payload * 1024 * 1024);
if let Some(dapps) = middleware {
builder = builder.request_middleware(dapps)
}
Ok(builder.start_http(addr)?)
.max_request_body_size(max_payload * 1024 * 1024)
.request_middleware(middleware)
.start_http(addr)?)
}
/// Start ipc server asynchronously and returns result with `Server` handle on success or an error.