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

Companion for: try-runtime::fast-forward #6567

14 changes: 11 additions & 3 deletions cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ use sp_core::crypto::Ss58AddressFormatRegistry;
use sp_keyring::Sr25519Keyring;
use std::net::ToSocketAddrs;

#[cfg(feature = "try-runtime")]
use try_runtime_cli::block_building_info::timestamp_with_babe_info;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would move this to line 641 inside the feature-gated scope. There is already a few imports there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, moved


pub use crate::{error::Error, service::BlockId};
pub use polkadot_performance_test::PerfCheckError;

Expand Down Expand Up @@ -652,13 +655,16 @@ pub fn run() -> Result<()> {
let task_manager = TaskManager::new(runner.config().tokio_handle.clone(), *registry)
.map_err(|e| Error::SubstrateService(sc_service::Error::Prometheus(e)))?;

let info_provider = timestamp_with_babe_info(6000);
kianenigma marked this conversation as resolved.
Show resolved Hide resolved

ensure_dev(chain_spec).map_err(Error::Other)?;

#[cfg(feature = "kusama-native")]
if chain_spec.is_kusama() {
return runner.async_run(|_| {
Ok((
cmd.run::<service::kusama_runtime::Block, HostFunctionsOf<service::KusamaExecutorDispatch>>(
cmd.run::<service::kusama_runtime::Block, HostFunctionsOf<service::KusamaExecutorDispatch>, _>(
Some(info_provider)
kianenigma marked this conversation as resolved.
Show resolved Hide resolved
)
.map_err(Error::SubstrateCli),
task_manager,
Expand All @@ -670,7 +676,8 @@ pub fn run() -> Result<()> {
if chain_spec.is_westend() {
return runner.async_run(|_| {
Ok((
cmd.run::<service::westend_runtime::Block, HostFunctionsOf<service::WestendExecutorDispatch>>(
cmd.run::<service::westend_runtime::Block, HostFunctionsOf<service::WestendExecutorDispatch>, _>(
Some(info_provider)
)
.map_err(Error::SubstrateCli),
task_manager,
Expand All @@ -682,7 +689,8 @@ pub fn run() -> Result<()> {
{
return runner.async_run(|_| {
Ok((
cmd.run::<service::polkadot_runtime::Block, HostFunctionsOf<service::PolkadotExecutorDispatch>>(
cmd.run::<service::polkadot_runtime::Block, HostFunctionsOf<service::PolkadotExecutorDispatch>, _>(
Some(info_provider)
)
.map_err(Error::SubstrateCli),
task_manager,
Expand Down