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 <write@reusable.software>

* Update xcm/xcm-executor/src/assets.rs

Co-authored-by: Andronik Ordian <write@reusable.software>

* Apply suggestions from code review

Co-authored-by: Andronik Ordian <write@reusable.software>

* Suggestions from the code review

* CI: scan only changed files

Co-authored-by: Andronik Ordian <write@reusable.software>
This commit is contained in:
Denis Pisarev
2021-07-14 19:22:58 +02:00
committed by GitHub
parent f6305d29be
commit fc253e6e4d
239 changed files with 927 additions and 761 deletions
+9 -9
View File
@@ -89,7 +89,7 @@ pub mod pallet {
/// The length of each sample to take during the ending period.
///
/// EndingPeriod / SampleLength = Total # of Samples
/// `EndingPeriod` / `SampleLength` = Total # of Samples
#[pallet::constant]
type SampleLength: Get<Self::BlockNumber>;
@@ -114,24 +114,24 @@ pub mod pallet {
pub enum Event<T: Config> {
/// An auction started. Provides its index and the block number where it will begin to
/// close and the first lease period of the quadruplet that is auctioned.
/// [auction_index, lease_period, ending]
/// `[auction_index, lease_period, ending]`
AuctionStarted(AuctionIndex, LeasePeriodOf<T>, T::BlockNumber),
/// An auction ended. All funds become unreserved. [auction_index]
/// An auction ended. All funds become unreserved. `[auction_index]`
AuctionClosed(AuctionIndex),
/// Funds were reserved for a winning bid. First balance is the extra amount reserved.
/// Second is the total. [bidder, extra_reserved, total_amount]
/// Second is the total. `[bidder, extra_reserved, total_amount]`
Reserved(T::AccountId, BalanceOf<T>, BalanceOf<T>),
/// Funds were unreserved since bidder is no longer active. [bidder, amount]
/// Funds were unreserved since bidder is no longer active. `[bidder, amount]`
Unreserved(T::AccountId, BalanceOf<T>),
/// Someone attempted to lease the same slot twice for a parachain. The amount is held in reserve
/// but no parachain slot has been leased.
/// \[parachain_id, leaser, amount\]
/// `[parachain_id, leaser, amount]`
ReserveConfiscated(ParaId, T::AccountId, BalanceOf<T>),
/// A new bid has been accepted as the current winner.
/// \[who, para_id, amount, first_slot, last_slot\]
/// `[who, para_id, amount, first_slot, last_slot]`
BidAccepted(T::AccountId, ParaId, BalanceOf<T>, LeasePeriodOf<T>, LeasePeriodOf<T>),
/// The winning offset was chosen for an auction. This will map into the `Winning` storage map.
/// \[auction_index, block_number\]
/// `[auction_index, block_number]`
WinningOffset(AuctionIndex, T::BlockNumber),
}
@@ -565,7 +565,7 @@ impl<T: Config> Pallet<T> {
/// Calculate the final winners from the winning slots.
///
/// This is a simple dynamic programming algorithm designed by Al, the original code is at:
/// https://github.com/w3f/consensus/blob/master/NPoS/auctiondynamicthing.py
/// `https://github.com/w3f/consensus/blob/master/NPoS/auctiondynamicthing.py`
fn calculate_winners(
mut winning: WinningData<T>
) -> WinnersData<T> {
+2 -2
View File
@@ -157,7 +157,7 @@ pub mod pallet {
#[pallet::generate_deposit(pub(super) fn deposit_event)]
#[pallet::metadata(T::AccountId = "AccountId", BalanceOf<T> = "Balance")]
pub enum Event<T: Config> {
/// Someone claimed some DOTs. [who, ethereum_address, amount]
/// Someone claimed some DOTs. `[who, ethereum_address, amount]`
Claimed(T::AccountId, EthereumAddress, BalanceOf<T>),
}
@@ -167,7 +167,7 @@ pub mod pallet {
InvalidEthereumSignature,
/// Ethereum address has no claim.
SignerHasNoClaim,
/// Account ID sending tx has no claim.
/// Account ID sending transaction has no claim.
SenderHasNoClaim,
/// There's not enough in the pot to pay out some unvested amount. Generally implies a logic
/// error.
+19 -19
View File
@@ -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/>.
//! # Parachain Crowdloaning pallet
//! # Parachain `Crowdloaning` pallet
//!
//! The point of this pallet is to allow parachain projects to offer the ability to help fund a
//! deposit for the parachain. When the crowdloan has ended, the funds are returned.
@@ -136,11 +136,11 @@ pub struct FundInfo<AccountId, Balance, BlockNumber, LeasePeriod> {
/// If this is `Ending(n)`, this fund received a contribution during the current ending period,
/// where `n` is how far into the ending period the contribution was made.
last_contribution: LastContribution<BlockNumber>,
/// First lease period in range to bid on; it's actually a LeasePeriod, but that's the same type
/// as BlockNumber.
/// First lease period in range to bid on; it's actually a `LeasePeriod`, but that's the same type
/// as `BlockNumber`.
first_period: LeasePeriod,
/// Last lease period in range to bid on; it's actually a LeasePeriod, but that's the same type
/// as BlockNumber.
/// Last lease period in range to bid on; it's actually a `LeasePeriod`, but that's the same type
/// as `BlockNumber`.
last_period: LeasePeriod,
/// Index used for the child trie of this fund
trie_index: TrieIndex,
@@ -160,7 +160,7 @@ pub mod pallet {
pub trait Config: frame_system::Config {
type Event: From<Event<Self>> + IsType<<Self as frame_system::Config>::Event>;
/// PalletId for the crowdloan pallet. An appropriate value could be ```PalletId(*b"py/cfund")```
/// `PalletId` for the crowdloan pallet. An appropriate value could be `PalletId(*b"py/cfund")`
#[pallet::constant]
type PalletId: Get<PalletId>;
@@ -168,7 +168,7 @@ pub mod pallet {
type SubmissionDeposit: Get<BalanceOf<Self>>;
/// The minimum amount that may be contributed into a crowdloan. Should almost certainly be at
/// least ExistentialDeposit.
/// least `ExistentialDeposit`.
#[pallet::constant]
type MinContribution: Get<BalanceOf<Self>>;
@@ -176,7 +176,7 @@ pub mod pallet {
#[pallet::constant]
type RemoveKeysLimit: Get<u32>;
/// The parachain registrar type. We jus use this to ensure that only the manager of a para is able to
/// The parachain registrar type. We just use this to ensure that only the manager of a para is able to
/// start a crowdloan for its slot.
type Registrar: Registrar<AccountId=Self::AccountId>;
@@ -223,26 +223,26 @@ pub mod pallet {
#[pallet::generate_deposit(pub(super) fn deposit_event)]
#[pallet::metadata(T::AccountId = "AccountId", BalanceOf<T> = "Balance")]
pub enum Event<T: Config> {
/// Create a new crowdloaning campaign. [fund_index]
/// Create a new crowdloaning campaign. `[fund_index]`
Created(ParaId),
/// Contributed to a crowd sale. [who, fund_index, amount]
/// Contributed to a crowd sale. `[who, fund_index, amount]`
Contributed(T::AccountId, ParaId, BalanceOf<T>),
/// Withdrew full balance of a contributor. [who, fund_index, amount]
/// Withdrew full balance of a contributor. `[who, fund_index, amount]`
Withdrew(T::AccountId, ParaId, BalanceOf<T>),
/// The loans in a fund have been partially dissolved, i.e. there are some left
/// over child keys that still need to be killed. [fund_index]
/// over child keys that still need to be killed. `[fund_index]`
PartiallyRefunded(ParaId),
/// All loans in a fund have been refunded. [fund_index]
/// All loans in a fund have been refunded. `[fund_index]`
AllRefunded(ParaId),
/// Fund is dissolved. [fund_index]
/// Fund is dissolved. `[fund_index]`
Dissolved(ParaId),
/// The result of trying to submit a new bid to the Slots pallet.
HandleBidResult(ParaId, DispatchResult),
/// The configuration to a crowdloan has been edited. [fund_index]
/// The configuration to a crowdloan has been edited. `[fund_index]`
Edited(ParaId),
/// A memo has been updated. [who, fund_index, memo]
/// A memo has been updated. `[who, fund_index, memo]`
MemoUpdated(T::AccountId, ParaId, Vec<u8>),
/// A parachain has been moved to NewRaise
/// A parachain has been moved to `NewRaise`
AddedToNewRaise(ParaId),
}
@@ -288,7 +288,7 @@ pub mod pallet {
InvalidSignature,
/// The provided memo is too large.
MemoTooLarge,
/// The fund is already in NewRaise
/// The fund is already in `NewRaise`
AlreadyInNewRaise,
/// No contributions allowed during the VRF delay
VrfDelayInProgress,
@@ -637,7 +637,7 @@ pub mod pallet {
Ok(())
}
/// Poke the fund into NewRaise
/// Poke the fund into `NewRaise`
///
/// Origin must be Signed, and the fund has non-zero raise.
#[pallet::weight(T::WeightInfo::poke())]
+1 -1
View File
@@ -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/>.
//! Auxillary struct/enums for polkadot runtime.
//! Auxiliary `struct`/`enum`s for polkadot runtime.
use frame_support::traits::{OnUnbalanced, Imbalance, Currency};
use crate::NegativeImbalance;
+1 -1
View File
@@ -121,7 +121,7 @@ pub type SlowAdjustingFeeUpdate<R> = TargetedFeeAdjustment<
/// The type used for currency conversion.
///
/// This must only be used as long as the balance type is u128.
/// This must only be used as long as the balance type is `u128`.
pub type CurrencyToVote = frame_support::traits::U128CurrencyToVote;
static_assertions::assert_eq_size!(primitives::v1::Balance, u128);
+7 -7
View File
@@ -44,7 +44,7 @@ impl<T> pallet_mmr::primitives::OnNewRoot<beefy_primitives::MmrRootHash> for Dep
}
}
/// Convert BEEFY secp256k1 public keys into uncompressed form
/// Convert BEEFY `secp256k1` public keys into uncompressed form
pub struct UncompressBeefyEcdsaKeys;
impl Convert<beefy_primitives::crypto::AuthorityId, Vec<u8>> for UncompressBeefyEcdsaKeys {
fn convert(a: beefy_primitives::crypto::AuthorityId) -> Vec<u8> {
@@ -60,7 +60,7 @@ impl Convert<beefy_primitives::crypto::AuthorityId, Vec<u8>> for UncompressBeefy
}
}
/// A leaf that gets added every block to the MMR constructed by [pallet_mmr].
/// A leaf that gets added every block to the MMR constructed by `[pallet_mmr]`.
#[derive(RuntimeDebug, PartialEq, Eq, Clone, Encode, Decode)]
pub struct MmrLeaf<BlockNumber, Hash, MerkleRoot> {
/// Current block parent number and hash.
@@ -86,7 +86,7 @@ pub struct BeefyNextAuthoritySet<MerkleRoot> {
/// of signatures. We put set length here, so that these clients can verify the minimal
/// number of required signatures.
pub len: u32,
/// Merkle Root Hash build from BEEFY AuthorityIds.
/// Merkle Root Hash build from BEEFY `AuthorityIds`.
///
/// This is used by Light Clients to confirm that the commitments are signed by the correct
/// validator set. Light Clients using interactive protocol, might verify only subset of
@@ -132,9 +132,9 @@ pub mod pallet {
#[pallet::config]
#[pallet::disable_frame_system_supertrait_check]
pub trait Config: pallet_mmr::Config + pallet_beefy::Config {
/// Convert BEEFY AuthorityId to a form that would end up in the Merkle Tree.
/// Convert BEEFY `AuthorityId` to a form that would end up in the Merkle Tree.
///
/// For instance for ECDSA (secp256k1) we want to store uncompressed public keys (65 bytes)
/// For instance for ECDSA (`secp256k1`) we want to store uncompressed public keys (65 bytes)
/// to simplify using them on Ethereum chain, but the rest of the Substrate codebase
/// is storing them compressed (33 bytes) for efficiency reasons.
type BeefyAuthorityToMerkleLeaf: Convert<<Self as pallet_beefy::Config>::BeefyId, Vec<u8>>;
@@ -186,7 +186,7 @@ impl<T: Config> Pallet<T> where
/// NOTE this does not include parathreads - only parachains are part of the merkle tree.
///
/// NOTE This is an initial and inefficient implementation, which re-constructs
/// the merkle tree every block. Instead we should update the merkle root in [Self::on_initialize]
/// the merkle tree every block. Instead we should update the merkle root in `[Self::on_initialize]`
/// call of this pallet and update the merkle tree efficiently (use on-chain storage to persist inner nodes).
fn parachain_heads_merkle_root() -> MerkleRootOf<T> {
let para_heads = T::ParachainHeads::encoded_heads();
@@ -196,7 +196,7 @@ impl<T: Config> Pallet<T> where
/// Returns details of the next BEEFY authority set.
///
/// Details contain authority set id, authority set length and a merkle root,
/// constructed from uncompressed secp256k1 public keys of the next BEEFY authority set.
/// constructed from uncompressed `secp256k1` public keys of the next BEEFY authority set.
///
/// This function will use a storage-cached entry in case the set didn't change, or compute and cache
/// new one in case it did.
@@ -202,7 +202,7 @@ pub mod pallet {
///
/// This function must be called by a Root origin.
///
/// The deposit taken can be specified for this registration. Any ParaId
/// The deposit taken can be specified for this registration. Any `ParaId`
/// can be registered, including sub-1000 IDs which are System Parachains.
#[pallet::weight(T::WeightInfo::force_register())]
pub fn force_register(
@@ -344,7 +344,7 @@ impl<T: Config> Registrar for Pallet<T> {
// Register a Para ID under control of `manager`.
//
// Note this is a backend registration api, so verification of ParaId
// Note this is a backend registration API, so verification of ParaId
// is not done here to prevent.
fn register(
manager: T::AccountId,
+3 -3
View File
@@ -140,7 +140,7 @@ pub mod pallet {
PaymentAccountSet(T::AccountId),
/// A new statement was set.
StatementUpdated,
/// A new statement was set. [block_number]
/// A new statement was set. `[block_number]`
UnlockBlockUpdated(T::BlockNumber),
}
@@ -226,7 +226,7 @@ pub mod pallet {
/// Update the validity status of an existing account. If set to completed, the account
/// will no longer be able to continue through the crowdfund process.
///
/// We check tht the account exists at this stage, but has not completed the process.
/// We check that the account exists at this stage, but has not completed the process.
///
/// Origin must match the `ValidityOrigin`.
#[pallet::weight(T::DbWeight::get().reads_writes(1, 1))]
@@ -248,7 +248,7 @@ pub mod pallet {
/// Update the balance of a valid account.
///
/// We check tht the account is valid for a balance transfer at this point.
/// We check that the account is valid for a balance transfer at this point.
///
/// Origin must match the `ValidityOrigin`.
#[pallet::weight(T::DbWeight::get().reads_writes(2, 1))]
+1 -1
View File
@@ -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/>.
//! The SlotRange struct which succinctly handles the 36 values that
//! The `SlotRange` struct which succinctly handles the 36 values that
//! represent all sub ranges between 0 and 7 inclusive.
slot_range_helper::generate_slot_range!(Zero(0), One(1), Two(2), Three(3), Four(4), Five(5), Six(6), Seven(7));
+3 -3
View File
@@ -97,12 +97,12 @@ decl_event!(
ParaId = ParaId,
Balance = BalanceOf<T>,
{
/// A new [lease_period] is beginning.
/// A new `[lease_period]` is beginning.
NewLeasePeriod(LeasePeriod),
/// A para has won the right to a continuous set of lease periods as a parachain.
/// First balance is any extra amount reserved on top of the para's existing deposit.
/// Second balance is the total amount reserved.
/// \[parachain_id, leaser, period_begin, period_count, extra_reserved, total_amount\]
/// `[parachain_id, leaser, period_begin, period_count, extra_reserved, total_amount]`
Leased(ParaId, AccountId, LeasePeriod, LeasePeriod, Balance, Balance),
}
);
@@ -135,7 +135,7 @@ decl_module! {
}
}
/// Just a hotwire into the `lease_out` call, in case Root wants to force some lease to happen
/// Just a connect to the `lease_out` call, in case Root wants to force some lease to happen
/// independently of any other on-chain mechanism to use it.
///
/// Can only be called by the Root origin.
+6 -6
View File
@@ -31,18 +31,18 @@ pub trait Registrar {
/// Report the manager (permissioned owner) of a parachain, if there is one.
fn manager_of(id: ParaId) -> Option<Self::AccountId>;
/// All parachains. Ordered ascending by ParaId. Parathreads are not included.
/// All parachains. Ordered ascending by `ParaId`. Parathreads are not included.
fn parachains() -> Vec<ParaId>;
/// Return if a ParaId is a Parachain.
/// Return if a `ParaId` is a Parachain.
fn is_parachain(id: ParaId) -> bool {
Self::parachains().binary_search(&id).is_ok()
}
/// Return if a ParaId is a Parathread.
/// Return if a `ParaId` is a Parathread.
fn is_parathread(id: ParaId) -> bool;
/// Return if a ParaId is registered in the system.
/// Return if a `ParaId` is registered in the system.
fn is_registered(id: ParaId) -> bool {
Self::is_parathread(id) || Self::is_parachain(id)
}
@@ -109,9 +109,9 @@ pub trait Leaser {
/// Lease a new parachain slot for `para`.
///
/// `leaser` shall have a total of `amount` balance reserved by the implementor of this trait.
/// `leaser` shall have a total of `amount` balance reserved by the implementer of this trait.
///
/// Note: The implementor of the trait (the leasing system) is expected to do all reserve/unreserve calls. The
/// Note: The implementer of the trait (the leasing system) is expected to do all reserve/unreserve calls. The
/// caller of this trait *SHOULD NOT* pre-reserve the deposit (though should ensure that it is reservable).
///
/// The lease will last from `period_begin` for `period_count` lease periods. It is undefined if the `para`
+2 -2
View File
@@ -14,14 +14,14 @@
// You should have received a copy of the GNU General Public License
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
//! Xcm sender for relay chain.
//! XCM sender for relay chain.
use parity_scale_codec::Encode;
use sp_std::marker::PhantomData;
use xcm::opaque::{VersionedXcm, v0::{SendXcm, MultiLocation, Junction, Xcm, Result, Error}};
use runtime_parachains::{configuration, dmp};
/// Xcm sender for relay chain. It only sends downward message.
/// XCM sender for relay chain. It only sends downward message.
pub struct ChildParachainRouter<T>(PhantomData<T>);
impl<T: configuration::Config + dmp::Config> SendXcm for ChildParachainRouter<T> {