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)
This commit is contained in:
Joshy Orndorff
2022-05-10 12:18:56 -04:00
committed by GitHub
parent 12d574145a
commit f6b982d7bc
+12 -8
View File
@@ -91,33 +91,37 @@ impl<B: BlockT> SlotInfo<B> {
}
/// A stream that returns every time there is a new slot.
pub(crate) struct Slots<Block, C, IDP> {
pub(crate) struct Slots<Block, SC, IDP> {
last_slot: Slot,
slot_duration: Duration,
inner_delay: Option<Delay>,
create_inherent_data_providers: IDP,
client: C,
select_chain: SC,
_phantom: std::marker::PhantomData<Block>,
}
impl<Block, C, IDP> Slots<Block, C, IDP> {
impl<Block, SC, IDP> Slots<Block, SC, IDP> {
/// 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<Block, C, IDP> Slots<Block, C, IDP>
impl<Block, SC, IDP> Slots<Block, SC, IDP>
where
Block: BlockT,
C: SelectChain<Block>,
SC: SelectChain<Block>,
IDP: CreateInherentDataProviders<Block, ()>,
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!(