mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 02:21:14 +00:00
Make Proposer instantiation potentially async. (#4630)
* Make Proposer instantiation potentially async. * fix node-service test * fix basic-authority doc-test * only block once on futures in test * use async/await
This commit is contained in:
committed by
GitHub
parent
ab1be250bc
commit
c7069de044
@@ -363,6 +363,9 @@ impl<B, C, E, I, Error, SO> sc_consensus_slots::SimpleSlotWorker<B> for BabeWork
|
||||
type EpochData = Epoch;
|
||||
type Claim = (BabePreDigest, AuthorityPair);
|
||||
type SyncOracle = SO;
|
||||
type CreateProposer = Pin<Box<
|
||||
dyn Future<Output = Result<E::Proposer, sp_consensus::Error>> + Send + 'static
|
||||
>>;
|
||||
type Proposer = E::Proposer;
|
||||
type BlockImport = I;
|
||||
|
||||
@@ -466,10 +469,10 @@ impl<B, C, E, I, Error, SO> sc_consensus_slots::SimpleSlotWorker<B> for BabeWork
|
||||
&mut self.sync_oracle
|
||||
}
|
||||
|
||||
fn proposer(&mut self, block: &B::Header) -> Result<Self::Proposer, sp_consensus::Error> {
|
||||
self.env.init(block).map_err(|e| {
|
||||
fn proposer(&mut self, block: &B::Header) -> Self::CreateProposer {
|
||||
Box::pin(self.env.init(block).map_err(|e| {
|
||||
sp_consensus::Error::ClientImport(format!("{:?}", e))
|
||||
})
|
||||
}))
|
||||
}
|
||||
|
||||
fn proposing_remaining_duration(
|
||||
|
||||
Reference in New Issue
Block a user