diff --git a/substrate/client/consensus/slots/src/lib.rs b/substrate/client/consensus/slots/src/lib.rs index d851753921..62b6b452eb 100644 --- a/substrate/client/consensus/slots/src/lib.rs +++ b/substrate/client/consensus/slots/src/lib.rs @@ -71,14 +71,15 @@ pub struct SlotResult { /// The implementation should not make any assumptions of the slot being bound to the time or /// similar. The only valid assumption is that the slot number is always increasing. pub trait SlotWorker { - /// The type of the future that will be returned when a new slot is triggered. - type OnSlot: Future>>; - /// Called when a new slot is triggered. /// /// Returns a future that resolves to a [`SlotResult`] iff a block was successfully built in /// the slot. Otherwise `None` is returned. - fn on_slot(&mut self, chain_head: B::Header, slot_info: SlotInfo) -> Self::OnSlot; + fn on_slot( + &mut self, + chain_head: B::Header, + slot_info: SlotInfo, + ) -> Pin>> + Send>>; } /// A skeleton implementation for `SlotWorker` which tries to claim a slot at @@ -383,9 +384,11 @@ pub trait SimpleSlotWorker { } impl> SlotWorker for T { - type OnSlot = Pin>> + Send>>; - - fn on_slot(&mut self, chain_head: B::Header, slot_info: SlotInfo) -> Self::OnSlot { + fn on_slot( + &mut self, + chain_head: B::Header, + slot_info: SlotInfo, + ) -> Pin>> + Send>> { SimpleSlotWorker::on_slot(self, chain_head, slot_info) } } @@ -416,7 +419,6 @@ where B: BlockT, C: SelectChain, W: SlotWorker, - W::OnSlot: Unpin, SO: SyncOracle + Send, SC: SlotCompatible + Unpin, T: SlotData + Clone,