Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Companion for Substrate#14511
Browse files Browse the repository at this point in the history
  • Loading branch information
bkchr committed Jul 4, 2023
1 parent bb9ddd7 commit 5c44206
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 47 deletions.
34 changes: 1 addition & 33 deletions cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use crate::cli::{Cli, Subcommand};
use frame_benchmarking_cli::{BenchmarkCmd, ExtrinsicFactory, SUBSTRATE_REFERENCE_HARDWARE};
use futures::future::TryFutureExt;
use log::info;
use sc_cli::{RuntimeVersion, SubstrateCli};
use sc_cli::SubstrateCli;
use service::{
self,
benchmarking::{benchmark_inherent_data, RemarkBuilder, TransferKeepAliveBuilder},
Expand Down Expand Up @@ -168,38 +168,6 @@ impl SubstrateCli for Cli {
},
})
}

fn native_runtime_version(spec: &Box<dyn service::ChainSpec>) -> &'static RuntimeVersion {
#[cfg(feature = "kusama-native")]
if spec.is_kusama() {
return &service::kusama_runtime::VERSION
}

#[cfg(feature = "westend-native")]
if spec.is_westend() {
return &service::westend_runtime::VERSION
}

#[cfg(feature = "rococo-native")]
if spec.is_rococo() || spec.is_wococo() || spec.is_versi() {
return &service::rococo_runtime::VERSION
}

#[cfg(not(all(
feature = "rococo-native",
feature = "westend-native",
feature = "kusama-native"
)))]
let _ = spec;

#[cfg(feature = "polkadot-native")]
{
return &service::polkadot_runtime::VERSION
}

#[cfg(not(feature = "polkadot-native"))]
panic!("No runtime feature (polkadot, kusama, westend, rococo) is enabled")
}
}

fn set_default_ss58_version(spec: &Box<dyn service::ChainSpec>) {
Expand Down
8 changes: 1 addition & 7 deletions parachain/test-parachains/adder/collator/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
//! Polkadot CLI library.

use clap::Parser;
use sc_cli::{RuntimeVersion, SubstrateCli};
use sc_cli::SubstrateCli;

/// Sub-commands supported by the collator.
#[derive(Debug, Parser)]
Expand Down Expand Up @@ -105,10 +105,4 @@ impl SubstrateCli for Cli {
},
})
}

fn native_runtime_version(
_spec: &Box<dyn polkadot_service::ChainSpec>,
) -> &'static RuntimeVersion {
&polkadot_service::rococo_runtime::VERSION
}
}
8 changes: 1 addition & 7 deletions parachain/test-parachains/undying/collator/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
//! Polkadot CLI library.

use clap::Parser;
use sc_cli::{RuntimeVersion, SubstrateCli};
use sc_cli::SubstrateCli;

/// Sub-commands supported by the collator.
#[derive(Debug, Parser)]
Expand Down Expand Up @@ -127,10 +127,4 @@ impl SubstrateCli for Cli {
},
})
}

fn native_runtime_version(
_spec: &Box<dyn polkadot_service::ChainSpec>,
) -> &'static RuntimeVersion {
&polkadot_service::rococo_runtime::VERSION
}
}

0 comments on commit 5c44206

Please sign in to comment.