grandpa: speed up tests (#8439)

* grandpa: tests: add peers with authority role

* grandpa: tests: manually wake-up poll_fn future
This commit is contained in:
André Silva
2021-03-24 08:56:25 +00:00
committed by GitHub
parent d98a3c7942
commit ee8e7f1bcd
3 changed files with 49 additions and 23 deletions
+3 -1
View File
@@ -610,6 +610,8 @@ pub struct FullPeerConfig {
///
/// If `None`, it will be connected to all other peers.
pub connect_to_peers: Option<Vec<usize>>,
/// Whether the full peer should have the authority role.
pub is_authority: bool,
}
pub trait TestNetFactory: Sized {
@@ -743,7 +745,7 @@ pub trait TestNetFactory: Sized {
};
let network = NetworkWorker::new(sc_network::config::Params {
role: Role::Full,
role: if config.is_authority { Role::Authority } else { Role::Full },
executor: None,
transactions_handler_executor: Box::new(|task| { async_std::task::spawn(task); }),
network_config,