diff --git a/Cargo.lock b/Cargo.lock index d43cea1dcc4..536d22a2666 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6923,6 +6923,12 @@ dependencies = [ "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=master)", ] +[[package]] +name = "paris" +version = "1.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fecab3723493c7851f292cb060f3ee1c42f19b8d749345d0d7eaf3fd19aa62d" + [[package]] name = "parity-db" version = "0.4.10" @@ -11660,7 +11666,7 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "try-runtime-cli" -version = "0.5.1" +version = "0.5.2" dependencies = [ "clap", "env_logger", @@ -11715,7 +11721,7 @@ dependencies = [ [[package]] name = "try-runtime-core" -version = "0.5.1" +version = "0.5.2" dependencies = [ "assert_cmd", "async-trait", @@ -11727,6 +11733,7 @@ dependencies = [ "itertools 0.11.0", "log", "node-primitives", + "paris", "parity-scale-codec", "regex", "sc-cli", diff --git a/Cargo.toml b/Cargo.toml index 26edb908fe0..c2a1d6f9b00 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ resolver = "2" members = ["cli", "core"] [workspace.package] -version = "0.5.1" +version = "0.5.2" authors = ["Parity Technologies "] description = "Substrate's programmatic testing framework." edition = "2021" diff --git a/core/Cargo.toml b/core/Cargo.toml index 09cb7847d26..0562c028513 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -52,6 +52,7 @@ sp-version = { workspace = true } sp-weights = { workspace = true } substrate-rpc-client = { workspace = true } +paris = "1.5.15" [dev-dependencies] assert_cmd = { workspace = true } diff --git a/core/src/commands/on_runtime_upgrade.rs b/core/src/commands/on_runtime_upgrade.rs index 89d2e8f85d5..7db7064f6d1 100644 --- a/core/src/commands/on_runtime_upgrade.rs +++ b/core/src/commands/on_runtime_upgrade.rs @@ -19,6 +19,7 @@ use std::{fmt::Debug, str::FromStr}; use bytesize::ByteSize; use frame_try_runtime::UpgradeCheckSelect; +use paris::formatter::colorize_string; use parity_scale_codec::Encode; use sc_executor::sp_wasm_interface::HostFunctions; use sp_core::{hexdisplay::HexDisplay, Hasher}; @@ -101,8 +102,23 @@ where // Run `TryRuntime_on_runtime_upgrade` with the given checks. log::info!( - "🔬 Running TryRuntime_on_runtime_upgrade with checks: {:?}", - command.checks + "{}", + colorize_string( + "-------------------------------------------------------------------\n\n" + ) + ); + log::info!( + "{}", + colorize_string(format!( + "🔬 Running TryRuntime_on_runtime_upgrade with checks: {:?}\n\n", + command.checks + )) + ); + log::info!( + "{}", + colorize_string( + "-------------------------------------------------------------------" + ) ); // Save the overlayed changes from the first run, so we can use them later for idempotency // checks. @@ -126,7 +142,16 @@ where UpgradeCheckSelect::None => (proof, ref_time_results), _ => { log::info!( - "🔬 TryRuntime_on_runtime_upgrade succeeded! Running it again without checks for weight measurements." + "{}", + colorize_string("-------------------------------------------------------------------\n\n") + ); + log::info!( + "{}", + colorize_string("🔬 TryRuntime_on_runtime_upgrade succeeded! Running it again without checks for weight measurements.\n\n"), + ); + log::info!( + "{}", + colorize_string("-------------------------------------------------------------------") ); let (proof, encoded_result) = state_machine_call_with_proof::( &ext, @@ -150,8 +175,16 @@ where } false => { log::info!( - "🔬 Running TryRuntime_on_runtime_upgrade again to check idempotency: {:?}", - command.checks + "{}", + colorize_string("-------------------------------------------------------------------\n\n") + ); + log::info!( + "{}", + colorize_string(format!("🔬 Running TryRuntime_on_runtime_upgrade again to check idempotency: {:?}\n\n", command.checks)), + ); + log::info!( + "{}", + colorize_string("-------------------------------------------------------------------") ); let (oc_pre_root, _) = overlayed_changes.storage_root(&ext.backend, ext.state_version); match state_machine_call_with_proof::( @@ -213,7 +246,20 @@ where }; if !weight_ok || !idempotency_ok { - log::error!("❌ Issues detected, exiting non-zero. See logs."); + log::error!( + "{}", + colorize_string("-------------------------------------------------------------------\n\n") + ); + log::error!( + "{}", + colorize_string("❌ Issues detected, exiting non-zero. See logs.\n\n"), + ); + log::error!( + "{}", + colorize_string( + "-------------------------------------------------------------------" + ) + ); std::process::exit(1); }