Skip to content

Commit

Permalink
Remove generics
Browse files Browse the repository at this point in the history
  • Loading branch information
s0me0ne-unkn0wn committed Jan 20, 2025
1 parent 4b58743 commit 6e3353a
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions relay/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@

extern crate alloc;

use core::marker::PhantomData;

use codec::{Decode, Encode, MaxEncodedLen};
use frame_support::{
dynamic_params::{dynamic_pallet_params, dynamic_params},
Expand Down Expand Up @@ -1908,24 +1906,21 @@ parameter_types! {

const NEW_MAX_POV: u32 = 10 * 1024 * 1024;

pub struct Activate10MbPovs<T>(PhantomData<T>);
impl<T> OnRuntimeUpgrade for Activate10MbPovs<T>
where
T: parachains_configuration::Config,
{
pub struct Activate10MbPovs;
impl OnRuntimeUpgrade for Activate10MbPovs {
#[cfg(feature = "try-runtime")]
fn pre_upgrade() -> Result<Vec<u8>, sp_runtime::TryRuntimeError> {
// The pre-upgrade state doesn't matter
Ok(vec![])
}

fn on_runtime_upgrade() -> Weight {
match parachains_configuration::Pallet::<T>::set_max_pov_size(
match parachains_configuration::Pallet::<Runtime>::set_max_pov_size(
frame_system::RawOrigin::Root.into(),
NEW_MAX_POV,
) {
Ok(()) =>
weights::runtime_parachains_configuration::WeightInfo::<T>::set_config_with_u32(),
weights::runtime_parachains_configuration::WeightInfo::<Runtime>::set_config_with_u32(),
Err(e) => {
log::warn!(
target: LOG_TARGET,
Expand All @@ -1938,7 +1933,7 @@ where

#[cfg(feature = "try-runtime")]
fn post_upgrade(_state: Vec<u8>) -> Result<(), sp_runtime::TryRuntimeError> {
let pending = parachains_configuration::PendingConfigs::<T>::get();
let pending = parachains_configuration::PendingConfigs::<Runtime>::get();
let Some((_, last_pending)) = pending.last() else {
return Err(sp_runtime::TryRuntimeError::CannotLookup);
};
Expand Down Expand Up @@ -1973,7 +1968,7 @@ pub mod migrations {
Runtime,
MaxPoolsToMigrate,
>,
Activate10MbPovs<Runtime>,
Activate10MbPovs,
);

/// Migrations/checks that do not need to be versioned and can run on every update.
Expand Down

0 comments on commit 6e3353a

Please sign in to comment.