Skip to content

Commit

Permalink
Improve naming & code org
Browse files Browse the repository at this point in the history
  • Loading branch information
fmiguelgarcia committed Jun 28, 2023
1 parent 1d4b12e commit cea467c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pallets/system/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ pub mod pallet {
/// expensive. We will treat this as a full block.
/// # </weight>
#[pallet::call_index(2)]
#[pallet::weight(weights::set_code::<T>())]
#[pallet::weight(weight_helper::set_code::<T>())]
pub fn set_code(origin: OriginFor<T>, code: Vec<u8>) -> DispatchResultWithPostInfo {
ensure_root(origin)?;
Self::can_set_code(&code)?;
Expand All @@ -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. # </weight>
#[pallet::call_index(3)]
#[pallet::weight(weights::set_code::<T>())]
#[pallet::weight(weight_helper::set_code::<T>())]
pub fn set_code_without_checks(
origin: OriginFor<T>,
code: Vec<u8>,
Expand Down Expand Up @@ -1868,13 +1868,13 @@ pub mod pallet_prelude {
pub type BlockNumberFor<T> = <T as crate::Config>::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<T: Config>() -> (Weight, DispatchClass) {
pub(crate) fn set_code<T: Config>() -> (Weight, DispatchClass) {
let class = DispatchClass::Operational;
let block_weights = T::BlockWeights::get();
let max = block_weights
Expand Down

0 comments on commit cea467c

Please sign in to comment.