From 895c872a0950ee1232e0b31ca416d28f18fc64b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Silva?= Date: Wed, 21 Aug 2019 16:42:04 +0200 Subject: [PATCH] aura: keystore is required for authoring (#3449) --- substrate/core/consensus/aura/src/lib.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/substrate/core/consensus/aura/src/lib.rs b/substrate/core/consensus/aura/src/lib.rs index 3d4148c52d..406874eafb 100644 --- a/substrate/core/consensus/aura/src/lib.rs +++ b/substrate/core/consensus/aura/src/lib.rs @@ -138,7 +138,7 @@ pub fn start_aura( sync_oracle: SO, inherent_data_providers: InherentDataProviders, force_authoring: bool, - keystore: Option, + keystore: KeyStorePtr, ) -> Result, consensus_common::Error> where B: BlockT, C: ProvideRuntimeApi + BlockOf + ProvideCache + AuxStore + Send + Sync, @@ -182,7 +182,7 @@ struct AuraWorker { client: Arc, block_import: Arc>, env: E, - keystore: Option, + keystore: KeyStorePtr, sync_oracle: SO, force_authoring: bool, _key_type: PhantomData

, @@ -234,9 +234,8 @@ impl slots::SimpleSlotWorker for AuraWorker(slot_number, epoch_data); expected_author.and_then(|p| { - self.keystore.as_ref().and_then(|k| { - k.read().key_pair_by_type::

(&p, app_crypto::key_types::AURA).ok() - }) + self.keystore.read() + .key_pair_by_type::

(&p, app_crypto::key_types::AURA).ok() }) } @@ -833,7 +832,7 @@ mod tests { DummyOracle, inherent_data_providers, false, - Some(keystore), + keystore, ).expect("Starts aura"); runtime.spawn(aura);