mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-23 17:51:09 +00:00
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:
@@ -91,33 +91,37 @@ impl<B: BlockT> SlotInfo<B> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// A stream that returns every time there is a new slot.
|
/// 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,
|
last_slot: Slot,
|
||||||
slot_duration: Duration,
|
slot_duration: Duration,
|
||||||
inner_delay: Option<Delay>,
|
inner_delay: Option<Delay>,
|
||||||
create_inherent_data_providers: IDP,
|
create_inherent_data_providers: IDP,
|
||||||
client: C,
|
select_chain: SC,
|
||||||
_phantom: std::marker::PhantomData<Block>,
|
_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.
|
/// 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 {
|
Slots {
|
||||||
last_slot: 0.into(),
|
last_slot: 0.into(),
|
||||||
slot_duration,
|
slot_duration,
|
||||||
inner_delay: None,
|
inner_delay: None,
|
||||||
create_inherent_data_providers,
|
create_inherent_data_providers,
|
||||||
client,
|
select_chain,
|
||||||
_phantom: Default::default(),
|
_phantom: Default::default(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<Block, C, IDP> Slots<Block, C, IDP>
|
impl<Block, SC, IDP> Slots<Block, SC, IDP>
|
||||||
where
|
where
|
||||||
Block: BlockT,
|
Block: BlockT,
|
||||||
C: SelectChain<Block>,
|
SC: SelectChain<Block>,
|
||||||
IDP: CreateInherentDataProviders<Block, ()>,
|
IDP: CreateInherentDataProviders<Block, ()>,
|
||||||
IDP::InherentDataProviders: crate::InherentDataProviderExt,
|
IDP::InherentDataProviders: crate::InherentDataProviderExt,
|
||||||
{
|
{
|
||||||
@@ -145,7 +149,7 @@ where
|
|||||||
|
|
||||||
let ends_at = Instant::now() + ends_in;
|
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,
|
Ok(x) => x,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
log::warn!(
|
log::warn!(
|
||||||
|
|||||||
Reference in New Issue
Block a user