From f4a52a3e8e3d1eb04934f57812634ef5c3033807 Mon Sep 17 00:00:00 2001 From: Ashley Ruglys Date: Fri, 19 Jun 2020 15:20:34 +0200 Subject: [PATCH] Fix browser node compilation --- cli/src/browser.rs | 4 ++-- cli/src/command.rs | 6 +++--- service/src/lib.rs | 23 ++++++++++++++++------- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/cli/src/browser.rs b/cli/src/browser.rs index 6f3a4000843a..78707e2e154e 100644 --- a/cli/src/browser.rs +++ b/cli/src/browser.rs @@ -46,8 +46,8 @@ async fn start_inner(chain_spec: String, log_level: String) -> Result Result<()> { runtime.run_node( |config| { - service::kusama_new_light(config) + service::kusama_new_light(config).map(|(components, _)| components) }, |config| { service::kusama_new_full( @@ -136,7 +136,7 @@ pub fn run() -> Result<()> { } else if chain_spec.is_westend() { runtime.run_node( |config| { - service::westend_new_light(config) + service::westend_new_light(config).map(|(components, _)| components) }, |config| { service::westend_new_full( @@ -154,7 +154,7 @@ pub fn run() -> Result<()> { } else { runtime.run_node( |config| { - service::polkadot_new_light(config) + service::polkadot_new_light(config).map(|(components, _)| components) }, |config| { service::polkadot_new_full( diff --git a/service/src/lib.rs b/service/src/lib.rs index 8d055d100130..33b87c56bbeb 100644 --- a/service/src/lib.rs +++ b/service/src/lib.rs @@ -30,7 +30,7 @@ use grandpa::{self, FinalityProofProvider as GrandpaFinalityProofProvider}; use sc_executor::native_executor_instance; use log::info; pub use service::{ - Role, PruningMode, TransactionPoolOptions, Error, RuntimeGenesis, + Role, PruningMode, TransactionPoolOptions, Error, RuntimeGenesis, RpcHandlers, TFullClient, TLightClient, TFullBackend, TLightBackend, TFullCallExecutor, TLightCallExecutor, Configuration, ChainSpec, ServiceBuilderCommand, ServiceComponents, KeepAliveServiceComponents, }; @@ -635,9 +635,12 @@ macro_rules! new_light { })? .build_light() .map(|ServiceComponents { task_manager, telemetry, base_path, rpc, rpc_handlers, .. }| { - KeepAliveServiceComponents { - task_manager, other: Box::new((telemetry, base_path, rpc, rpc_handlers)) - } + ( + KeepAliveServiceComponents { + task_manager, other: Box::new((telemetry, base_path, rpc)) + }, + rpc_handlers, + ) }) }} } @@ -777,19 +780,25 @@ pub struct FullNodeHandles { } /// Create a new Polkadot service for a light client. -pub fn polkadot_new_light(mut config: Configuration) -> Result +pub fn polkadot_new_light(mut config: Configuration) -> Result< + (KeepAliveServiceComponents, RpcHandlers), ServiceError +> { new_light!(config, polkadot_runtime::RuntimeApi, PolkadotExecutor) } /// Create a new Kusama service for a light client. -pub fn kusama_new_light(mut config: Configuration) -> Result +pub fn kusama_new_light(mut config: Configuration) -> Result< + (KeepAliveServiceComponents, RpcHandlers), ServiceError +> { new_light!(config, kusama_runtime::RuntimeApi, KusamaExecutor) } /// Create a new Westend service for a light client. -pub fn westend_new_light(mut config: Configuration, ) -> Result +pub fn westend_new_light(mut config: Configuration, ) -> Result< + (KeepAliveServiceComponents, RpcHandlers), ServiceError +> { new_light!(config, westend_runtime::RuntimeApi, KusamaExecutor) }