Fix auction bench (#6747)

* Adjust command

* Move imports

* Chain-specific blocktime

* update lockfile for {"substrate"}

* cargo update -p sp-io

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

* Fix bench

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

* Export constants from node service

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

* Use constants in CLI

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

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Piotr Mikołajczyk <piomiko41@gmail.com>
Co-authored-by: parity-processbot <>
This commit is contained in:
Oliver Tale-Yazdi
2023-02-20 18:02:07 +01:00
committed by GitHub
parent b13ba77a3b
commit 35a0d69af8
4 changed files with 219 additions and 190 deletions
+9 -4
View File
@@ -649,6 +649,9 @@ pub fn run() -> Result<()> {
#[cfg(feature = "try-runtime")]
Some(Subcommand::TryRuntime(cmd)) => {
use sc_executor::{sp_wasm_interface::ExtendedHostFunctions, NativeExecutionDispatch};
use sc_service::TaskManager;
use try_runtime_cli::block_building_info::timestamp_with_babe_info;
let runner = cli.create_runner(cmd)?;
let chain_spec = &runner.config().chain_spec;
set_default_ss58_version(chain_spec);
@@ -657,7 +660,6 @@ pub fn run() -> Result<()> {
<E as NativeExecutionDispatch>::ExtendHostFunctions,
>;
use sc_service::TaskManager;
let registry = &runner.config().prometheus_config.as_ref().map(|cfg| &cfg.registry);
let task_manager = TaskManager::new(runner.config().tokio_handle.clone(), *registry)
.map_err(|e| Error::SubstrateService(sc_service::Error::Prometheus(e)))?;
@@ -668,7 +670,8 @@ pub fn run() -> Result<()> {
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(timestamp_with_babe_info(service::kusama_runtime_constants::time::MILLISECS_PER_BLOCK))
)
.map_err(Error::SubstrateCli),
task_manager,
@@ -680,7 +683,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(timestamp_with_babe_info(service::westend_runtime_constants::time::MILLISECS_PER_BLOCK))
)
.map_err(Error::SubstrateCli),
task_manager,
@@ -692,7 +696,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(timestamp_with_babe_info(service::polkadot_runtime_constants::time::MILLISECS_PER_BLOCK))
)
.map_err(Error::SubstrateCli),
task_manager,