diff --git a/runtime/parachains/src/builder.rs b/runtime/parachains/src/builder.rs index d164cdd77ae2..32b46a48f40e 100644 --- a/runtime/parachains/src/builder.rs +++ b/runtime/parachains/src/builder.rs @@ -107,10 +107,10 @@ impl BenchBuilder { /// 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, ) } diff --git a/runtime/parachains/src/disputes.rs b/runtime/parachains/src/disputes.rs index 47b9061e3653..030ce633437a 100644 --- a/runtime/parachains/src/disputes.rs +++ b/runtime/parachains/src/disputes.rs @@ -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); } @@ -1579,7 +1579,7 @@ mod tests { }); } - // Test prunning works + // Test pruning works #[test] fn test_initializer_on_new_session() { let dispute_period = 3; @@ -2244,7 +2244,7 @@ mod tests { Pallet::::note_included(4, candidate_hash.clone(), 4); assert_eq!(SpamSlots::::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![ @@ -2304,7 +2304,7 @@ mod tests { assert_noop!( { Pallet::::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`. }, (), ); @@ -2325,7 +2325,7 @@ mod tests { assert_noop!( { Pallet::::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`. }, (), ); diff --git a/runtime/parachains/src/hrmp.rs b/runtime/parachains/src/hrmp.rs index 87ba4ad861b8..82e8f90a26ba 100644 --- a/runtime/parachains/src/hrmp.rs +++ b/runtime/parachains/src/hrmp.rs @@ -1964,7 +1964,7 @@ mod tests { assert_eq!(::Currency::free_balance(¶_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])); @@ -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!(::Currency::free_balance(¶_b.into_account()), 110); assert!(!channel_exists(para_a, para_b)); assert_storage_consistency_exhaustive(); diff --git a/runtime/parachains/src/initializer.rs b/runtime/parachains/src/initializer.rs index 0467e10f1a4b..d8be40eb56db 100644 --- a/runtime/parachains/src/initializer.rs +++ b/runtime/parachains/src/initializer.rs @@ -147,7 +147,7 @@ pub mod pallet { // - Paras // - Scheduler // - Inclusion - // - SessionInfo + // - `SessionInfo` // - Disputes // - DMP // - UMP @@ -292,7 +292,7 @@ impl Pallet { } } - // 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>( diff --git a/runtime/parachains/src/paras.rs b/runtime/parachains/src/paras.rs index 8e8b2a6d6c96..ececbf7a15d0 100644 --- a/runtime/parachains/src/paras.rs +++ b/runtime/parachains/src/paras.rs @@ -249,7 +249,7 @@ impl ParaPastCodeMeta { // 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) }; diff --git a/runtime/parachains/src/paras/benchmarking.rs b/runtime/parachains/src/paras/benchmarking.rs index 9c3de5cf9b2c..d3b7b9484f92 100644 --- a/runtime/parachains/src/paras/benchmarking.rs +++ b/runtime/parachains/src/paras/benchmarking.rs @@ -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::::block_number().saturating_sub(One::one()); let config = HostConfiguration::::default(); diff --git a/runtime/parachains/src/paras_inherent/mod.rs b/runtime/parachains/src/paras_inherent/mod.rs index ce0bd0132728..d97ecf097b01 100644 --- a/runtime/parachains/src/paras_inherent/mod.rs +++ b/runtime/parachains/src/paras_inherent/mod.rs @@ -142,7 +142,7 @@ pub mod pallet { #[pallet::hooks] impl Hooks> for Pallet { 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) { @@ -947,7 +947,7 @@ fn compute_entropy(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()); diff --git a/runtime/parachains/src/paras_inherent/tests.rs b/runtime/parachains/src/paras_inherent/tests.rs index 7eeacb5c167b..1d2948d66171 100644 --- a/runtime/parachains/src/paras_inherent/tests.rs +++ b/runtime/parachains/src/paras_inherent/tests.rs @@ -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 { @@ -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 { diff --git a/runtime/parachains/src/scheduler.rs b/runtime/parachains/src/scheduler.rs index 706fd844b316..519646dab320 100644 --- a/runtime/parachains/src/scheduler.rs +++ b/runtime/parachains/src/scheduler.rs @@ -533,7 +533,7 @@ impl Pallet { let mut availability_cores = AvailabilityCores::::get(); Scheduled::::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(); @@ -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::::put({ let mut queue = ParathreadClaimQueue::default(); diff --git a/runtime/parachains/src/session_info.rs b/runtime/parachains/src/session_info.rs index d69f71e827b9..9c53357cb6c4 100644 --- a/runtime/parachains/src/session_info.rs +++ b/runtime/parachains/src/session_info.rs @@ -264,7 +264,7 @@ mod tests { assert!(Sessions::::get(8).is_some()); assert!(Sessions::::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(); diff --git a/runtime/parachains/src/ump.rs b/runtime/parachains/src/ump.rs index 47111e357db9..9bcb393f9de8 100644 --- a/runtime/parachains/src/ump.rs +++ b/runtime/parachains/src/ump.rs @@ -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 ::RelayDispatchQueues::iter() { let (expected_count, expected_size) = ::RelayDispatchQueueSize::get(para); let (actual_count, actual_size) = @@ -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.