mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 18:07:58 +00:00
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:
@@ -22,7 +22,7 @@
|
||||
// Ensure we're `no_std` when compiling for Wasm.
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
mod migration;
|
||||
pub mod migration;
|
||||
mod mock;
|
||||
mod tests;
|
||||
|
||||
@@ -47,7 +47,6 @@ type ReportIdOf<T> = <T as frame_system::Config>::Hash;
|
||||
pub mod pallet {
|
||||
use super::*;
|
||||
use frame_support::pallet_prelude::*;
|
||||
use frame_system::pallet_prelude::*;
|
||||
|
||||
#[pallet::pallet]
|
||||
#[pallet::generate_store(pub(super) trait Store)]
|
||||
@@ -110,13 +109,6 @@ pub mod pallet {
|
||||
/// \[kind, timeslot\].
|
||||
Offence { kind: Kind, timeslot: OpaqueTimeSlot },
|
||||
}
|
||||
|
||||
#[pallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
|
||||
fn on_runtime_upgrade() -> Weight {
|
||||
migration::remove_deferred_storage::<T>()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config, O: Offence<T::IdentificationTuple>>
|
||||
|
||||
@@ -56,8 +56,7 @@ pub fn remove_deferred_storage<T: Config>() -> Weight {
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use super::*;
|
||||
use crate::mock::{new_test_ext, with_on_offence_fractions, Offences, Runtime as T};
|
||||
use frame_support::traits::OnRuntimeUpgrade;
|
||||
use crate::mock::{new_test_ext, with_on_offence_fractions, Runtime as T};
|
||||
use sp_runtime::Perbill;
|
||||
use sp_staking::offence::OffenceDetails;
|
||||
|
||||
@@ -87,7 +86,7 @@ mod test {
|
||||
|
||||
// when
|
||||
assert_eq!(
|
||||
Offences::on_runtime_upgrade(),
|
||||
remove_deferred_storage::<T>(),
|
||||
<T as frame_system::Config>::DbWeight::get().reads_writes(1, 1),
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user