diff --git a/client/db/src/lib.rs b/client/db/src/lib.rs index ae73f158bdf1d..b72b29c9f6fd0 100644 --- a/client/db/src/lib.rs +++ b/client/db/src/lib.rs @@ -310,7 +310,7 @@ pub fn new_client( E: CodeExecutor + RuntimeInfo, { let backend = Arc::new(Backend::new(settings, CANONICALIZATION_DELAY)?); - let executor = sc_client::LocalCallExecutor::new(backend.clone(), executor, spawn_handle.clone()); + let executor = sc_client::LocalCallExecutor::new(backend.clone(), executor, spawn_handle); Ok(( sc_client::Client::new( backend.clone(), @@ -319,7 +319,6 @@ pub fn new_client( fork_blocks, bad_blocks, execution_extensions, - spawn_handle, prometheus_registry, )?, backend, diff --git a/client/src/client.rs b/client/src/client.rs index 549a7e34941af..78457255522e2 100644 --- a/client/src/client.rs +++ b/client/src/client.rs @@ -99,7 +99,6 @@ pub struct Client where Block: BlockT { importing_block: RwLock>, block_rules: BlockRules, execution_extensions: ExecutionExtensions, - _spawn_handle: Box, _phantom: PhantomData, } @@ -166,7 +165,7 @@ pub fn new_with_backend( Block: BlockT, B: backend::LocalBackend + 'static, { - let call_executor = LocalCallExecutor::new(backend.clone(), executor, spawn_handle.clone()); + let call_executor = LocalCallExecutor::new(backend.clone(), executor, spawn_handle); let extensions = ExecutionExtensions::new(Default::default(), keystore); Client::new( backend, @@ -175,7 +174,6 @@ pub fn new_with_backend( Default::default(), Default::default(), extensions, - spawn_handle, prometheus_registry, ) } @@ -254,7 +252,6 @@ impl Client where fork_blocks: ForkBlocks, bad_blocks: BadBlocks, execution_extensions: ExecutionExtensions, - spawn_handle: Box, _prometheus_registry: Option, ) -> sp_blockchain::Result { if backend.blockchain().header(BlockId::Number(Zero::zero()))?.is_none() { @@ -285,7 +282,6 @@ impl Client where importing_block: Default::default(), block_rules: BlockRules::new(fork_blocks, bad_blocks), execution_extensions, - _spawn_handle: spawn_handle, _phantom: Default::default(), }) } diff --git a/client/src/light/mod.rs b/client/src/light/mod.rs index e67db51cd6880..c7097f1c35535 100644 --- a/client/src/light/mod.rs +++ b/client/src/light/mod.rs @@ -86,7 +86,6 @@ pub fn new_light( Default::default(), Default::default(), Default::default(), - spawn_handle, prometheus_registry, ) } diff --git a/test-utils/client/src/lib.rs b/test-utils/client/src/lib.rs index a069c4cc3ad97..167b360a030a5 100644 --- a/test-utils/client/src/lib.rs +++ b/test-utils/client/src/lib.rs @@ -174,7 +174,6 @@ impl TestClientBuilder( self, executor: Executor, - spawn_handle: Box, ) -> ( sc_client::Client< Backend, @@ -214,7 +213,6 @@ impl TestClientBuilder TestClientBuilder< let executor = executor.into().unwrap_or_else(|| NativeExecutor::new(WasmExecutionMethod::Interpreted, None, 8) ); - let spawn_handle = local_task_executor(); - let executor = LocalCallExecutor::new(self.backend.clone(), executor, spawn_handle.clone()); + let executor = LocalCallExecutor::new(self.backend.clone(), executor, local_task_executor()); - self.build_with_executor(executor, spawn_handle) + self.build_with_executor(executor) } } diff --git a/test-utils/runtime/client/src/lib.rs b/test-utils/runtime/client/src/lib.rs index aa3f1a5b9940e..57a9ede1e0e26 100644 --- a/test-utils/runtime/client/src/lib.rs +++ b/test-utils/runtime/client/src/lib.rs @@ -349,8 +349,7 @@ pub fn new_light() -> ( let blockchain = Arc::new(sc_client::light::blockchain::Blockchain::new(storage)); let backend = Arc::new(LightBackend::new(blockchain.clone())); let executor = new_native_executor(); - let spawn_handle = local_task_executor(); - let local_call_executor = sc_client::LocalCallExecutor::new(backend.clone(), executor, spawn_handle.clone()); + let local_call_executor = sc_client::LocalCallExecutor::new(backend.clone(), executor, local_task_executor()); let call_executor = LightExecutor::new( backend.clone(), local_call_executor, @@ -358,7 +357,7 @@ pub fn new_light() -> ( ( TestClientBuilder::with_backend(backend.clone()) - .build_with_executor(call_executor, spawn_handle) + .build_with_executor(call_executor) .0, backend, )