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

Commit

Permalink
dev-comment spelling mistakes
Browse files Browse the repository at this point in the history
  • Loading branch information
drahnr committed Dec 1, 2021
1 parent 57f52c9 commit 5027ac2
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 24 deletions.
8 changes: 4 additions & 4 deletions runtime/parachains/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ impl<T: paras_inherent::Config> BenchBuilder<T> {
/// Mock header.
pub(crate) fn header(block_number: T::BlockNumber) -> T::Header {
T::Header::new(
block_number, // block_number,
Default::default(), // extrinsics_root,
Default::default(), // storage_root,
Default::default(), // parent_hash,
block_number, // `block_number`,
Default::default(), // `extrinsics_root`,
Default::default(), // `storage_root`,
Default::default(), // `parent_hash`,
Default::default(), // digest,
)
}
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 @@ -602,7 +602,7 @@ impl StatementSetFilter {

// reverse order ensures correctness
for index in indices.into_iter().rev() {
// swap_remove guarantees linear complexity.
// `swap_remove` guarantees linear complexity.
statement_set.statements.swap_remove(index);
}

Expand Down Expand Up @@ -1579,7 +1579,7 @@ mod tests {
});
}

// Test prunning works
// Test pruning works
#[test]
fn test_initializer_on_new_session() {
let dispute_period = 3;
Expand Down Expand Up @@ -2244,7 +2244,7 @@ mod tests {
Pallet::<Test>::note_included(4, candidate_hash.clone(), 4);
assert_eq!(SpamSlots::<Test>::get(4), Some(vec![0, 0, 0, 0, 0, 0, 0]));

// Ensure the reward_validator function was correctly called
// Ensure the `reward_validator` function was correctly called
assert_eq!(
REWARD_VALIDATORS.with(|r| r.borrow().clone()),
vec![
Expand Down Expand Up @@ -2304,7 +2304,7 @@ mod tests {
assert_noop!(
{
Pallet::<Test>::revert_and_freeze(0);
Result::<(), ()>::Err(()) // Just a small trick in order to use assert_noop.
Result::<(), ()>::Err(()) // Just a small trick in order to use `assert_noop`.
},
(),
);
Expand All @@ -2325,7 +2325,7 @@ mod tests {
assert_noop!(
{
Pallet::<Test>::revert_and_freeze(10);
Result::<(), ()>::Err(()) // Just a small trick in order to use assert_noop.
Result::<(), ()>::Err(()) // Just a small trick in order to use `assert_noop`.
},
(),
);
Expand Down
4 changes: 2 additions & 2 deletions runtime/parachains/src/hrmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1964,7 +1964,7 @@ mod tests {
assert_eq!(<Test as Config>::Currency::free_balance(&para_a.into_account()), 80);

// Then deregister one parachain, but don't wait two sessions until it takes effect.
// Instead, para_b will confirm the request, which will take place the same time
// Instead, `para_b` will confirm the request, which will take place the same time
// the offboarding should happen.
deregister_parachain(para_a);
run_to_block(9, Some(vec![9]));
Expand All @@ -1973,7 +1973,7 @@ mod tests {
assert!(!channel_exists(para_a, para_b));
run_to_block(10, Some(vec![10]));

// The outcome we expect is para_b should receive the refund.
// The outcome we expect is `para_b` should receive the refund.
assert_eq!(<Test as Config>::Currency::free_balance(&para_b.into_account()), 110);
assert!(!channel_exists(para_a, para_b));
assert_storage_consistency_exhaustive();
Expand Down
4 changes: 2 additions & 2 deletions runtime/parachains/src/initializer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ pub mod pallet {
// - Paras
// - Scheduler
// - Inclusion
// - SessionInfo
// - `SessionInfo`
// - Disputes
// - DMP
// - UMP
Expand Down Expand Up @@ -292,7 +292,7 @@ impl<T: Config> Pallet<T> {
}
}

// Allow to trigger on_new_session in tests, this is needed as long as pallet_session is not
// Allow to trigger `on_new_session` in tests, this is needed as long as `pallet_session` is not
// implemented in mock.
#[cfg(any(test, feature = "runtime-benchmarks"))]
pub(crate) fn test_trigger_on_new_session<'a, I: 'a>(
Expand Down
2 changes: 1 addition & 1 deletion runtime/parachains/src/paras.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ impl<N: Ord + Copy + PartialEq> ParaPastCodeMeta<N> {
// no-op prune.
self.upgrade_times.drain(self.upgrade_times.len()..)
} else {
// if we are actually pruning something, update the last_pruned member.
// if we are actually pruning something, update the `last_pruned` member.
self.last_pruned = Some(self.upgrade_times[to_prune - 1].activated_at);
self.upgrade_times.drain(..to_prune)
};
Expand Down
2 changes: 1 addition & 1 deletion runtime/parachains/src/paras/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ benchmarks! {
let s in 1 .. MAX_HEAD_DATA_SIZE;
let para_id = ParaId::from(1000);
let new_head = HeadData(vec![0; s as usize]);
// schedule an expired code upgrade for this para_id so that force_note_new_head would use
// schedule an expired code upgrade for this `para_id` so that force_note_new_head would use
// the worst possible code path
let expired = frame_system::Pallet::<T>::block_number().saturating_sub(One::one());
let config = HostConfiguration::<T::BlockNumber>::default();
Expand Down
4 changes: 2 additions & 2 deletions runtime/parachains/src/paras_inherent/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ pub mod pallet {
#[pallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
fn on_initialize(_: T::BlockNumber) -> Weight {
T::DbWeight::get().reads_writes(1, 1) // in on_finalize.
T::DbWeight::get().reads_writes(1, 1) // in `on_finalize`.
}

fn on_finalize(_: T::BlockNumber) {
Expand Down Expand Up @@ -947,7 +947,7 @@ fn compute_entropy<T: Config>(parent_hash: T::Hash) -> [u8; 32] {
if let Some(vrf_random) = vrf_random {
entropy.as_mut().copy_from_slice(vrf_random.as_ref());
} else {
// in case there is no vrf randomness present, we utilize the relay parent
// in case there is no VRF randomness present, we utilize the relay parent
// as seed, it's better than a static value.
log::warn!(target: LOG_TARGET, "CurrentBlockRandomness did not provide entropy");
entropy.as_mut().copy_from_slice(parent_hash.as_ref());
Expand Down
4 changes: 2 additions & 2 deletions runtime/parachains/src/paras_inherent/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ mod enter {
new_test_ext(MockGenesisConfig::default()).execute_with(|| {
// Create the inherent data for this block
let dispute_statements = BTreeMap::new();
// No backed and concluding cores, so all cores will be fileld with disputesw
// No backed and concluding cores, so all cores will be filled with disputes
let backed_and_concluding = BTreeMap::new();

let scenario = make_inherent_data(TestConfig {
Expand Down Expand Up @@ -257,7 +257,7 @@ mod enter {
new_test_ext(MockGenesisConfig::default()).execute_with(|| {
// Create the inherent data for this block
let dispute_statements = BTreeMap::new();
// No backed and concluding cores, so all cores will be fileld with disputesw
// No backed and concluding cores, so all cores will be filled with disputes
let backed_and_concluding = BTreeMap::new();

let scenario = make_inherent_data(TestConfig {
Expand Down
4 changes: 2 additions & 2 deletions runtime/parachains/src/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ impl<T: Config> Pallet<T> {

let mut availability_cores = AvailabilityCores::<T>::get();
Scheduled::<T>::mutate(|scheduled| {
// The constraints on the function require that now_occupied is a sorted subset of the
// The constraints on the function require that `now_occupied` is a sorted subset of the
// `scheduled` cores, which are also sorted.

let mut occupied_iter = now_occupied.iter().cloned().peekable();
Expand Down Expand Up @@ -983,7 +983,7 @@ mod tests {
schedule_blank_para(thread_c, false);
}

// set up a queue as if n_cores was 4 and with some with many retries.
// set up a queue as if `n_cores` was 4 and with some with many retries.
ParathreadQueue::<Test>::put({
let mut queue = ParathreadClaimQueue::default();

Expand Down
2 changes: 1 addition & 1 deletion runtime/parachains/src/session_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ mod tests {
assert!(Sessions::<Test>::get(8).is_some());
assert!(Sessions::<Test>::get(9).is_some());

// changing dispute_period works
// changing `dispute_period` works
let dispute_period = 5;
Configuration::set_dispute_period(Origin::root(), dispute_period).unwrap();

Expand Down
4 changes: 2 additions & 2 deletions runtime/parachains/src/ump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ pub(crate) mod tests {
assert!(!queue.is_empty());
}

// actually count the counts and sizes in queues and compare them to the bookkeeped version.
// actually count the counts and sizes in queues and compare them to the bookkept version.
for (para, queue) in <Ump as Store>::RelayDispatchQueues::iter() {
let (expected_count, expected_size) = <Ump as Store>::RelayDispatchQueueSize::get(para);
let (actual_count, actual_size) =
Expand Down Expand Up @@ -934,7 +934,7 @@ pub(crate) mod tests {
)
.execute_with(|| {
// We want to test here an edge case, where we remove the queue with the highest
// para id (i.e. last in the needs_dispatch order).
// para id (i.e. last in the `needs_dispatch` order).
//
// If the last entry was removed we should proceed execution, assuming we still have
// weight available.
Expand Down

0 comments on commit 5027ac2

Please sign in to comment.