ChainSpec trait (#5185)

* ChainSpec trait

* Apply suggestions from code review

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>

* Added docs

* Fixed build

* Fixed build

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
Arkadiy Paronyan
2020-03-12 00:00:10 +01:00
committed by GitHub
parent d2345e8d5c
commit dc0bf210fb
38 changed files with 354 additions and 335 deletions
+6 -6
View File
@@ -79,12 +79,12 @@ fn build_runtime() -> Result<tokio::runtime::Runtime, std::io::Error> {
/// A helper function that runs a future with tokio and stops if the process receives the signal
/// SIGTERM or SIGINT
pub fn run_until_exit<FUT, ERR, G, E, F>(
mut config: Configuration<G, E>,
pub fn run_until_exit<FUT, ERR, F>(
mut config: Configuration,
future_builder: F,
) -> error::Result<()>
where
F: FnOnce(Configuration<G, E>) -> error::Result<FUT>,
F: FnOnce(Configuration) -> error::Result<FUT>,
FUT: Future<Output = Result<(), ERR>> + future::Future,
ERR: 'static + std::error::Error,
{
@@ -106,12 +106,12 @@ where
/// A helper function that runs an `AbstractService` with tokio and stops if the process receives
/// the signal SIGTERM or SIGINT
pub fn run_service_until_exit<T, G, E, F>(
mut config: Configuration<G, E>,
pub fn run_service_until_exit<T, F>(
mut config: Configuration,
service_builder: F,
) -> error::Result<()>
where
F: FnOnce(Configuration<G, E>) -> Result<T, sc_service::error::Error>,
F: FnOnce(Configuration) -> Result<T, sc_service::error::Error>,
T: AbstractService + Unpin,
{
let mut runtime = build_runtime()?;