diff --git a/substrate/core/consensus/aura/src/lib.rs b/substrate/core/consensus/aura/src/lib.rs index fd33228b66..256bcd43a4 100644 --- a/substrate/core/consensus/aura/src/lib.rs +++ b/substrate/core/consensus/aura/src/lib.rs @@ -79,9 +79,7 @@ pub trait Network: Clone { } /// Get slot author for given block along with authorities. -fn slot_author(slot_num: u64, authorities: &[AuthorityId

]) -> Option> - where P::Public: Clone, -{ +fn slot_author(slot_num: u64, authorities: &[AuthorityId

]) -> Option<&AuthorityId

> { if authorities.is_empty() { return None } let idx = slot_num % (authorities.len() as u64); @@ -90,10 +88,9 @@ fn slot_author(slot_num: u64, authorities: &[AuthorityId

]) -> Option let current_author = authorities.get(idx as usize) .expect("authorities not empty; index constrained to list length;\ - this is a valid index; qed") - .clone(); + this is a valid index; qed"); - Some(current_author.clone()) + Some(current_author) } fn duration_now() -> Option { @@ -235,13 +232,12 @@ pub fn start_aura( E::Proposer: Proposer, <>::Create as IntoFuture>::Future: Send + 'static, I: BlockImport + Send + Sync + 'static, - Error: From, P: Pair + Send + Sync + 'static, P::Public: Hash + Eq + Send + Sync + Clone + Debug + Encode + Decode + 'static, P::Signature: Encode, SO: SyncOracle + Send + Sync + Clone, DigestItemFor: CompatibleDigestItem

+ DigestItem>, - Error: ::std::error::Error + Send + 'static + From<::consensus_common::Error>, + Error: ::std::error::Error + Send + From<::consensus_common::Error> + From + 'static, OnExit: Future, { let worker = AuraWorker { @@ -283,10 +279,9 @@ impl SlotWorker for AuraWorker, SO: SyncOracle + Send + Clone, DigestItemFor: CompatibleDigestItem

+ DigestItem>, - Error: ::std::error::Error + Send + 'static + From<::consensus_common::Error>, + Error: ::std::error::Error + Send + From<::consensus_common::Error> + From + 'static, { type OnSlot = Box + Send>; @@ -336,7 +331,7 @@ impl SlotWorker for AuraWorker(slot_num, &authorities); let proposal_work = match maybe_author { None => return Box::new(future::ok(())), - Some(author) => if author == public_key { + Some(author) => if author == &public_key { debug!( target: "aura", "Starting authorship at slot {}; timestamp = {}", slot_num, @@ -449,7 +444,7 @@ fn check_header( allow_old_seals: bool, ) -> Result, String> where DigestItemFor: CompatibleDigestItem

, - P::Public: Clone + AsRef, + P::Public: AsRef, P::Signature: Decode, { let digest_item = match header.digest_mut().pop() {