Fix doc build with --all-features (#8277)

* implement

* make default pre/post_upgrade

* simplify Cargo.toml

* revert removal of outdated/private links

* link in pallet-mmr
This commit is contained in:
Guillaume Thiolliere
2021-03-05 16:08:44 +01:00
committed by GitHub
parent d0530d0f2a
commit 9c4e4d453c
40 changed files with 59 additions and 57 deletions
+6 -6
View File
@@ -1553,7 +1553,7 @@ pub trait OnGenesis {
fn on_genesis() {}
}
/// Prefix to be used (optionally) for implementing [`OnRuntimeUpgrade::storage_key`].
/// Prefix to be used (optionally) for implementing [`OnRuntimeUpgradeHelpersExt::storage_key`].
#[cfg(feature = "try-runtime")]
pub const ON_RUNTIME_UPGRADE_PREFIX: &[u8] = b"__ON_RUNTIME_UPGRADE__";
@@ -1563,7 +1563,7 @@ pub trait OnRuntimeUpgradeHelpersExt {
/// Generate a storage key unique to this runtime upgrade.
///
/// This can be used to communicate data from pre-upgrade to post-upgrade state and check
/// them. See [`set_temp_storage`] and [`get_temp_storage`].
/// them. See [`Self::set_temp_storage`] and [`Self::get_temp_storage`].
#[cfg(feature = "try-runtime")]
fn storage_key(ident: &str) -> [u8; 32] {
let prefix = sp_io::hashing::twox_128(ON_RUNTIME_UPGRADE_PREFIX);
@@ -1576,7 +1576,7 @@ pub trait OnRuntimeUpgradeHelpersExt {
final_key
}
/// Get temporary storage data written by [`set_temp_storage`].
/// Get temporary storage data written by [`Self::set_temp_storage`].
///
/// Returns `None` if either the data is unavailable or un-decodable.
///
@@ -1588,7 +1588,7 @@ pub trait OnRuntimeUpgradeHelpersExt {
}
/// Write some temporary data to a specific storage that can be read (potentially in
/// post-upgrade hook) via [`get_temp_storage`].
/// post-upgrade hook) via [`Self::get_temp_storage`].
///
/// A `at` storage identifier must be provided to indicate where the storage is being written
/// to.
@@ -1623,13 +1623,13 @@ pub trait OnRuntimeUpgrade {
///
/// 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>;
fn pre_upgrade() -> Result<(), &'static str> { Ok(()) }
/// Execute some post-checks after a runtime upgrade.
///
/// 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>;
fn post_upgrade() -> Result<(), &'static str> { Ok(()) }
}
#[impl_for_tuples(30)]
+1
View File
@@ -41,3 +41,4 @@ std = [
"sp-runtime/std",
"sp-state-machine",
]
try-runtime = ["frame-support/try-runtime"]