companion for try-runtime revamp (#1997)

* companion for try-rutnime revamp

* Fixes

Co-authored-by: Bastian Köcher <info@kchr.de>
This commit is contained in:
Kian Paimani
2022-12-15 10:50:52 +00:00
committed by GitHub
parent babf73bbc6
commit 391a5d8988
13 changed files with 408 additions and 391 deletions
+8 -2
View File
@@ -231,14 +231,20 @@ pub fn run() -> Result<()> {
Some(Subcommand::TryRuntime(cmd)) => {
let runner = cli.create_runner(cmd)?;
use sc_executor::{sp_wasm_interface::ExtendedHostFunctions, NativeExecutionDispatch};
type HostFunctionsOf<E> = ExtendedHostFunctions<
sp_io::SubstrateHostFunctions,
<E as NativeExecutionDispatch>::ExtendHostFunctions,
>;
// 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))?;
runner.async_run(|config| {
Ok((cmd.run::<Block, ParachainNativeExecutor>(config), task_manager))
runner.async_run(|_| {
Ok((cmd.run::<Block, HostFunctionsOf<ParachainNativeExecutor>>(), task_manager))
})
},
#[cfg(not(feature = "try-runtime"))]