Skip to content

Commit 4418658

Browse files
authored
Miscellaneous fixes (#126)
Follow-up to #125.
1 parent 9156630 commit 4418658

4 files changed

Lines changed: 17 additions & 15 deletions

File tree

cli/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@
295295
//! [`Action::OffchainWorker`]: try_runtime_core::commands::Action::OffchainWorker
296296
//! [`Action::CreateSnapshot`]: try_runtime_core::commands::Action::CreateSnapshot
297297
//! [`Action::FastForward`]: try_runtime_core::commands::Action::FastForward
298-
//! [`SharedParams`]: try_runtime_core::shared_parameters::SharedParams
298+
//! [`SharedParams`]: try_runtime_core::common::shared_parameters::SharedParams
299299
//! [`SharedParams::runtime`]: try_runtime_core::common::shared_parameters::SharedParams::runtime
300300
//! [`SharedParams::overwrite_state_version`]: try_runtime_core::common::shared_parameters::SharedParams::overwrite_state_version
301301

cli/tests/on_runtime_upgrade.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
#![cfg(unix)]
2-
3-
#[allow(deprecated)]
42
mod on_runtime_upgrade {
53
use std::{path::PathBuf, time::Duration};
64

7-
use assert_cmd::cargo::cargo_bin;
5+
use assert_cmd::cargo_bin;
86
use substrate_cli_test_utils as common;
97
use tokio::process::Command;
108

@@ -54,7 +52,7 @@ mod on_runtime_upgrade {
5452
}
5553

5654
fn on_runtime_upgrade(config: &TestConfig) -> tokio::process::Child {
57-
let path = cargo_bin("try-runtime");
55+
let path = cargo_bin!("try-runtime");
5856
assert!(
5957
path.exists(),
6058
"try-runtime binary not found at path: {}",

core/src/commands/on_runtime_upgrade/mod.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,13 @@ use crate::{
4141
RefTimeInfo, SharedParams, LOG_TARGET,
4242
};
4343

44-
/// Configuration for [`run`].
44+
/// Configuration for the `on_runtime_upgrade` command.
45+
///
46+
/// The parameters below control the behavior of runtime upgrade checks e.g. whether to disable
47+
/// weight warnings, whether to run multi-block migration checks.
4548
#[derive(Debug, Clone, clap::Parser)]
4649
pub struct Command {
47-
/// The state type to use.
50+
/// The source of the blockchain state to use when running the `on-runtime-upgrade` command.
4851
#[command(subcommand)]
4952
pub state: State,
5053

@@ -66,7 +69,7 @@ pub struct Command {
6669
)]
6770
pub checks: UpgradeCheckSelect,
6871

69-
/// Whether to disable weight warnings, useful if the runtime is for a relay chain.
72+
/// Whether to disable weight warnings. Useful if a relay chain's runtime is being tested.
7073
#[clap(long, default_value = "false", default_missing_value = "true")]
7174
pub no_weight_warnings: bool,
7275

@@ -75,7 +78,7 @@ pub struct Command {
7578
#[clap(long, default_value = "false", default_missing_value = "true")]
7679
pub disable_spec_version_check: bool,
7780

78-
/// Whether to disable migration idempotency checks
81+
/// Whether to disable migration idempotency checks.
7982
#[clap(long, default_value = "false", default_missing_value = "true")]
8083
pub disable_idempotency_checks: bool,
8184

@@ -84,18 +87,18 @@ pub struct Command {
8487
#[clap(long, default_value = "false", default_missing_value = "true")]
8588
pub print_storage_diff: bool,
8689

87-
/// Whether or multi-block migrations should be executed to completion after single block
90+
/// Whether or not multi-block migrations should be executed to completion after single-block
8891
/// migratons are completed.
8992
#[clap(long, default_value = "false", default_missing_value = "true")]
9093
pub disable_mbm_checks: bool,
9194

92-
/// The maximum duration we expect all MBMs combined to take.
95+
/// The maximum duration that all MBMs combined are expected to take.
9396
///
94-
/// This value is just here to ensure that the CLI won't run forever in case of a buggy MBM.
97+
/// This value ensures the CLI won't run indefinitely in case of a buggy MBM.
9598
#[clap(long, default_value = "600")]
9699
pub mbm_max_blocks: u32,
97100

98-
/// The chain blocktime in milliseconds.
101+
/// The chain blocktime, in milliseconds.
99102
#[arg(long)]
100103
pub blocktime: u64,
101104
}

core/src/common/shared_parameters.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ pub struct SharedParams {
6565
)]
6666
pub wasmtime_instantiation_strategy: WasmtimeInstantiationStrategy,
6767

68-
/// The number of 64KB pages to allocate for Wasm execution. Defaults to
69-
/// [`sc_service::Configuration.default_heap_pages`].
68+
/// The number of 64KB pages to allocate for Wasm execution.
69+
///
70+
/// Defaults to `sc_service::Configuration::default_heap_pages`.
7071
#[arg(long)]
7172
pub heap_pages: Option<u64>,
7273

0 commit comments

Comments
 (0)