Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
chore: fix copy&paste and tidy comments (#4646)
Browse files Browse the repository at this point in the history
As was brought up in [here][og], we have some copy&paste comments. I
fixed them and also took liberty of fixing some other places.
Specifically, those that say "module" instead of contemporary "pallet".

[og]:
#4603 (comment)
  • Loading branch information
pepyakin authored Jan 1, 2022
1 parent 58458bb commit 914180a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions runtime/parachains/src/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1092,12 +1092,12 @@ pub struct SessionChangeOutcome<BlockNumber> {
}

impl<T: Config> Pallet<T> {
/// Called by the initializer to initialize the configuration module.
/// Called by the initializer to initialize the configuration pallet.
pub(crate) fn initializer_initialize(_now: T::BlockNumber) -> Weight {
0
}

/// Called by the initializer to finalize the configuration module.
/// Called by the initializer to finalize the configuration pallet.
pub(crate) fn initializer_finalize() {}

/// Called by the initializer to note that a new session has started.
Expand Down Expand Up @@ -1146,7 +1146,7 @@ impl<T: Config> Pallet<T> {
}

/// Forcibly set the active config. This should be used with extreme care, and typically
/// only when enabling parachains runtime modules for the first time on a chain which has
/// only when enabling parachains runtime pallets for the first time on a chain which has
/// been running without them.
pub fn force_set_active_config(config: HostConfiguration<T::BlockNumber>) {
<Self as Store>::ActiveConfig::set(config);
Expand Down
10 changes: 5 additions & 5 deletions runtime/parachains/src/disputes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ pub trait DisputesHandler<BlockNumber> {
/// Whether the given candidate concluded invalid in a dispute with supermajority.
fn concluded_invalid(session: SessionIndex, candidate_hash: CandidateHash) -> bool;

/// Called by the initializer to initialize the configuration module.
/// Called by the initializer to initialize the disputes pallet.
fn initializer_initialize(now: BlockNumber) -> Weight;

/// Called by the initializer to finalize the configuration module.
/// Called by the initializer to finalize the disputes pallet.
fn initializer_finalize();

/// Called by the initializer to note that a new session has started.
Expand Down Expand Up @@ -678,10 +678,10 @@ impl<T: Config> Pallet<T> {
weight
}

/// Called by the initializer to finalize the disputes module.
/// Called by the initializer to finalize the disputes pallet.
pub(crate) fn initializer_finalize() {}

/// Called by the initializer to note a new session in the disputes module.
/// Called by the initializer to note a new session in the disputes pallet.
pub(crate) fn initializer_on_new_session(
notification: &SessionChangeNotification<T::BlockNumber>,
) {
Expand All @@ -704,7 +704,7 @@ impl<T: Config> Pallet<T> {
// This should be small, as disputes are rare, so `None` is fine.
<Disputes<T>>::remove_prefix(to_prune, None);

// This is larger, and will be extracted to the `shared` module for more proper pruning.
// This is larger, and will be extracted to the `shared` pallet for more proper pruning.
// TODO: https:/paritytech/polkadot/issues/3469
<Included<T>>::remove_prefix(to_prune, None);
SpamSlots::<T>::remove(to_prune);
Expand Down
6 changes: 3 additions & 3 deletions runtime/parachains/src/paras.rs
Original file line number Diff line number Diff line change
Expand Up @@ -997,13 +997,13 @@ const INVALID_TX_BAD_SUBJECT: u8 = 2;
const INVALID_TX_DOUBLE_VOTE: u8 = 3;

impl<T: Config> Pallet<T> {
/// Called by the initializer to initialize the configuration pallet.
/// Called by the initializer to initialize the paras pallet.
pub(crate) fn initializer_initialize(now: T::BlockNumber) -> Weight {
let weight = Self::prune_old_code(now);
weight + Self::process_scheduled_upgrade_changes(now)
}

/// Called by the initializer to finalize the configuration pallet.
/// Called by the initializer to finalize the paras pallet.
pub(crate) fn initializer_finalize(now: T::BlockNumber) {
Self::process_scheduled_upgrade_cooldowns(now);
}
Expand Down Expand Up @@ -1465,7 +1465,7 @@ impl<T: Config> Pallet<T> {
/// does not guarantee that the parachain will eventually be onboarded. This can happen in case
/// the PVF does not pass PVF pre-checking.
///
/// The Para ID should be not activated in this module. The validation code supplied in
/// The Para ID should be not activated in this pallet. The validation code supplied in
/// `genesis_data` should not be empty. If those conditions are not met, then the para cannot
/// be onboarded.
pub(crate) fn schedule_para_initialize(
Expand Down
6 changes: 3 additions & 3 deletions runtime/parachains/src/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,12 @@ pub mod pallet {
}

impl<T: Config> Pallet<T> {
/// Called by the initializer to initialize the scheduler module.
/// Called by the initializer to initialize the scheduler pallet.
pub(crate) fn initializer_initialize(_now: T::BlockNumber) -> Weight {
0
}

/// Called by the initializer to finalize the scheduler module.
/// Called by the initializer to finalize the scheduler pallet.
pub(crate) fn initializer_finalize() {}

/// Called by the initializer to note that a new session has started.
Expand Down Expand Up @@ -818,7 +818,7 @@ mod tests {
Paras::initializer_initialize(b + 1);
Scheduler::initializer_initialize(b + 1);

// In the real runt;me this is expected to be called by the `InclusionInherent` module.
// In the real runtime this is expected to be called by the `InclusionInherent` pallet.
Scheduler::clear();
Scheduler::schedule(Vec::new(), b + 1);
}
Expand Down

0 comments on commit 914180a

Please sign in to comment.