mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 06:57:58 +00:00
Companion for Substrate#14474 (#7434)
* Companion for Substrate#14474 This removes the requirement to pass the native dispatch. * Adapt * Better * Remove patch * ... * Fix * Update Substrate
This commit is contained in:
+10
-25
@@ -603,34 +603,19 @@ pub fn run() -> Result<()> {
|
||||
set_default_ss58_version(chain_spec);
|
||||
ensure_dev(chain_spec).map_err(Error::Other)?;
|
||||
|
||||
#[cfg(feature = "kusama-native")]
|
||||
if chain_spec.is_kusama() {
|
||||
return runner.sync_run(|config| {
|
||||
cmd.run::<service::kusama_runtime::Block, service::KusamaExecutorDispatch>(config)
|
||||
if cfg!(feature = "runtime-benchmarks") {
|
||||
runner.sync_run(|config| {
|
||||
cmd.run::<service::Block, ()>(config)
|
||||
.map_err(|e| Error::SubstrateCli(e))
|
||||
})
|
||||
} else {
|
||||
Err(sc_cli::Error::Input(
|
||||
"Benchmarking wasn't enabled when building the node. \
|
||||
You can enable it with `--features runtime-benchmarks`."
|
||||
.into(),
|
||||
)
|
||||
.into())
|
||||
}
|
||||
|
||||
#[cfg(feature = "westend-native")]
|
||||
if chain_spec.is_westend() {
|
||||
return runner.sync_run(|config| {
|
||||
cmd.run::<service::westend_runtime::Block, service::WestendExecutorDispatch>(config)
|
||||
.map_err(|e| Error::SubstrateCli(e))
|
||||
})
|
||||
}
|
||||
|
||||
// else we assume it is polkadot.
|
||||
#[cfg(feature = "polkadot-native")]
|
||||
{
|
||||
return runner.sync_run(|config| {
|
||||
cmd.run::<service::polkadot_runtime::Block, service::PolkadotExecutorDispatch>(config)
|
||||
.map_err(|e| Error::SubstrateCli(e))
|
||||
})
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "polkadot-native"))]
|
||||
#[allow(unreachable_code)]
|
||||
Err(service::Error::NoRuntime.into())
|
||||
},
|
||||
BenchmarkCmd::Machine(cmd) => runner.sync_run(|config| {
|
||||
cmd.run(&config, SUBSTRATE_REFERENCE_HARDWARE.clone())
|
||||
|
||||
Reference in New Issue
Block a user