mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 20:27:58 +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
@@ -74,13 +74,16 @@ pub enum BlockStatus {
|
||||
/// Environment producer for a Consensus instance. Creates proposer instance and communication streams.
|
||||
pub trait Environment<B: BlockT> {
|
||||
/// The proposer type this creates.
|
||||
type Proposer: Proposer<B> + 'static;
|
||||
type Proposer: Proposer<B> + Send + 'static;
|
||||
/// A future that resolves to the proposer.
|
||||
type CreateProposer: Future<Output = Result<Self::Proposer, Self::Error>>
|
||||
+ Send + Unpin + 'static;
|
||||
/// Error which can occur upon creation.
|
||||
type Error: From<Error> + std::fmt::Debug + 'static;
|
||||
|
||||
/// Initialize the proposal logic on top of a specific header. Provide
|
||||
/// the authorities at that header.
|
||||
fn init(&mut self, parent_header: &B::Header) -> Result<Self::Proposer, Self::Error>;
|
||||
fn init(&mut self, parent_header: &B::Header) -> Self::CreateProposer;
|
||||
}
|
||||
|
||||
/// A proposal that is created by a [`Proposer`].
|
||||
|
||||
Reference in New Issue
Block a user