@@ -121,35 +121,41 @@ pub type StorageHubEventsVec<Runtime> = Vec<
121121 > ,
122122> ;
123123
124- #[ cfg( not( feature = "runtime-benchmarks" ) ) ]
124+ // Parachain host functions - only available when the `parachain` feature is enabled.
125+ #[ cfg( all( feature = "parachain" , not( feature = "runtime-benchmarks" ) ) ) ]
125126type HostFunctions = cumulus_client_service:: ParachainHostFunctions ;
126127
127- #[ cfg( feature = "runtime-benchmarks" ) ]
128+ #[ cfg( all ( feature = "parachain" , feature = " runtime-benchmarks") ) ]
128129type HostFunctions = (
129130 cumulus_client_service:: ParachainHostFunctions ,
130131 frame_benchmarking:: benchmarking:: HostFunctions ,
131132) ;
132133
133- /// The wasm executor used by the StorageHub client, which has the set of host functions
134- /// that are available in a regular Polkadot Parachain.
134+ // Solochain host functions - used when the `parachain` feature is disabled.
135+ #[ cfg( all( not( feature = "parachain" ) , not( feature = "runtime-benchmarks" ) ) ) ]
136+ type HostFunctions = sp_io:: SubstrateHostFunctions ;
137+
138+ #[ cfg( all( not( feature = "parachain" ) , feature = "runtime-benchmarks" ) ) ]
139+ type HostFunctions = (
140+ sp_io:: SubstrateHostFunctions ,
141+ frame_benchmarking:: benchmarking:: HostFunctions ,
142+ ) ;
143+
144+ /// The wasm executor used by the StorageHub client.
135145///
136- /// The fact that we're using a `ParachainExecutor` is only because we're using the
137- /// set of host functions that are available in a regular Polkadot Parachain.
138- /// If this client would require a different set of host functions, we would need to
139- /// use a different executor, with a different set of host functions.
140- pub type ParachainExecutor = WasmExecutor < HostFunctions > ;
146+ /// When the `parachain` feature is enabled, this executor uses the set of host functions
147+ /// that are available in a regular Polkadot Parachain (`ParachainHostFunctions`) .
148+ /// When the `parachain` feature is disabled (solochain mode), it uses the standard
149+ /// Substrate host functions (`SubstrateHostFunctions`) .
150+ pub type StorageHubExecutor = WasmExecutor < HostFunctions > ;
141151
142- /// The full client used by the StorageHub client, which uses the [`ParachainExecutor `]
152+ /// The full client used by the StorageHub client, which uses the [`StorageHubExecutor `]
143153/// as the wasm executor.
144154///
145155/// It is abstracted over the set of runtime APIs, defined later by a `Runtime` type that
146156/// should implement the [`StorageEnableRuntime`](crate::traits::StorageEnableRuntime) trait.
147- ///
148- /// The name `ParachainClient` is a bit misleading, as it is not necessarily a client for a
149- /// parachain. But it is called this way because it uses the `ParachainExecutor` which is
150- /// a [WasmExecutor] with the [`HostFunctions`] that are available in a regular Polkadot Parachain.
151- pub type ParachainClient < RuntimeApi > =
152- TFullClient < shp_opaque:: Block , RuntimeApi , ParachainExecutor > ;
157+ pub type StorageHubClient < RuntimeApi > =
158+ TFullClient < shp_opaque:: Block , RuntimeApi , StorageHubExecutor > ;
153159
154160/// The type of key used for [`BlockchainService`]` operations.
155161pub const BCSV_KEY_TYPE : KeyTypeId = KeyTypeId ( * b"bcsv" ) ;
0 commit comments