Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
minimize
Browse files Browse the repository at this point in the history
  • Loading branch information
NikVolf committed Mar 14, 2020
1 parent 17903d2 commit 7dfa665
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 16 deletions.
3 changes: 1 addition & 2 deletions client/db/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ pub fn new_client<E, Block, RA>(
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(),
Expand All @@ -319,7 +319,6 @@ pub fn new_client<E, Block, RA>(
fork_blocks,
bad_blocks,
execution_extensions,
spawn_handle,
prometheus_registry,
)?,
backend,
Expand Down
6 changes: 1 addition & 5 deletions client/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ pub struct Client<B, E, Block, RA> where Block: BlockT {
importing_block: RwLock<Option<Block::Hash>>,
block_rules: BlockRules<Block>,
execution_extensions: ExecutionExtensions<Block>,
_spawn_handle: Box<dyn ClonableSpawn>,
_phantom: PhantomData<RA>,
}

Expand Down Expand Up @@ -166,7 +165,7 @@ pub fn new_with_backend<B, E, Block, S, RA>(
Block: BlockT,
B: backend::LocalBackend<Block> + '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,
Expand All @@ -175,7 +174,6 @@ pub fn new_with_backend<B, E, Block, S, RA>(
Default::default(),
Default::default(),
extensions,
spawn_handle,
prometheus_registry,
)
}
Expand Down Expand Up @@ -254,7 +252,6 @@ impl<B, E, Block, RA> Client<B, E, Block, RA> where
fork_blocks: ForkBlocks<Block>,
bad_blocks: BadBlocks<Block>,
execution_extensions: ExecutionExtensions<Block>,
spawn_handle: Box<dyn ClonableSpawn>,
_prometheus_registry: Option<Registry>,
) -> sp_blockchain::Result<Self> {
if backend.blockchain().header(BlockId::Number(Zero::zero()))?.is_none() {
Expand Down Expand Up @@ -285,7 +282,6 @@ impl<B, E, Block, RA> Client<B, E, Block, RA> where
importing_block: Default::default(),
block_rules: BlockRules::new(fork_blocks, bad_blocks),
execution_extensions,
_spawn_handle: spawn_handle,
_phantom: Default::default(),
})
}
Expand Down
1 change: 0 additions & 1 deletion client/src/light/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ pub fn new_light<B, S, RA, E>(
Default::default(),
Default::default(),
Default::default(),
spawn_handle,
prometheus_registry,
)
}
Expand Down
7 changes: 2 additions & 5 deletions test-utils/client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ impl<Block: BlockT, Executor, Backend, G: GenesisInit> TestClientBuilder<Block,
pub fn build_with_executor<RuntimeApi>(
self,
executor: Executor,
spawn_handle: Box<dyn ClonableSpawn>,
) -> (
sc_client::Client<
Backend,
Expand Down Expand Up @@ -214,7 +213,6 @@ impl<Block: BlockT, Executor, Backend, G: GenesisInit> TestClientBuilder<Block,
self.execution_strategies,
self.keystore.clone(),
),
spawn_handle,
None,
).expect("Creates new client");

Expand Down Expand Up @@ -282,9 +280,8 @@ impl<Block: BlockT, E, Backend, G: GenesisInit> 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)
}
}
5 changes: 2 additions & 3 deletions test-utils/runtime/client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,16 +349,15 @@ 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,
);

(
TestClientBuilder::with_backend(backend.clone())
.build_with_executor(call_executor, spawn_handle)
.build_with_executor(call_executor)
.0,
backend,
)
Expand Down

0 comments on commit 7dfa665

Please sign in to comment.