Skip to content

Commit

Permalink
Last node fix
Browse files Browse the repository at this point in the history
It now compiles but runtime_integrity_tests fails
  • Loading branch information
NunoAlexandre committed Oct 11, 2023
1 parent d186568 commit 251ad4f
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
35 changes: 35 additions & 0 deletions src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ impl<T: sc_service::ChainSpec + 'static> IdentifyChain for T {
}
}

#[cfg(feature = "try-runtime")]
use try_runtime_cli::block_building_info::substrate_info;
#[cfg(feature = "try-runtime")]
/// The time internavel for block production on our chain in milliseconds (12 seconds to millis)
const BLOCK_TIME_MILLIS: u64 = 12 * 1_000;

fn load_spec(
id: &str,
para_id: ParaId,
Expand Down Expand Up @@ -374,6 +380,35 @@ pub fn run() -> Result<()> {
Ok(())
}

#[cfg(feature = "try-runtime")]
Some(Subcommand::TryRuntime(cmd)) => {
use sc_executor::{sp_wasm_interface::ExtendedHostFunctions, NativeExecutionDispatch};

let runner = cli.create_runner(cmd)?;
let chain_spec = &runner.config().chain_spec;

with_runtime!(chain_spec, {
runner.async_run(|config| {
let registry = config.prometheus_config.as_ref().map(|cfg| &cfg.registry);
let task_manager =
sc_service::TaskManager::new(config.tokio_handle.clone(), registry)
.map_err(|e| {
sc_cli::Error::Service(sc_service::Error::Prometheus(e))
})?;
Ok((
cmd.run::<
Block,
ExtendedHostFunctions<
sp_io::SubstrateHostFunctions,
<Executor as NativeExecutionDispatch>::ExtendHostFunctions,
>,
_>(Some(substrate_info(BLOCK_TIME_MILLIS))),
task_manager,
))
})
})
}

Some(Subcommand::Benchmark(cmd)) => {
if cfg!(feature = "runtime-benchmarks") {
let runner = cli.create_runner(cmd)?;
Expand Down
2 changes: 1 addition & 1 deletion src/service/evm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ fn spawn_frontier_tasks<RuntimeApi, Executor>(
Duration::new(6, 0),
client.clone(),
backend,
overrides,
overrides.clone(),
Arc::new(fb),
3,
0,
Expand Down

0 comments on commit 251ad4f

Please sign in to comment.