mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 19:51:05 +00:00
* Companion for #6726 * Spaces * 'Update substrate' Co-authored-by: parity-processbot <>
This commit is contained in:
@@ -30,25 +30,12 @@ use av_store::{Store as AvailabilityStore, ErasureNetworking};
|
||||
use sc_network_gossip::TopicNotification;
|
||||
use sp_api::{ApiRef, ProvideRuntimeApi};
|
||||
use sp_runtime::traits::Block as BlockT;
|
||||
use sp_core::{crypto::Pair, traits::SpawnNamed};
|
||||
use sp_core::{crypto::Pair, testing::TaskExecutor};
|
||||
use sp_keyring::Sr25519Keyring;
|
||||
|
||||
use futures::executor::{LocalPool, LocalSpawner};
|
||||
use futures::executor::LocalPool;
|
||||
use futures::task::{LocalSpawnExt, SpawnExt};
|
||||
|
||||
#[derive(Clone)]
|
||||
struct Executor(LocalSpawner);
|
||||
|
||||
impl SpawnNamed for Executor {
|
||||
fn spawn(&self, _: &'static str, future: futures::future::BoxFuture<'static, ()>) {
|
||||
self.0.spawn_local(future).unwrap();
|
||||
}
|
||||
|
||||
fn spawn_blocking(&self, name: &'static str, future: futures::future::BoxFuture<'static, ()>) {
|
||||
self.spawn(name, future);
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct MockNetworkOps {
|
||||
recorded: Mutex<Recorded>,
|
||||
@@ -256,7 +243,7 @@ fn test_setup(config: Config) -> (
|
||||
mock_gossip.clone(),
|
||||
api.clone(),
|
||||
worker_rx,
|
||||
Executor(pool.spawner()),
|
||||
TaskExecutor::new(),
|
||||
);
|
||||
|
||||
let service = Service {
|
||||
|
||||
@@ -88,7 +88,7 @@ fn import_single_good_block_without_header_fails() {
|
||||
|
||||
#[test]
|
||||
fn async_import_queue_drops() {
|
||||
let executor = sp_core::testing::SpawnBlockingExecutor::new();
|
||||
let executor = sp_core::testing::TaskExecutor::new();
|
||||
// Perform this test multiple times since it exhibits non-deterministic behavior.
|
||||
for _ in 0..100 {
|
||||
let verifier = PassThroughVerifier::new(true);
|
||||
|
||||
@@ -573,7 +573,7 @@ pub trait TestNetFactory: Sized {
|
||||
Box::new(block_import.clone()),
|
||||
justification_import,
|
||||
finality_proof_import,
|
||||
&sp_core::testing::SpawnBlockingExecutor::new(),
|
||||
&sp_core::testing::TaskExecutor::new(),
|
||||
None,
|
||||
));
|
||||
|
||||
@@ -650,7 +650,7 @@ pub trait TestNetFactory: Sized {
|
||||
Box::new(block_import.clone()),
|
||||
justification_import,
|
||||
finality_proof_import,
|
||||
&sp_core::testing::SpawnBlockingExecutor::new(),
|
||||
&sp_core::testing::TaskExecutor::new(),
|
||||
None,
|
||||
));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user