mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-11-02 00:41:07 +00:00
Use SpawnNamed instead of Spawn in Overseer (#1430)
* Use SpawnNamed instead of Spawn in Overseer * reexport SpawnNamed and fix doc tests * Fix deps
This commit is contained in:
1 parent
04f9c6ece8
commit
5624bd8bf4
19 files changed
+245
-172
No files matched your search
@@ -184,7 +184,10 @@ impl<Net, Context> Subsystem<Context> for NetworkBridge<Net>
|
||||
fn start(self, ctx: Context) -> SpawnedSubsystem {
|
||||
// Swallow error because failure is fatal to the node and we log with more precision
|
||||
// within `run_network`.
|
||||
SpawnedSubsystem(run_network(self.0, ctx).map(|_| ()).boxed())
|
||||
SpawnedSubsystem {
|
||||
name: "network-bridge-subsystem",
|
||||
future: run_network(self.0, ctx).map(|_| ()).boxed(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -521,7 +524,7 @@ async fn run_network<N: Network>(
|
||||
mod tests {
|
||||
use super::*;
|
||||
use futures::channel::mpsc;
|
||||
use futures::executor::{self, ThreadPool};
|
||||
use futures::executor;
|
||||
|
||||
use std::sync::Arc;
|
||||
use parking_lot::Mutex;
|
||||
@@ -632,8 +635,7 @@ mod tests {
|
||||
}
|
||||
|
||||
fn test_harness<T: Future<Output=()>>(test: impl FnOnce(TestHarness) -> T) {
|
||||
let pool = ThreadPool::new().unwrap();
|
||||
|
||||
let pool = sp_core::testing::SpawnBlockingExecutor::new();
|
||||
let (network, network_handle) = new_test_network();
|
||||
let (context, virtual_overseer) = subsystem_test::make_subsystem_context(pool);
|
||||
|
||||
|
||||
Reference in new issue
Block a user