Unverified Commit 8a6af441 authored by Denis_P's avatar Denis_P 🏑 Committed by GitHub
Browse files

WIP: CI: add spellcheck (#3421)



* CI: add spellcheck

* revert me

* CI: explicit command for spellchecker

* spellcheck: edit misspells

* CI: run spellcheck on diff

* spellcheck: edits

* spellcheck: edit misspells

* spellcheck: add rules

* spellcheck: mv configs

* spellcheck: more edits

* spellcheck: chore

* spellcheck: one more thing

* spellcheck: and another one

* spellcheck: seems like it doesn't get to an end

* spellcheck: new words after rebase

* spellcheck: new words appearing out of nowhere

* chore

* review edits

* more review edits

* more edits

* wonky behavior

* wonky behavior 2

* wonky behavior 3

* change git behavior

* spellcheck: another bunch of new edits

* spellcheck: new words are koming out of nowhere

* CI: finding the master

* CI: fetching master implicitly

* CI: undebug

* new errors

* a bunch of new edits

* and some more

* Update node/core/approval-voting/src/approval_db/v1/mod.rs
Co-authored-by: Andronik Ordian's avatarAndronik Ordian <write@reusable.software>

* Update xcm/xcm-executor/src/assets.rs
Co-authored-by: Andronik Ordian's avatarAndronik Ordian <write@reusable.software>

* Apply suggestions from code review
Co-authored-by: Andronik Ordian's avatarAndronik Ordian <write@reusable.software>

* Suggestions from the code review

* CI: scan only changed files
Co-authored-by: Andronik Ordian's avatarAndronik Ordian <write@reusable.software>
parent 43920cd7
Pipeline #147422 canceled with stages
in 7 minutes and 46 seconds
......@@ -86,7 +86,7 @@ pub struct AssignmentCert {
pub vrf: (VRFOutput, VRFProof),
}
/// An assignment crt which refers to the candidate under which the assignment is
/// An assignment criterion which refers to the candidate under which the assignment is
/// relevant by block hash.
#[derive(Debug, Clone, Encode, Decode, PartialEq, Eq)]
pub struct IndirectAssignmentCert {
......
......@@ -27,7 +27,7 @@ use polkadot_primitives::v1::{CandidateReceipt, DisputeStatement, SessionIndex,
use super::{InvalidDisputeVote, SignedDisputeStatement, ValidDisputeVote};
/// A dispute initiating/participtating message that is guaranteed to have been built from signed
/// A dispute initiating/participating message that is guaranteed to have been built from signed
/// statements.
///
/// And most likely has been constructed correctly. This is used with
......@@ -102,7 +102,7 @@ impl DisputeMessage {
/// - the invalid statement is indeed an invalid one
/// - the valid statement is indeed a valid one
/// - The passed `CandidateReceipt` has the correct hash (as signed in the statements).
/// - the given validator indeces match with the given `ValidatorId`s in the statements,
/// - the given validator indices match with the given `ValidatorId`s in the statements,
/// given a `SessionInfo`.
///
/// We don't check whether the given `SessionInfo` matches the `SessionIndex` in the
......@@ -210,7 +210,7 @@ impl DisputeMessage {
}
impl UncheckedDisputeMessage {
/// Try to recover the two signed dispute votes from an UncheckedDisputeMessage.
/// Try to recover the two signed dispute votes from an `UncheckedDisputeMessage`.
pub fn try_into_signed_votes(self, session_info: &SessionInfo)
-> Result<(CandidateReceipt, (SignedDisputeStatement, ValidatorIndex), (SignedDisputeStatement, ValidatorIndex)), ()>
{
......
......@@ -1166,7 +1166,7 @@ fn testnet_accounts() -> Vec<AccountId> {
]
}
/// Helper function to create polkadot GenesisConfig for testing
/// Helper function to create polkadot `GenesisConfig` for testing
pub fn polkadot_testnet_genesis(
wasm_binary: &[u8],
initial_authorities: Vec<(
......@@ -1264,7 +1264,7 @@ pub fn polkadot_testnet_genesis(
}
}
/// Helper function to create kusama GenesisConfig for testing
/// Helper function to create kusama `GenesisConfig` for testing
#[cfg(feature = "kusama-native")]
pub fn kusama_testnet_genesis(
wasm_binary: &[u8],
......@@ -1368,7 +1368,7 @@ pub fn kusama_testnet_genesis(
}
}
/// Helper function to create westend GenesisConfig for testing
/// Helper function to create westend `GenesisConfig` for testing
#[cfg(feature = "westend-native")]
pub fn westend_testnet_genesis(
wasm_binary: &[u8],
......@@ -1456,7 +1456,7 @@ pub fn westend_testnet_genesis(
}
}
/// Helper function to create rococo GenesisConfig for testing
/// Helper function to create rococo `GenesisConfig` for testing
#[cfg(feature = "rococo-native")]
pub fn rococo_testnet_genesis(
wasm_binary: &[u8],
......
......@@ -227,7 +227,7 @@ where
target_hash = *target_header.parent_hash();
target_header = backend
.header(BlockId::Hash(target_hash))?
.expect("Header known to exist due to the existence of one of its descendents; qed");
.expect("Header known to exist due to the existence of one of its descendants; qed");
}
}
......@@ -281,7 +281,7 @@ where
}
/// GRANDPA hard forks due to borked migration of session keys after a runtime
/// upgrade (at #1491596), the signalled authority set changes were invalid
/// upgrade (at #1491596), the signaled authority set changes were invalid
/// (blank keys) and were impossible to finalize. The authorities for these
/// intermediary pending changes are replaced with a static list comprised of
/// w3f validators and randomly selected validators from the latest session (at
......
......@@ -11,7 +11,7 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//! A RocksDB instance for storing parachain data; availability data, and approvals.
//! A `RocksDB` instance for storing parachain data; availability data, and approvals.
#[cfg(feature = "full-node")]
use {
......
......@@ -245,7 +245,7 @@ impl<B> SelectChain<PolkadotBlock> for SelectRelayChain<B>
self.block_header(best_leaf)
}
/// Get the best descendent of `target_hash` that we should attempt to
/// Get the best descendant of `target_hash` that we should attempt to
/// finalize next, if any. It is valid to return the `target_hash` if
/// no better block exists.
///
......
......@@ -52,7 +52,7 @@ pub enum LeafStatus {
}
impl LeafStatus {
/// Returns a bool indicating fresh status.
/// Returns a `bool` indicating fresh status.
pub fn is_fresh(&self) -> bool {
match *self {
LeafStatus::Fresh => true,
......@@ -60,7 +60,7 @@ impl LeafStatus {
}
}
/// Returns a bool indicating stale status.
/// Returns a `bool` indicating stale status.
pub fn is_stale(&self) -> bool {
match *self {
LeafStatus::Fresh => false,
......@@ -97,12 +97,12 @@ pub struct ActiveLeavesUpdate {
}
impl ActiveLeavesUpdate {
/// Create a ActiveLeavesUpdate with a single activated hash
/// Create a `ActiveLeavesUpdate` with a single activated hash
pub fn start_work(activated: ActivatedLeaf) -> Self {
Self { activated: [activated][..].into(), ..Default::default() }
}
/// Create a ActiveLeavesUpdate with a single deactivated hash
/// Create a `ActiveLeavesUpdate` with a single deactivated hash
pub fn stop_work(hash: Hash) -> Self {
Self { deactivated: [hash][..].into(), ..Default::default() }
}
......@@ -114,7 +114,7 @@ impl ActiveLeavesUpdate {
}
impl PartialEq for ActiveLeavesUpdate {
/// Equality for `ActiveLeavesUpdate` doesnt imply bitwise equality.
/// Equality for `ActiveLeavesUpdate` doesn't imply bitwise equality.
///
/// Instead, it means equality when `activated` and `deactivated` are considered as sets.
fn eq(&self, other: &Self) -> bool {
......
......@@ -217,7 +217,7 @@ pub enum DisputeCoordinatorMessage {
/// `InvalidImport`)
/// - or were known already (in that case the result will still be `ValidImport`)
/// - or we recorded them because (`ValidImport`)
/// - we casted our own vote already on that dispute
/// - we cast our own vote already on that dispute
/// - or we have approval votes on that candidate
/// - or other explicit votes on that candidate already recorded
/// - or recovered availability for the candidate
......@@ -490,7 +490,7 @@ pub enum AvailabilityStoreMessage {
}
impl AvailabilityStoreMessage {
/// In fact, none of the AvailabilityStore messages assume a particular relay parent.
/// In fact, none of the `AvailabilityStore` messages assume a particular relay parent.
pub fn relay_parent(&self) -> Option<Hash> {
match self {
_ => None,
......@@ -697,8 +697,8 @@ pub enum ProvisionerMessage {
/// This message allows external subsystems to request the set of bitfields and backed candidates
/// associated with a particular potential block hash.
///
/// This is expected to be used by a proposer, to inject that information into the InherentData
/// where it can be assembled into the ParaInherent.
/// This is expected to be used by a proposer, to inject that information into the `InherentData`
/// where it can be assembled into the `ParaInherent`.
RequestInherentData(Hash, oneshot::Sender<ProvisionerInherentData>),
/// This data should become part of a relay chain block
ProvisionableData(Hash, ProvisionableData),
......
......@@ -59,8 +59,8 @@ impl<M> NetworkBridgeEvent<M> {
/// for example into a `BitfieldDistributionMessage` in case of the `BitfieldDistribution`
/// constructor.
///
/// Therefore a NetworkBridgeEvent<ValidationProtocol> will become for example a
/// NetworkBridgeEvent<BitfieldDistributionMessage>, with the more specific message type
/// Therefore a `NetworkBridgeEvent<ValidationProtocol>` will become for example a
/// `NetworkBridgeEvent<BitfieldDistributionMessage>`, with the more specific message type
/// `BitfieldDistributionMessage`.
///
/// This acts as a call to `clone`, except in the case where the event is a message event,
......
......@@ -126,7 +126,7 @@ pub enum Error {
/// The type system wants this even though it doesn't make sense
#[error(transparent)]
Infallible(#[from] std::convert::Infallible),
/// Attempted to convert from an AllMessages to a FromJob, and failed.
/// Attempted to convert from an `AllMessages` to a `FromJob`, and failed.
#[error("AllMessage not relevant to Job")]
SenderConversion(String),
/// The local node is not a validator.
......@@ -276,7 +276,7 @@ pub fn choose_random_subset<T, F: FnMut(&T) -> bool>(is_priority: F, mut v: Vec<
v
}
/// Returns a bool with a probability of `a / b` of being true.
/// Returns a `bool` with a probability of `a / b` of being true.
pub fn gen_ratio(a: usize, b: usize) -> bool {
use rand::Rng as _;
let mut rng = rand::thread_rng();
......@@ -372,7 +372,7 @@ impl Drop for AbortOnDrop {
}
}
/// A JobHandle manages a particular job for a subsystem.
/// A `JobHandle` manages a particular job for a subsystem.
struct JobHandle<ToJob> {
_abort_handle: AbortOnDrop,
to_job: mpsc::Sender<ToJob>,
......
......@@ -62,14 +62,14 @@ pub struct RuntimeInfo {
/// overseer seems sensible.
session_index_cache: LruCache<Hash, SessionIndex>,
/// Look up cached sessions by SessionIndex.
/// Look up cached sessions by `SessionIndex`.
session_info_cache: LruCache<SessionIndex, ExtendedSessionInfo>,
/// Key store for determining whether we are a validator and what `ValidatorIndex` we have.
keystore: Option<SyncCryptoStorePtr>,
}
/// SessionInfo with additional useful data for validator nodes.
/// `SessionInfo` with additional useful data for validator nodes.
pub struct ExtendedSessionInfo {
/// Actual session info as fetched from the runtime.
pub session_info: SessionInfo,
......@@ -303,7 +303,7 @@ where
)
}
/// Get group rotation info based on the given relay_parent.
/// Get group rotation info based on the given `relay_parent`.
pub async fn get_group_rotation_info<Context>(ctx: &mut Context, relay_parent: Hash)
-> Result<GroupRotationInfo>
where
......
......@@ -24,7 +24,7 @@ use sc_block_builder::{BlockBuilderProvider, BlockBuilder};
use sp_state_machine::BasicExternalities;
use parity_scale_codec::{Encode, Decode};
/// An extension for the test client to init a Polkadot specific block builder.
/// An extension for the test client to initialize a Polkadot specific block builder.
pub trait InitPolkadotBlockBuilder {
/// Init a Polkadot specific block builder that works for the test runtime.
///
......
......@@ -38,7 +38,7 @@ pub type Executor = client::LocalCallExecutor<Block, FullBackend, sc_executor::N
/// Test client builder for Polkadot.
pub type TestClientBuilder = substrate_test_client::TestClientBuilder<Block, Executor, FullBackend, GenesisParameters>;
/// LongestChain type for the test runtime/client.
/// `LongestChain` type for the test runtime/client.
pub type LongestChain = sc_consensus::LongestChain<FullBackend, Block>;
/// Parameters of test-client builder with test-runtime.
......
......@@ -47,7 +47,7 @@ sc_executor::native_executor_instance!(
(benchmarking::benchmarking::HostFunctions, SignatureVerificationOverride),
);
/// ChainInfo implementation.
/// `ChainInfo` implementation.
pub struct PolkadotChainInfo;
impl ChainInfo for PolkadotChainInfo {
......
......@@ -14,8 +14,8 @@
// You should have received a copy of the GNU General Public License
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
//! Binary used for simnet nodes, supports all runtimes, although only polkadot is implemented currently.
//! This binary accepts all the cli args the polkadot binary does, Only difference is it uses
//! Binary used for Simnet nodes, supports all runtimes, although only polkadot is implemented currently.
//! This binary accepts all the CLI args the polkadot binary does, Only difference is it uses
//! manual-seal™ and babe for block authorship, it has a no-op verifier, so all blocks received over the network
//! are imported and executed straight away. Block authorship/Finalization maybe done by calling the
//! `engine_createBlock` & `engine_FinalizeBlock` rpc methods respectively.
......
......@@ -13,7 +13,7 @@
// You should have received a copy of the GNU General Public License
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
//! Attempts to upgrade the polkadot runtime, in a simnet environment
//! Attempts to upgrade the polkadot runtime, in a Simnet environment
use std::{error::Error, str::FromStr};
use polkadot_simnet::{run, dispatch_with_root};
......
......@@ -92,7 +92,7 @@ fn testnet_accounts() -> Vec<AccountId> {
]
}
/// Helper function to create polkadot GenesisConfig for testing
/// Helper function to create polkadot `GenesisConfig` for testing
fn polkadot_testnet_genesis(
initial_authorities: Vec<(
AccountId,
......
......@@ -285,7 +285,7 @@ pub fn run_collator_node(
/// A Polkadot test node instance used for testing.
pub struct PolkadotTestNode {
/// TaskManager's instance.
/// `TaskManager`'s instance.
pub task_manager: TaskManager,
/// Client's instance.
pub client: Arc<Client>,
......@@ -293,7 +293,7 @@ pub struct PolkadotTestNode {
pub overseer_handler: Handle,
/// The `MultiaddrWithPeerId` to this node. This is useful if you want to pass it as "boot node" to other nodes.
pub addr: MultiaddrWithPeerId,
/// RPCHandlers to make RPC queries.
/// `RPCHandlers` to make RPC queries.
pub rpc_handlers: RpcHandlers,
}
......
......@@ -427,7 +427,7 @@ pub struct AbridgedCandidateReceipt<H = Hash> {
pub collator: CollatorId,
/// Signature on blake2-256 of the block data by collator.
pub signature: CollatorSignature,
/// The hash of the pov-block.
/// The hash of the `pov-block`.
pub pov_block_hash: H,
/// Commitments made as a result of validation.
pub commitments: CandidateCommitments<H>,
......@@ -561,9 +561,9 @@ pub struct CandidateDescriptor<H = Hash> {
/// The collator's relay-chain account ID
pub collator: CollatorId,
/// Signature on blake2-256 of components of this receipt:
/// The para ID, the relay parent, and the pov_hash.
/// The para ID, the relay parent, and the `pov_hash`.
pub signature: CollatorSignature,
/// The hash of the pov-block.
/// The hash of the `pov-block`.
pub pov_hash: H,
}
......@@ -582,12 +582,12 @@ pub struct CollationInfo {
pub signature: CollatorSignature,
/// The head-data
pub head_data: HeadData,
/// blake2-256 Hash of the pov-block
/// blake2-256 Hash of the `pov-block`
pub pov_block_hash: Hash,
}
impl CollationInfo {
/// Check integrity vs. a pov-block.
/// Check integrity vs. a `pov-block`.
pub fn check_signature(&self) -> Result<(), ()> {
check_collator_signature(
&self.relay_parent,
......
......@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
//! V1 Primitives.
//! `V1` Primitives.
use sp_std::prelude::*;
use sp_std::collections::btree_map::BTreeMap;
......@@ -114,7 +114,7 @@ pub mod well_known_keys {
})
}
/// The hrmp channel for the given identifier.
/// The HRMP channel for the given identifier.
///
/// The storage entry should be accessed as an `AbridgedHrmpChannel` encoded value.
pub fn hrmp_channels(channel: HrmpChannelId) -> Vec<u8> {
......@@ -293,12 +293,12 @@ pub struct CandidateDescriptor<H = Hash> {
/// relay-chain state which may vary based on bitfields included before the candidate.
/// Thus it cannot be derived entirely from the relay-parent.
pub persisted_validation_data_hash: Hash,
/// The blake2-256 hash of the pov.
/// The blake2-256 hash of the PoV.
pub pov_hash: Hash,
/// The root of a block's erasure encoding Merkle tree.
pub erasure_root: Hash,
/// Signature on blake2-256 of components of this receipt:
/// The parachain index, the relay parent, the validation data hash, and the pov_hash.
/// The parachain index, the relay parent, the validation data hash, and the `pov_hash`.
pub signature: CollatorSignature,
/// Hash of the para header that is being generated by this candidate.
pub para_head: Hash,
......@@ -374,7 +374,7 @@ impl<H> CommittedCandidateReceipt<H> {
}
impl<H: Clone> CommittedCandidateReceipt<H> {
/// Transforms this into a plain CandidateReceipt.
/// Transforms this into a plain `CandidateReceipt`.
pub fn to_plain(&self) -> CandidateReceipt<H> {
CandidateReceipt {
descriptor: self.descriptor.clone(),
......@@ -642,7 +642,7 @@ impl GroupRotationInfo {
/// Returns the index of the group needed to validate the core at the given index, assuming
/// the given number of cores.
///
/// `core_index` should be less than `cores`, which is capped at u32::max().
/// `core_index` should be less than `cores`, which is capped at `u32::max()`.
pub fn group_for_core(&self, core_index: CoreIndex, cores: usize) -> GroupIndex {
if self.group_rotation_frequency == 0 { return GroupIndex(core_index.0) }
if cores == 0 { return GroupIndex(0) }
......@@ -660,7 +660,7 @@ impl GroupRotationInfo {
/// Returns the index of the group assigned to the given core. This does no checking or
/// whether the group index is in-bounds.
///
/// `core_index` should be less than `cores`, which is capped at u32::max().
/// `core_index` should be less than `cores`, which is capped at `u32::max()`.
pub fn core_for_group(&self, group_index: GroupIndex, cores: usize) -> CoreIndex {
if self.group_rotation_frequency == 0 { return CoreIndex(group_index.0) }
if cores == 0 { return CoreIndex(0) }
......@@ -844,7 +844,7 @@ pub struct SessionInfo {
pub n_cores: u32,
/// The zeroth delay tranche width.
pub zeroth_delay_tranche_width: u32,
/// The number of samples we do of relay_vrf_modulo.
/// The number of samples we do of `relay_vrf_modulo`.
pub relay_vrf_modulo_samples: u32,
/// The number of delay tranches in total.
pub n_delay_tranches: u32,
......@@ -886,7 +886,7 @@ sp_api::decl_runtime_apis! {
/// Cores are either free or occupied. Free cores can have paras assigned to them.
fn availability_cores() -> Vec<CoreState<H, N>>;
/// Yields the persisted validation data for the given ParaId along with an assumption that
/// Yields the persisted validation data for the given `ParaId` along with an assumption that
/// should be used if the para currently occupies a core.
///
/// Returns `None` if either the para is not registered or the assumption is `Freed`
......@@ -1029,7 +1029,7 @@ pub enum ConsensusLog {
#[codec(index = 3)]
ForceApprove(BlockNumber),
/// A signal to revert the block number in the same chain as the
/// header this digest is part of and all of its descendents.
/// header this digest is part of and all of its descendants.
///
/// It is a no-op for a block to contain a revert digest targeting
/// its own number or a higher number.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment