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!(