From f6b982d7bcc7bc345aa80abdce714510bc583611 Mon Sep 17 00:00:00 2001 From: Joshy Orndorff Date: Tue, 10 May 2022 12:18:56 -0400 Subject: [PATCH] sc-consensus-slots: rename `client` -> `select_chain` (#11375) * rename `client` -> `select_chain` * missed one * `cargo fmt` (only the file I touched) * Missed another one * Revert "`cargo fmt` (only the file I touched)" This reverts commit 96a0c6cd131cdc08013f7ddb9e7bf2af34ae3ee3. * `cargo fmt` (again) (only the LINES I touched) --- substrate/client/consensus/slots/src/slots.rs | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/substrate/client/consensus/slots/src/slots.rs b/substrate/client/consensus/slots/src/slots.rs index a7b9f3e3ff..accf24b6b4 100644 --- a/substrate/client/consensus/slots/src/slots.rs +++ b/substrate/client/consensus/slots/src/slots.rs @@ -91,33 +91,37 @@ impl SlotInfo { } /// A stream that returns every time there is a new slot. -pub(crate) struct Slots { +pub(crate) struct Slots { last_slot: Slot, slot_duration: Duration, inner_delay: Option, create_inherent_data_providers: IDP, - client: C, + select_chain: SC, _phantom: std::marker::PhantomData, } -impl Slots { +impl Slots { /// Create a new `Slots` stream. - pub fn new(slot_duration: Duration, create_inherent_data_providers: IDP, client: C) -> Self { + pub fn new( + slot_duration: Duration, + create_inherent_data_providers: IDP, + select_chain: SC, + ) -> Self { Slots { last_slot: 0.into(), slot_duration, inner_delay: None, create_inherent_data_providers, - client, + select_chain, _phantom: Default::default(), } } } -impl Slots +impl Slots where Block: BlockT, - C: SelectChain, + SC: SelectChain, IDP: CreateInherentDataProviders, IDP::InherentDataProviders: crate::InherentDataProviderExt, { @@ -145,7 +149,7 @@ where let ends_at = Instant::now() + ends_in; - let chain_head = match self.client.best_chain().await { + let chain_head = match self.select_chain.best_chain().await { Ok(x) => x, Err(e) => { log::warn!(