From b728724318d65bf8d61831aac35c286727b41b60 Mon Sep 17 00:00:00 2001 From: Nazar Mokrynskyi Date: Tue, 29 Aug 2023 12:37:02 +0300 Subject: [PATCH] Make `claim_slot` take `&mut self` (#1225) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bastian Köcher --- substrate/client/consensus/aura/src/lib.rs | 4 ++-- substrate/client/consensus/babe/src/lib.rs | 6 +++--- substrate/client/consensus/slots/src/lib.rs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/substrate/client/consensus/aura/src/lib.rs b/substrate/client/consensus/aura/src/lib.rs index a77f00d08d3e..2ed451ef663e 100644 --- a/substrate/client/consensus/aura/src/lib.rs +++ b/substrate/client/consensus/aura/src/lib.rs @@ -371,7 +371,7 @@ where } async fn claim_slot( - &self, + &mut self, _header: &B::Header, slot: Slot, authorities: &Self::AuxData, @@ -790,7 +790,7 @@ mod tests { let client = peer.client().as_client(); let environ = DummyFactory(client.clone()); - let worker = AuraWorker { + let mut worker = AuraWorker { client: client.clone(), block_import: client, env: environ, diff --git a/substrate/client/consensus/babe/src/lib.rs b/substrate/client/consensus/babe/src/lib.rs index b89fa8f5df65..90b7523ec18b 100644 --- a/substrate/client/consensus/babe/src/lib.rs +++ b/substrate/client/consensus/babe/src/lib.rs @@ -723,12 +723,12 @@ where B: BlockT, C: ProvideRuntimeApi + HeaderBackend + HeaderMetadata, C::Api: BabeApi, - E: Environment + Sync, + E: Environment + Send + Sync, E::Proposer: Proposer, I: BlockImport + Send + Sync + 'static, SO: SyncOracle + Send + Clone + Sync, L: sc_consensus::JustificationSyncLink, - BS: BackoffAuthoringBlocksStrategy> + Sync, + BS: BackoffAuthoringBlocksStrategy> + Send + Sync, Error: std::error::Error + Send + From + From + 'static, { type Claim = (PreDigest, AuthorityId); @@ -769,7 +769,7 @@ where } async fn claim_slot( - &self, + &mut self, _parent_header: &B::Header, slot: Slot, epoch_descriptor: &ViableEpochDescriptor, Epoch>, diff --git a/substrate/client/consensus/slots/src/lib.rs b/substrate/client/consensus/slots/src/lib.rs index 5ee93d168643..12636aae7a44 100644 --- a/substrate/client/consensus/slots/src/lib.rs +++ b/substrate/client/consensus/slots/src/lib.rs @@ -126,7 +126,7 @@ pub trait SimpleSlotWorker { /// Tries to claim the given slot, returning an object with claim data if successful. async fn claim_slot( - &self, + &mut self, header: &B::Header, slot: Slot, aux_data: &Self::AuxData,