Remove all stale on_runtime_upgrade hooks in the runtime (#10650)

* Remove all stale on_runtime_upgrade hooks in the runtime

* add docs

* cleanup

* fix warn

* fix more warnings

* fix offence test

* overwrite the damn UItest
This commit is contained in:
Kian Paimani
2022-01-19 20:58:47 +01:00
committed by GitHub
parent c8c46fea96
commit 1344e43d2d
11 changed files with 28 additions and 80 deletions
+4 -4
View File
@@ -20,11 +20,11 @@
use super::*;
// Migration from single schedule to multiple schedules.
pub(crate) mod v1 {
pub mod v1 {
use super::*;
#[cfg(feature = "try-runtime")]
pub(crate) fn pre_migrate<T: Config>() -> Result<(), &'static str> {
pub fn pre_migrate<T: Config>() -> Result<(), &'static str> {
assert!(StorageVersion::<T>::get() == Releases::V0, "Storage version too high.");
log::debug!(
@@ -37,7 +37,7 @@ pub(crate) mod v1 {
/// Migrate from single schedule to multi schedule storage.
/// WARNING: This migration will delete schedules if `MaxVestingSchedules < 1`.
pub(crate) fn migrate<T: Config>() -> Weight {
pub fn migrate<T: Config>() -> Weight {
let mut reads_writes = 0;
Vesting::<T>::translate::<VestingInfo<BalanceOf<T>, T::BlockNumber>, _>(
@@ -65,7 +65,7 @@ pub(crate) mod v1 {
}
#[cfg(feature = "try-runtime")]
pub(crate) fn post_migrate<T: Config>() -> Result<(), &'static str> {
pub fn post_migrate<T: Config>() -> Result<(), &'static str> {
assert_eq!(StorageVersion::<T>::get(), Releases::V1);
for (_key, schedules) in Vesting::<T>::iter() {