mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 19:21:13 +00:00
make polkadot-runtime optional feature (#3820)
* make polkadot-runtime optional feature * sprinkle some cfg statements * ok * ok, ok * add CI check * set -e * chmod +x * fixes * fmt * nicer compile errors * Update outdated comments
This commit is contained in:
@@ -40,9 +40,19 @@ pub type FullBackend = sc_service::TFullBackend<Block>;
|
||||
pub type FullClient<RuntimeApi, ExecutorDispatch> =
|
||||
sc_service::TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<ExecutorDispatch>>;
|
||||
|
||||
#[cfg(not(any(
|
||||
feature = "rococo",
|
||||
feature = "kusama",
|
||||
feature = "westend",
|
||||
feature = "polkadot"
|
||||
)))]
|
||||
compile_error!("at least one runtime feature must be enabled");
|
||||
|
||||
/// The native executor instance for Polkadot.
|
||||
#[cfg(feature = "polkadot")]
|
||||
pub struct PolkadotExecutorDispatch;
|
||||
|
||||
#[cfg(feature = "polkadot")]
|
||||
impl sc_executor::NativeExecutionDispatch for PolkadotExecutorDispatch {
|
||||
type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions;
|
||||
|
||||
@@ -233,6 +243,7 @@ macro_rules! with_client {
|
||||
}
|
||||
} => {
|
||||
match $self {
|
||||
#[cfg(feature = "polkadot")]
|
||||
Self::Polkadot($client) => { $( $code )* },
|
||||
#[cfg(feature = "westend")]
|
||||
Self::Westend($client) => { $( $code )* },
|
||||
@@ -249,6 +260,7 @@ macro_rules! with_client {
|
||||
/// See [`ExecuteWithClient`] for more information.
|
||||
#[derive(Clone)]
|
||||
pub enum Client {
|
||||
#[cfg(feature = "polkadot")]
|
||||
Polkadot(Arc<FullClient<polkadot_runtime::RuntimeApi, PolkadotExecutorDispatch>>),
|
||||
#[cfg(feature = "westend")]
|
||||
Westend(Arc<FullClient<westend_runtime::RuntimeApi, WestendExecutorDispatch>>),
|
||||
|
||||
Reference in New Issue
Block a user