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:
Robert Habermeier
2020-01-15 21:09:27 +01:00
committed by GitHub
parent ab1be250bc
commit c7069de044
9 changed files with 63 additions and 43 deletions
+5 -2
View File
@@ -34,9 +34,12 @@
//! };
//!
//! // From this factory, we create a `Proposer`.
//! let mut proposer = proposer_factory.init(
//! let proposer = proposer_factory.init(
//! &client.header(&BlockId::number(0)).unwrap().unwrap(),
//! ).unwrap();
//! );
//!
//! // The proposer is created asynchronously.
//! let mut proposer = futures::executor::block_on(proposer).unwrap();
//!
//! // This `Proposer` allows us to create a block proposition.
//! // The proposer will grab transactions from the transaction pool, and put them into the block.