mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 02:51:01 +00:00
Extract PartialComponents into a type alias (#2767)
Pulling PartialComponents into a named `Service` type stops clippy complaining about type complexity and also makes the type signatures a little less scary to read. There's two instances where we can't pull it out into a type because a nightly feature has not yet been stabilised (E.g. the `imp Fn` isn't stabilised in a type alias context here: https://github.com/paritytech/polkadot-sdk/blob/d84e135bbfc366a17bb6b72d0fc9d09ee781ab8d/polkadot/node/service/src/lib.rs#L477 ). --------- Co-authored-by: Bastian Köcher <git@kchr.de>
This commit is contained in:
@@ -216,6 +216,16 @@ impl sc_executor::NativeExecutionDispatch for PeopleRococoRuntimeExecutor {
|
||||
}
|
||||
}
|
||||
|
||||
/// Assembly of PartialComponents (enough to run chain ops subcommands)
|
||||
pub type Service<RuntimeApi> = PartialComponents<
|
||||
ParachainClient<RuntimeApi>,
|
||||
ParachainBackend,
|
||||
(),
|
||||
sc_consensus::DefaultImportQueue<Block>,
|
||||
sc_transaction_pool::FullPool<Block, ParachainClient<RuntimeApi>>,
|
||||
(ParachainBlockImport<RuntimeApi>, Option<Telemetry>, Option<TelemetryWorkerHandle>),
|
||||
>;
|
||||
|
||||
/// Starts a `ServiceBuilder` for a full service.
|
||||
///
|
||||
/// Use this macro if you don't actually need the full service, but just the builder in order to
|
||||
@@ -223,17 +233,7 @@ impl sc_executor::NativeExecutionDispatch for PeopleRococoRuntimeExecutor {
|
||||
pub fn new_partial<RuntimeApi, BIQ>(
|
||||
config: &Configuration,
|
||||
build_import_queue: BIQ,
|
||||
) -> Result<
|
||||
PartialComponents<
|
||||
ParachainClient<RuntimeApi>,
|
||||
ParachainBackend,
|
||||
(),
|
||||
sc_consensus::DefaultImportQueue<Block>,
|
||||
sc_transaction_pool::FullPool<Block, ParachainClient<RuntimeApi>>,
|
||||
(ParachainBlockImport<RuntimeApi>, Option<Telemetry>, Option<TelemetryWorkerHandle>),
|
||||
>,
|
||||
sc_service::Error,
|
||||
>
|
||||
) -> Result<Service<RuntimeApi>, sc_service::Error>
|
||||
where
|
||||
RuntimeApi: ConstructRuntimeApi<Block, ParachainClient<RuntimeApi>> + Send + Sync + 'static,
|
||||
RuntimeApi::RuntimeApi: sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block>
|
||||
|
||||
Reference in New Issue
Block a user