From cea467c57619e7d606a3ccdf9615c280771dcb9b Mon Sep 17 00:00:00 2001 From: fmiguelgarcia Date: Wed, 28 Jun 2023 12:42:52 +0200 Subject: [PATCH] Improve naming & code org --- pallets/system/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pallets/system/src/lib.rs b/pallets/system/src/lib.rs index a2b3d129d..111591313 100644 --- a/pallets/system/src/lib.rs +++ b/pallets/system/src/lib.rs @@ -445,7 +445,7 @@ pub mod pallet { /// expensive. We will treat this as a full block. /// # #[pallet::call_index(2)] - #[pallet::weight(weights::set_code::())] + #[pallet::weight(weight_helper::set_code::())] pub fn set_code(origin: OriginFor, code: Vec) -> DispatchResultWithPostInfo { ensure_root(origin)?; Self::can_set_code(&code)?; @@ -463,7 +463,7 @@ pub mod pallet { /// The weight of this function is dependent on the runtime. We will treat this as a full /// block. # #[pallet::call_index(3)] - #[pallet::weight(weights::set_code::())] + #[pallet::weight(weight_helper::set_code::())] pub fn set_code_without_checks( origin: OriginFor, code: Vec, @@ -1868,13 +1868,13 @@ pub mod pallet_prelude { pub type BlockNumberFor = ::BlockNumber; } -mod weigths { +mod weight_helper { use super::*; /// Weight for `system::set_code`. /// /// It fills the whole block in terms of weight. - fn set_code() -> (Weight, DispatchClass) { + pub(crate) fn set_code() -> (Weight, DispatchClass) { let class = DispatchClass::Operational; let block_weights = T::BlockWeights::get(); let max = block_weights