Fix light client startup (build_select_chain returns Result<Option>) (#2574)

* fix light client strtup (build_select_chain -> Option)

* fixed node template compilation

* Update core/service/src/lib.rs

Co-Authored-By: Benjamin Kampmann <ben.kampmann@googlemail.com>
This commit is contained in:
Svyatoslav Nikolsky
2019-05-14 14:38:30 +03:00
committed by André Silva
parent 132984adf5
commit 9a14ba0555
5 changed files with 38 additions and 27 deletions
+4 -1
View File
@@ -10,6 +10,7 @@ use substrate_service::{
FactoryFullConfiguration, LightComponents, FullComponents, FullBackend,
FullClient, LightClient, LightBackend, FullExecutor, LightExecutor,
TaskExecutor,
error::{Error as ServiceError, ErrorKind as ServiceErrorKind},
};
use basic_authorship::ProposerFactory;
use consensus::{import_queue, start_aura, AuraImportQueue, SlotDuration, NothingExtra};
@@ -65,11 +66,13 @@ construct_service_factory! {
inherents_pool: service.inherents_pool(),
});
let client = service.client();
let select_chain = service.select_chain()
.ok_or_else(|| ServiceError::from(ServiceErrorKind::SelectChainRequired))?;
executor.spawn(start_aura(
SlotDuration::get_or_compute(&*client)?,
key.clone(),
client.clone(),
service.select_chain(),
select_chain,
client,
proposer,
service.network(),