Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
4c0abc5
A clean new attempt
kianenigma Feb 3, 2021
7f9b5b8
Checkpoint to move remote.
kianenigma Feb 10, 2021
4883812
A lot of dependency wiring to make it feature gated.
kianenigma Feb 10, 2021
be549b4
bad macro, bad macro.
kianenigma Feb 10, 2021
8e97733
Master.into()
kianenigma Feb 11, 2021
d84dad4
Undo the DB mess.
kianenigma Feb 11, 2021
aeb7a0e
Update frame/support/src/traits.rs
kianenigma Feb 11, 2021
d968f58
Apply suggestions from code review
kianenigma Feb 11, 2021
ce4128b
unbreak the build
kianenigma Feb 13, 2021
ee8ae08
Merge branch 'kiz-finally-finally-finally-finally-migration-testing-2…
kianenigma Feb 13, 2021
62be119
Master.into()
kianenigma Feb 16, 2021
712c240
Update frame/try-runtime/src/lib.rs
kianenigma Feb 18, 2021
9a23940
Update utils/frame/try-runtime/cli/Cargo.toml
kianenigma Feb 18, 2021
93f299a
Update frame/try-runtime/Cargo.toml
kianenigma Feb 18, 2021
3cea840
Address most review grumbles.
kianenigma Feb 18, 2021
ab9d4a3
Upstream.into()
kianenigma Feb 18, 2021
b13ea31
Fix build
kianenigma Feb 18, 2021
d3a2368
Add some comments
kianenigma Feb 18, 2021
c8ba546
Remove allowing one pallet at a time.
kianenigma Feb 18, 2021
2f9ad0e
More grumbles.
kianenigma Feb 18, 2021
6db195c
Merge branch 'master' of github.com:paritytech/substrate into kiz-fin…
kianenigma Feb 18, 2021
b8ab620
relocate remote-ext
kianenigma Feb 19, 2021
be5210d
Merge branch 'master' of github.com:paritytech/substrate into kiz-fin…
kianenigma Feb 19, 2021
b5e394b
Fix build
kianenigma Feb 19, 2021
deb03d4
Merge branch 'master' of github.com:paritytech/substrate into kiz-fin…
kianenigma Feb 19, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions frame/support/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1553,17 +1553,15 @@ pub trait OnRuntimeUpgrade {

/// Execute some pre-checks prior to a runtime upgrade.
///
/// These hooks are never meant to be executed on-chain, instead only be used by 3rd party tools
/// for testing.
/// This hook is never meant to be executed on-chain but is meant to be used by testing tools.
#[cfg(feature = "try-runtime")]
fn pre_upgrade() -> Result<(), &'static str> {
Ok(())
}

/// Execute some post-checks prior to a runtime upgrade.
/// Execute some post-checks after a runtime upgrade.
///
/// These hooks are never meant to be executed on-chain, instead only be used by 3rd party tools
/// for testing.
/// This hook is never meant to be executed on-chain but is meant to be used by testing tools.
#[cfg(feature = "try-runtime")]
fn post_upgrade() -> Result<(), &'static str> {
Ok(())
Expand Down
2 changes: 1 addition & 1 deletion frame/try-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ targets = ["x86_64-unknown-linux-gnu"]
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false }

sp-api = { version = "3.0.0", path = "../../primitives/api", default-features = false }
sp-std = { version = "3.0.0", default-features = false, path = "../../primitives/std" }
sp-std = { version = "3.0.0", path = "../../primitives/std" , default-features = false }

frame-support = { version = "3.0.0", path = "../support", default-features = false }

Expand Down
8 changes: 4 additions & 4 deletions frame/try-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//! Supporting types for try-runtime, testing and dry-run commands.
//! Supporting types for try-runtime, testing and dry-running commands.

#![cfg_attr(not(feature = "std"), no_std)]

Expand All @@ -25,8 +25,8 @@ use sp_std::prelude::*;
#[doc(hidden)]
pub use frame_support as _support;

/// Helper macro to generate the match expression needed to match pallet name to their
/// `on_runtime_upgrade()` implementation.
/// Helper macro to generate the match expression needed to match a pallet name to
/// its `on_runtime_upgrade()` implementation.
#[macro_export]
macro_rules! match_pallet_on_runtime_upgrade {
($name:ident, $($pallet:ty),* $(,)*) => {
Expand Down Expand Up @@ -66,7 +66,7 @@ impl sp_std::str::FromStr for Target {
}

sp_api::decl_runtime_apis! {
/// Runtime api for testing the execution of an upcoming runtime upgrade.
/// Runtime api for testing the execution of a runtime upgrade.
pub trait TryRuntime {
/// dry-run runtime upgrades, returning the total weight consumed.
///
Expand Down
11 changes: 3 additions & 8 deletions utils/frame/try-runtime/cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@ use sp_runtime::traits::{Block as BlockT, NumberFor};
use sp_core::storage::{StorageData, StorageKey, well_known_keys};
use frame_try_runtime::Target;

/// Various commands to try-out (similar to `TryFrom`, `TryInto`) the new runtime, over configurable
/// states.
/// Various commands to try out the new runtime, over configurable states.
///
/// For now this only assumes running the runtime-upgrade hooks.
/// For now this only assumes running the `on_runtime_upgrade` hooks.
#[derive(Debug, structopt::StructOpt)]
pub struct TryRuntimeCmd {
/// The shared parameters
Expand All @@ -51,7 +50,7 @@ pub struct TryRuntimeCmd {
/// The state to use for a migration dry-run.
#[derive(Debug)]
pub enum State {
/// A snapshot. Inner value is file path.
/// A snapshot. Inner value is a file path.
Snap(String),

/// A live chain. Inner value is the HTTP uri.
Expand Down Expand Up @@ -81,10 +80,6 @@ impl TryRuntimeCmd {
B: BlockT,
ExecDispatch: NativeExecutionDispatch + 'static,
{
// // prevent a potentially confusing MethodNotFound error from state machine.
// if !cfg!(feature = "try-runtime") {
// panic!("`TryRuntime` api is not enabled without `try-runtime` feature. Compile with this feature.")
// }

let spec = config.chain_spec;
let genesis_storage = spec.build_storage()?;
Expand Down