Fix CI check and remove try-runtime command (#3046)

* CI: Fix check-try-runtime

(preparation for the monorepo)

Warnings should be treated as errors here, since this is how it will
be done in the monorepo.
I expect to see two errors in this check now.

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Allow deprecated

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Remove try-runtime command

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* make it compile

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Remove try-runtime-cli dependency

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
Oliver Tale-Yazdi
2023-08-23 16:15:13 +02:00
committed by GitHub
parent 81c68c5595
commit dc6fe9a395
8 changed files with 10 additions and 68 deletions
@@ -51,7 +51,6 @@ sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master
sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master" }
substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "master" }
substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "master" }
try-runtime-cli = { git = "https://github.com/paritytech/substrate", branch = "master", optional = true }
# Polkadot
polkadot-cli = { git = "https://github.com/paritytech/polkadot", features = ["rococo-native"] , branch = "master" }
@@ -80,7 +79,6 @@ runtime-benchmarks = [
"polkadot-cli/runtime-benchmarks",
]
try-runtime = [
"try-runtime-cli/try-runtime",
"parachain-template-runtime/try-runtime"
]
network-protocol-staging = [
+3 -6
View File
@@ -35,12 +35,9 @@ pub enum Subcommand {
#[command(subcommand)]
Benchmark(frame_benchmarking_cli::BenchmarkCmd),
/// Try some testing command against a specified runtime state.
#[cfg(feature = "try-runtime")]
TryRuntime(try_runtime_cli::TryRuntimeCmd),
/// Errors since the binary was not build with `--features try-runtime`.
#[cfg(not(feature = "try-runtime"))]
/// Try-runtime has migrated to a standalone
/// [CLI](<https://github.com/paritytech/try-runtime-cli>). The subcommand exists as a stub and
/// deprecation notice. It will be removed entirely some time after Janurary 2024.
TryRuntime,
}
+1 -26
View File
@@ -216,32 +216,7 @@ pub fn run() -> Result<()> {
_ => Err("Benchmarking sub-command unsupported".into()),
}
},
#[cfg(feature = "try-runtime")]
Some(Subcommand::TryRuntime(cmd)) => {
use parachain_template_runtime::MILLISECS_PER_BLOCK;
use try_runtime_cli::block_building_info::timestamp_with_aura_info;
let runner = cli.create_runner(cmd)?;
type HostFunctions =
(sp_io::SubstrateHostFunctions, frame_benchmarking::benchmarking::HostFunctions);
// grab the task manager.
let registry = &runner.config().prometheus_config.as_ref().map(|cfg| &cfg.registry);
let task_manager =
sc_service::TaskManager::new(runner.config().tokio_handle.clone(), *registry)
.map_err(|e| format!("Error: {:?}", e))?;
let info_provider = timestamp_with_aura_info(MILLISECS_PER_BLOCK);
runner.async_run(|_| {
Ok((cmd.run::<Block, HostFunctions, _>(Some(info_provider)), task_manager))
})
},
#[cfg(not(feature = "try-runtime"))]
Some(Subcommand::TryRuntime) => Err("Try-runtime was not enabled when building the node. \
You can enable it with `--features try-runtime`."
.into()),
Some(Subcommand::TryRuntime) => Err("The `try-runtime` subcommand has been migrated to a standalone CLI (https://github.com/paritytech/try-runtime-cli). It is no longer being maintained here and will be removed entirely some time after January 2024. Please remove this subcommand from your runtime and use the standalone CLI.".into()),
None => {
let runner = cli.create_runner(&cli.run.normalize())?;
let collator_options = cli.run.collator_options();