Skip to content

Commit

Permalink
fix(try-runtime): make it compile!
Browse files Browse the repository at this point in the history
  • Loading branch information
saiintbrisson committed Feb 29, 2024
1 parent fc14e00 commit 45ac58c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 31 deletions.
26 changes: 2 additions & 24 deletions node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,31 +194,9 @@ pub fn run() -> sc_cli::Result<()> {
}
})
}
#[cfg(feature = "try-runtime")]
Some(Subcommand::TryRuntime(cmd)) => {
use crate::service::ExecutorDispatch;
use sc_executor::{sp_wasm_interface::ExtendedHostFunctions, NativeExecutionDispatch};
let runner = cli.create_runner(cmd)?;
runner.async_run(|config| {
// we don't need any of the components of new_partial, just a runtime, or a task
// manager to do `async_run`.
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,
<ExecutorDispatch as NativeExecutionDispatch>::ExtendHostFunctions,
>>(),
task_manager,
))
})
Some(Subcommand::TryRuntime) => {
Err("TryRuntime is available through its own CLI now: <https://github.com/paritytech/try-runtime-cli>".into())
}
#[cfg(not(feature = "try-runtime"))]
Some(Subcommand::TryRuntime) => Err("TryRuntime wasn't enabled when building the node. \
You can enable it with `--features try-runtime`."
.into()),
Some(Subcommand::ChainInfo(cmd)) => {
let runner = cli.create_runner(cmd)?;
runner.sync_run(|config| cmd.run::<Block>(&config))
Expand Down
16 changes: 9 additions & 7 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -148,21 +148,23 @@ runtime-benchmarks = [
"pallet-evm/runtime-benchmarks",
]
try-runtime = [
"frame-try-runtime/try-runtime",
"fp-self-contained/try-runtime",
"frame-executive/try-runtime",
"frame-system/try-runtime",
"frame-support/try-runtime",
"frame-system/try-runtime",
"frame-try-runtime/try-runtime",
"pallet-aura/try-runtime",
"pallet-balances/try-runtime",
"pallet-base-fee/try-runtime",
"pallet-ethereum/try-runtime",
"pallet-evm-chain-id/try-runtime",
"pallet-evm/try-runtime",
"pallet-grandpa/try-runtime",
"pallet-insecure-randomness-collective-flip/try-runtime",
"pallet-multisig/try-runtime",
"pallet-subspace/try-runtime",
"pallet-sudo/try-runtime",
"pallet-timestamp/try-runtime",
"pallet-transaction-payment/try-runtime",
"pallet-utility/try-runtime",
"pallet-subspace/try-runtime",
"pallet-ethereum/try-runtime",
"pallet-evm/try-runtime",
"fp-self-contained/try-runtime",
# "pallet-hotfix-sufficients/runtime-benchmarks",
]

0 comments on commit 45ac58c

Please sign in to comment.