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
+3 -10
View File
@@ -33,14 +33,13 @@ mod benchmarking;
pub mod mock;
#[cfg(test)]
mod tests;
pub mod weights;
mod functions;
mod impl_nonfungibles;
mod types;
pub use types::*;
mod migration;
pub mod migration;
pub mod weights;
use codec::{Decode, Encode, HasCompact};
use frame_support::traits::{BalanceStatus::Reserved, Currency, ReservableCurrency};
@@ -52,6 +51,7 @@ use sp_runtime::{
use sp_std::prelude::*;
pub use pallet::*;
pub use types::*;
pub use weights::WeightInfo;
#[frame_support::pallet]
@@ -316,13 +316,6 @@ pub mod pallet {
Unapproved,
}
#[pallet::hooks]
impl<T: Config<I>, I: 'static> Hooks<BlockNumberFor<T>> for Pallet<T, I> {
fn on_runtime_upgrade() -> frame_support::weights::Weight {
migration::migrate_to_v1::<T, I, Self>()
}
}
impl<T: Config<I>, I: 'static> Pallet<T, I> {
/// Get the owner of the asset instance, if the asset exists.
pub fn owner(class: T::ClassId, instance: T::InstanceId) -> Option<T::AccountId> {