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
...@@ -32,7 +32,7 @@ pub(crate) struct Signer { ...@@ -32,7 +32,7 @@ pub(crate) struct Signer {
pub(crate) account: AccountId, pub(crate) account: AccountId,
/// The full crypto key-pair. /// The full crypto key-pair.
pub(crate) pair: Pair, pub(crate) pair: Pair,
/// The raw uri read from file. /// The raw URI read from file.
pub(crate) uri: String, pub(crate) uri: String,
} }
...@@ -51,7 +51,7 @@ pub(crate) async fn get_account_info<T: frame_system::Config>( ...@@ -51,7 +51,7 @@ pub(crate) async fn get_account_info<T: frame_system::Config>(
.await .await
} }
/// Read the signer account's uri from the given `path`. /// Read the signer account's URI from the given `path`.
pub(crate) async fn read_signer_uri< pub(crate) async fn read_signer_uri<
P: AsRef<Path>, P: AsRef<Path>,
T: frame_system::Config<AccountId = AccountId, Index = Index>, T: frame_system::Config<AccountId = AccountId, Index = Index>,
......
...@@ -48,7 +48,7 @@ pub mod opaque { ...@@ -48,7 +48,7 @@ pub mod opaque {
pub use crate::v0::opaque::{Xcm, Order}; pub use crate::v0::opaque::{Xcm, Order};
} }
/// The basic VersionedXcm type which just uses the `Vec<u8>` as an encoded call. /// The basic `VersionedXcm` type which just uses the `Vec<u8>` as an encoded call.
pub type VersionedXcm = super::VersionedXcm<()>; pub type VersionedXcm = super::VersionedXcm<()>;
} }
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>. // along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
//! Support datastructures for `MultiLocation`, primarily the `Junction` datatype. //! Support data structures for `MultiLocation`, primarily the `Junction` datatype.
use alloc::vec::Vec; use alloc::vec::Vec;
use parity_scale_codec::{self, Encode, Decode}; use parity_scale_codec::{self, Encode, Decode};
......
...@@ -171,7 +171,7 @@ pub enum Xcm<Call> { ...@@ -171,7 +171,7 @@ pub enum Xcm<Call> {
/// - `assets`: The asset(s) to be withdrawn. /// - `assets`: The asset(s) to be withdrawn.
/// - `dest`: The new owner for the assets. /// - `dest`: The new owner for the assets.
/// - `effects`: The orders that should be contained in the `ReserveAssetDeposit` which is sent onwards to /// - `effects`: The orders that should be contained in the `ReserveAssetDeposit` which is sent onwards to
/// `dest. /// `dest`.
/// ///
/// Safety: No concerns. /// Safety: No concerns.
/// ///
......
...@@ -28,7 +28,7 @@ pub enum AssetInstance { ...@@ -28,7 +28,7 @@ pub enum AssetInstance {
/// Undefined - used if the NFA class has only one instance. /// Undefined - used if the NFA class has only one instance.
Undefined, Undefined,
/// A compact index. Technically this could be greater than u128, but this implementation supports only /// A compact index. Technically this could be greater than `u128`, but this implementation supports only
/// values up to `2**128 - 1`. /// values up to `2**128 - 1`.
Index { #[codec(compact)] id: u128 }, Index { #[codec(compact)] id: u128 },
......
...@@ -66,7 +66,7 @@ pub enum MultiLocation { ...@@ -66,7 +66,7 @@ pub enum MultiLocation {
X8(Junction, Junction, Junction, Junction, Junction, Junction, Junction, Junction), X8(Junction, Junction, Junction, Junction, Junction, Junction, Junction, Junction),
} }
/// Maximum number of junctions a multilocation can contain. /// Maximum number of junctions a `MultiLocation` can contain.
pub const MAX_MULTILOCATION_LENGTH: usize = 8; pub const MAX_MULTILOCATION_LENGTH: usize = 8;
impl From<Junction> for MultiLocation { impl From<Junction> for MultiLocation {
......
...@@ -49,7 +49,7 @@ pub enum Order<Call> { ...@@ -49,7 +49,7 @@ pub enum Order<Call> {
/// - `assets`: The asset(s) to remove from holding. /// - `assets`: The asset(s) to remove from holding.
/// - `dest`: The new owner for the assets. /// - `dest`: The new owner for the assets.
/// - `effects`: The orders that should be contained in the `ReserveAssetDeposit` which is sent onwards to /// - `effects`: The orders that should be contained in the `ReserveAssetDeposit` which is sent onwards to
/// `dest. /// `dest`.
/// ///
/// Errors: /// Errors:
#[codec(index = 2)] #[codec(index = 2)]
...@@ -101,7 +101,7 @@ pub enum Order<Call> { ...@@ -101,7 +101,7 @@ pub enum Order<Call> {
#[codec(index = 6)] #[codec(index = 6)]
QueryHolding { #[codec(compact)] query_id: u64, dest: MultiLocation, assets: Vec<MultiAsset> }, QueryHolding { #[codec(compact)] query_id: u64, dest: MultiLocation, assets: Vec<MultiAsset> },
/// Pay for the execution of some Xcm with up to `weight` picoseconds of execution time, paying for this with /// Pay for the execution of some XCM with up to `weight` picoseconds of execution time, paying for this with
/// up to `fees` from the holding account. /// up to `fees` from the holding account.
/// ///
/// Errors: /// Errors:
......
...@@ -171,7 +171,7 @@ impl<C> ExecuteXcm<C> for () { ...@@ -171,7 +171,7 @@ impl<C> ExecuteXcm<C> for () {
/// ///
/// These can be amalgamated in tuples to form sophisticated routing systems. In tuple format, each router might return /// These can be amalgamated in tuples to form sophisticated routing systems. In tuple format, each router might return
/// `CannotReachDestination` to pass the execution to the next sender item. Note that each `CannotReachDestination` /// `CannotReachDestination` to pass the execution to the next sender item. Note that each `CannotReachDestination`
/// might alter the destination and the xcm message for to the next router. /// might alter the destination and the XCM message for to the next router.
/// ///
/// ///
/// # Example /// # Example
......
...@@ -21,7 +21,7 @@ use xcm::v0::{MultiAsset, MultiLocation}; ...@@ -21,7 +21,7 @@ use xcm::v0::{MultiAsset, MultiLocation};
use frame_support::traits::Get; use frame_support::traits::Get;
use xcm_executor::traits::FilterAssetLocation; use xcm_executor::traits::FilterAssetLocation;
/// Accepts an asset IFF it is a native asset. /// Accepts an asset iff it is a native asset.
pub struct NativeAsset; pub struct NativeAsset;
impl FilterAssetLocation for NativeAsset { impl FilterAssetLocation for NativeAsset {
fn filter_asset_location(asset: &MultiAsset, origin: &MultiLocation) -> bool { fn filter_asset_location(asset: &MultiAsset, origin: &MultiLocation) -> bool {
...@@ -29,7 +29,7 @@ impl FilterAssetLocation for NativeAsset { ...@@ -29,7 +29,7 @@ impl FilterAssetLocation for NativeAsset {
} }
} }
/// Accepts an asset if it is contained in the given `T`'s `Get` impl. /// Accepts an asset if it is contained in the given `T`'s `Get` implementation.
pub struct Case<T>(PhantomData<T>); pub struct Case<T>(PhantomData<T>);
impl<T: Get<(MultiAsset, MultiLocation)>> FilterAssetLocation for Case<T> { impl<T: Get<(MultiAsset, MultiLocation)>> FilterAssetLocation for Case<T> {
fn filter_asset_location(asset: &MultiAsset, origin: &MultiLocation) -> bool { fn filter_asset_location(asset: &MultiAsset, origin: &MultiLocation) -> bool {
......
...@@ -21,7 +21,7 @@ use xcm::v0::{Error as XcmError, Result, MultiAsset, MultiLocation, Junction}; ...@@ -21,7 +21,7 @@ use xcm::v0::{Error as XcmError, Result, MultiAsset, MultiLocation, Junction};
use frame_support::traits::{Get, tokens::fungibles, Contains}; use frame_support::traits::{Get, tokens::fungibles, Contains};
use xcm_executor::traits::{TransactAsset, Convert, MatchesFungibles, Error as MatchError}; use xcm_executor::traits::{TransactAsset, Convert, MatchesFungibles, Error as MatchError};
/// Converter struct implementing `AssetIdConversion` converting a numeric asset ID (must be TryFrom/TryInto<u128>) into /// Converter struct implementing `AssetIdConversion` converting a numeric asset ID (must be `TryFrom/TryInto<u128>`) into
/// a `GeneralIndex` junction, prefixed by some `MultiLocation` value. The `MultiLocation` value will typically be a /// a `GeneralIndex` junction, prefixed by some `MultiLocation` value. The `MultiLocation` value will typically be a
/// `PalletInstance` junction. /// `PalletInstance` junction.
pub struct AsPrefixedGeneralIndex<Prefix, AssetId, ConvertAssetId>(PhantomData<(Prefix, AssetId, ConvertAssetId)>); pub struct AsPrefixedGeneralIndex<Prefix, AssetId, ConvertAssetId>(PhantomData<(Prefix, AssetId, ConvertAssetId)>);
......
...@@ -172,7 +172,7 @@ impl< ...@@ -172,7 +172,7 @@ impl<
} }
} }
/// EnsureOrigin barrier to convert from dispatch origin to XCM origin, if one exists. /// `EnsureOrigin` barrier to convert from dispatch origin to XCM origin, if one exists.
pub struct EnsureXcmOrigin<Origin, Conversion>(PhantomData<(Origin, Conversion)>); pub struct EnsureXcmOrigin<Origin, Conversion>(PhantomData<(Origin, Conversion)>);
impl< impl<
Origin: OriginTrait + Clone, Origin: OriginTrait + Clone,
...@@ -227,7 +227,7 @@ impl< ...@@ -227,7 +227,7 @@ impl<
} }
/// `Convert` implementation to convert from some an origin which implements `Backing` into a corresponding `Plurality` /// `Convert` implementation to convert from some an origin which implements `Backing` into a corresponding `Plurality`
/// MultiLocation. /// `MultiLocation`.
/// ///
/// Typically used when configuring `pallet-xcm` for allowing a collective's Origin to dispatch an XCM from a /// Typically used when configuring `pallet-xcm` for allowing a collective's Origin to dispatch an XCM from a
/// `Plurality` origin. /// `Plurality` origin.
......
...@@ -128,7 +128,7 @@ impl<T: Get<(MultiLocation, u128)>, R: TakeRevenue> Drop for FixedRateOfConcrete ...@@ -128,7 +128,7 @@ impl<T: Get<(MultiLocation, u128)>, R: TakeRevenue> Drop for FixedRateOfConcrete
} }
} }
/// Weight trader which uses the TransactionPayment pallet to set the right price for weight and then /// Weight trader which uses the `TransactionPayment` pallet to set the right price for weight and then
/// places any weight bought into the right account. /// places any weight bought into the right account.
pub struct UsingComponents< pub struct UsingComponents<
WeightToFee: WeightToFeePolynomial<Balance=Currency::Balance>, WeightToFee: WeightToFeePolynomial<Balance=Currency::Balance>,
......
...@@ -26,7 +26,7 @@ pub enum AssetId { ...@@ -26,7 +26,7 @@ pub enum AssetId {
} }
impl AssetId { impl AssetId {
/// Prepend a MultiLocation to a concrete asset, giving it a new root location. /// Prepend a `MultiLocation` to a concrete asset, giving it a new root location.
pub fn prepend_location(&mut self, prepend: &MultiLocation) -> Result<(), ()> { pub fn prepend_location(&mut self, prepend: &MultiLocation) -> Result<(), ()> {
if let AssetId::Concrete(ref mut l) = self { if let AssetId::Concrete(ref mut l) = self {
l.prepend_with(prepend.clone()).map_err(|_| ())?; l.prepend_with(prepend.clone()).map_err(|_| ())?;
......
...@@ -22,7 +22,7 @@ use crate::traits::{ ...@@ -22,7 +22,7 @@ use crate::traits::{
OnResponse, OnResponse,
}; };
/// The trait to parametrize the `XcmExecutor`. /// The trait to parameterize the `XcmExecutor`.
pub trait Config { pub trait Config {
/// The outer call dispatch type. /// The outer call dispatch type.
type Call: Parameter + Dispatchable<PostInfo=PostDispatchInfo> + GetDispatchInfo; type Call: Parameter + Dispatchable<PostInfo=PostDispatchInfo> + GetDispatchInfo;
......
...@@ -19,7 +19,7 @@ use parity_scale_codec::{Encode, Decode}; ...@@ -19,7 +19,7 @@ use parity_scale_codec::{Encode, Decode};
use xcm::v0::{MultiLocation, OriginKind}; use xcm::v0::{MultiLocation, OriginKind};
/// Generic third-party conversion trait. Use this when you don't want to force the user to use default /// Generic third-party conversion trait. Use this when you don't want to force the user to use default
/// impls of `From` and `Into` for the types you wish to convert between. /// implementations of `From` and `Into` for the types you wish to convert between.
/// ///
/// One of `convert`/`convert_ref` and `reverse`/`reverse_ref` MUST be implemented. If possible, implement /// One of `convert`/`convert_ref` and `reverse`/`reverse_ref` MUST be implemented. If possible, implement
/// `convert_ref`, since this will never result in a clone. Use `convert` when you definitely need to consume /// `convert_ref`, since this will never result in a clone. Use `convert` when you definitely need to consume
...@@ -118,7 +118,7 @@ impl<T: Clone + Encode + Decode> Convert<Vec<u8>, T> for Decoded { ...@@ -118,7 +118,7 @@ impl<T: Clone + Encode + Decode> Convert<Vec<u8>, T> for Decoded {
fn reverse_ref(value: impl Borrow<T>) -> Result<Vec<u8>, ()> { Ok(value.borrow().encode()) } fn reverse_ref(value: impl Borrow<T>) -> Result<Vec<u8>, ()> { Ok(value.borrow().encode()) }
} }
/// A convertor trait for origin types. /// A converter `trait` for origin types.
/// ///
/// Can be amalgamated into tuples. If any of the tuple elements returns `Ok(_)`, it short circuits. Else, the `Err(_)` /// Can be amalgamated into tuples. If any of the tuple elements returns `Ok(_)`, it short circuits. Else, the `Err(_)`
/// of the last tuple item is returned. Each intermediate `Err(_)` might return a different `origin` of type `Origin` /// of the last tuple item is returned. Each intermediate `Err(_)` might return a different `origin` of type `Origin`
......
...@@ -31,7 +31,7 @@ pub trait ShouldExecute { ...@@ -31,7 +31,7 @@ pub trait ShouldExecute {
/// - `message`: The message itself. /// - `message`: The message itself.
/// - `shallow_weight`: The weight of the non-negotiable execution of the message. This does not include any /// - `shallow_weight`: The weight of the non-negotiable execution of the message. This does not include any
/// embedded XCMs sat behind mechanisms like `BuyExecution` which would need to answer for their own weight. /// embedded XCMs sat behind mechanisms like `BuyExecution` which would need to answer for their own weight.
/// - `weight_credit`: The pre-established amount of weight that the system has determined this message may utilise /// - `weight_credit`: The pre-established amount of weight that the system has determined this message may utilize
/// in its execution. Typically non-zero only because of prior fee payment, but could in principle be due to other /// in its execution. Typically non-zero only because of prior fee payment, but could in principle be due to other
/// factors. /// factors.
fn should_execute<Call>( fn should_execute<Call>(
......
...@@ -44,7 +44,7 @@ pub trait TransactAsset { ...@@ -44,7 +44,7 @@ pub trait TransactAsset {
/// not be needed if the teleporting chains are to be trusted, but better to be safe than sorry). On chains /// not be needed if the teleporting chains are to be trusted, but better to be safe than sorry). On chains
/// where the asset is not native then it will generally just be a no-op. /// where the asset is not native then it will generally just be a no-op.
/// ///
/// When composed as a tuple, all type-items are called. It is up to the implementor that there exists no /// When composed as a tuple, all type-items are called. It is up to the implementer that there exists no
/// value for `_what` which can cause side-effects for more than one of the type-items. /// value for `_what` which can cause side-effects for more than one of the type-items.
fn check_in(_origin: &MultiLocation, _what: &MultiAsset) {} fn check_in(_origin: &MultiLocation, _what: &MultiAsset) {}
...@@ -56,7 +56,7 @@ pub trait TransactAsset { ...@@ -56,7 +56,7 @@ pub trait TransactAsset {
/// be needed if the teleporting chains are to be trusted, but better to be safe than sorry). On chains where /// be needed if the teleporting chains are to be trusted, but better to be safe than sorry). On chains where
/// the asset is not native then it will generally just be a no-op. /// the asset is not native then it will generally just be a no-op.
/// ///
/// When composed as a tuple, all type-items are called. It is up to the implementor that there exists no /// When composed as a tuple, all type-items are called. It is up to the implementer that there exists no
/// value for `_what` which can cause side-effects for more than one of the type-items. /// value for `_what` which can cause side-effects for more than one of the type-items.
fn check_out(_origin: &MultiLocation, _what: &MultiAsset) {} fn check_out(_origin: &MultiLocation, _what: &MultiAsset) {}
......
...@@ -41,7 +41,7 @@ pub trait WeightBounds<Call> { ...@@ -41,7 +41,7 @@ pub trait WeightBounds<Call> {
/// ///
/// This is guaranteed equal to the eventual sum of all `shallow` XCM messages that get executed through /// This is guaranteed equal to the eventual sum of all `shallow` XCM messages that get executed through
/// any internal effects. Inner XCM messages may be executed by: /// any internal effects. Inner XCM messages may be executed by:
/// - Order::BuyExecution /// - `Order::BuyExecution`
fn deep(message: &mut Xcm<Call>) -> Result<Weight, ()>; fn deep(message: &mut Xcm<Call>) -> Result<Weight, ()>;
/// Return the total weight for executing `message`. /// Return the total weight for executing `message`.
......
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