Commit 0070028f authored by Cecile Tonglet's avatar Cecile Tonglet
Browse files

WIP

Forked at: e9164236
Parent branch: origin/rococo-branch
parent 5caaaeb9
Pipeline #103764 canceled with stages
in 5 minutes and 35 seconds
......@@ -67,7 +67,7 @@ pub fn polkadot_test_new_full(
) -> Result<
(
TaskManager,
Arc<FullClient<polkadot_test_runtime::RuntimeApi, PolkadotTestExecutor>>,
Arc<polkadot_service::FullClient<polkadot_test_runtime::RuntimeApi, PolkadotTestExecutor>>,
FullNodeHandles,
Arc<NetworkService<Block, Hash>>,
Arc<RpcHandlers>,
......@@ -88,17 +88,12 @@ pub fn polkadot_test_new_full(
Ok((task_manager, client, handles, network, rpc_handlers))
}
// TODO: that comes from service, make it public?
type FullClient<RuntimeApi, Executor> = service::TFullClient<Block, RuntimeApi, Executor>;
/// A wrapper for the test client that implements YaExecuteWithClient.
pub struct TestClient(pub Arc<FullClient<polkadot_test_runtime::RuntimeApi, PolkadotTestExecutor>>);
// TODO: that comes from service, make it public?
type FullBackend = service::TFullBackend<Block>;
/// A wrapper for the test client that implements `YaExecuteWithClient`.
pub struct TestClient(pub Arc<polkadot_service::FullClient<polkadot_test_runtime::RuntimeApi, PolkadotTestExecutor>>);
// TODO: maybe implementable for any Arc<TFullClient<...>>?
impl YaExecuteWithClient for TestClient {
fn execute_with<T: ExecuteWithClient>(&self, t: T) -> T::Output {
T::execute_with_client::<_, _, FullBackend>(t, self.0.clone())
T::execute_with_client::<_, _, polkadot_service::FullBackend>(t, self.0.clone())
}
}
......
......@@ -109,16 +109,16 @@ impl IdentifyVariant for Box<dyn ChainSpec> {
}
}
type FullBackend = service::TFullBackend<Block>;
type FullSelectChain = sc_consensus::LongestChain<FullBackend, Block>;
type FullClient<RuntimeApi, Executor> = service::TFullClient<Block, RuntimeApi, Executor>;
type FullGrandpaBlockImport<RuntimeApi, Executor> = grandpa::GrandpaBlockImport<
pub type FullBackend = service::TFullBackend<Block>;
pub type FullSelectChain = sc_consensus::LongestChain<FullBackend, Block>;
pub type FullClient<RuntimeApi, Executor> = service::TFullClient<Block, RuntimeApi, Executor>;
pub type FullGrandpaBlockImport<RuntimeApi, Executor> = grandpa::GrandpaBlockImport<
FullBackend, Block, FullClient<RuntimeApi, Executor>, FullSelectChain
>;
type LightBackend = service::TLightBackendWithHash<Block, sp_runtime::traits::BlakeTwo256>;
pub type LightBackend = service::TLightBackendWithHash<Block, sp_runtime::traits::BlakeTwo256>;
type LightClient<RuntimeApi, Executor> =
pub type LightClient<RuntimeApi, Executor> =
service::TLightClientWithBackend<Block, RuntimeApi, Executor, LightBackend>;
#[cfg(feature = "full-node")]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment