dev-comment spelling mistakes (#4434)

This commit is contained in:
Bernhard Schuster
2021-12-06 15:20:29 +01:00
committed by GitHub
parent 854d92a4a4
commit 4adb8466a3
26 changed files with 59 additions and 59 deletions
+4 -4
View File
@@ -149,10 +149,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,
)
}
+5 -5
View File
@@ -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::<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![
@@ -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`.
},
(),
);
@@ -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`.
},
(),
);
+2 -2
View File
@@ -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]));
@@ -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();
@@ -147,7 +147,7 @@ pub mod pallet {
// - Paras
// - Scheduler
// - Inclusion
// - SessionInfo
// - `SessionInfo`
// - Disputes
// - DMP
// - UMP
@@ -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>(
+1 -1
View File
@@ -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)
};
@@ -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();
@@ -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) {
@@ -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());
@@ -203,7 +203,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 filld with disputes.
// 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 {
+2 -2
View File
@@ -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();
@@ -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();
@@ -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();
+2 -2
View File
@@ -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) =
@@ -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.