Fix various spelling errors (#4940)

* meaningfull -> meaningful

* initialise -> initialize

* tokans -> tokens

* incentivise -> incentivize

* lenght -> length

* incentivisation -> incentivization

* doesnt't -> doesn't

* overwriten -> overwritten

* lifecycle -> life cycle

* lifecycle -> life cycle

* usefull -> useful

* noone -> no one

* spaming -> spamming

* defered -> deferred

* hieght -> height

* sumation -> summation

* ingore -> ignore

* registed -> registered

* Auxialary -> Auxiliary

* loggin -> logging

* independance -> independence

* trailling -> trailing

* responsability -> responsibility

* trunkated -> truncated

* Weither -> Whether

* informations -> information

* Runtume -> Runtime

* choosen -> chosen

* delcataion -> declaration

* Unchekced -> Unchecked

* defintion -> definition

* scrach -> scratch

* imput -> input

* transfered -> transferred

* endownment -> endowment

* Determinator -> Determiner

* relevent -> relevant

* emited -> emitted

* acocunt -> account

* proprotional -> proportional

* instantiaion -> instantiation

* commited -> committed

* tombstonedead -> tombstone

* uwnrap -> unwrap

* acount -> account

* specialised -> specialized

* existant -> existent

* requried -> required

* Anull -> Annul

* AUTHORITES -> AUTHORITIES

* underyling -> underlying

* recognisable -> recognizable

* Capitalise -> Capitalize

* reportfor -> report for

* hearbeat -> heartbeat

* onlineness -> being online

* creater -> creator

* Bytearray -> Byte array

* Despoit -> Deposit

* substratced -> subtracted

* Curent -> Current

* imbalanes -> imbalances

* countfown -> countdown

* inexisting -> inexistent

* additionaly -> additionally

* substracted -> subtracted

* auxilary -> auxiliary

* parital -> partial

* in't -> isn't

* compatability -> compatibility

* infomation -> information

* etected -> detected

* extrinsiscs -> extrinsics

* reprensentation -> representation

* coonfiguration -> configuration

* primtives -> primitives

* miscelanious -> miscellaneous

* VERISON -> VERSION

* endcoded -> encoded

* Genrates -> Generates

* miliseconds -> milliseconds

* occured -> occurred

* trully -> truely

* truely -> truly

* conjuction -> conjunction

* encouters -> encounters

* customised -> customized

* deterministicly -> deterministically

* finalisation -> finalization

* pluggable -> plugable

* wakeup -> wake-up

* interemdiate -> intermediate

* intepreting -> interpreting

* finalzied -> finalized

* throgh -> through

* extinsic -> extrinsic

* convient -> convenient

* allocater -> allocator

* propagateable -> propagatable

* succesfuly -> successfully

* finalising -> finalizing

* publically -> publicly

* phrasee -> phrase

* substration -> substractions

* substractions -> subtractions

* neccessarily -> necessarily

* Inlucde -> Include

* unefficient -> inefficient

* thay -> they

* funtion -> function

* datastructures -> data structures

* infromation -> information

* propagatable -> propagable

* ecountered -> encountered

* recognise -> recognize

* intergration -> integration

* lastet -> latest

* datatypes -> data types

* datatype -> data type

* Strongarming -> Strong Arming

* avaible -> available

* Commiting -> Committing

* Retreiving -> Retrieving

* shoud -> should

* canonicaliziation -> canonicalization

* comitted -> committed

* clonable -> cloneable

* Uknown -> Unknown

* reponse -> response

* arbitary -> arbitrary

* Capapbilities -> Capabilities

* responsbile -> responsible

* initialisation -> initialization

* cames -> came

* intemediate -> intermediate

* reqeust -> request

* intance -> instance

* explcitly -> explicitly

* neighor -> neighbor

* reolving -> resolving

* untill -> until

* Validte -> Validate

* deserailize -> deserialize

* literaly -> literally

* preceeding -> preceding

* abpve -> above

* chcecked -> checked

* numbet -> number

* Unknow -> Unknown

* halfs -> halves

* gossup -> gossip

* givent -> given

* immediatelly -> immediately

* slicable -> sliceable

* conensus -> consensus

* Mimicks -> Mimics

* acccept -> accept

* serialise -> serialize

* exstrinsics -> extrinsics

* panicks -> panics

* maintaince -> maintenance

* repeatidely -> repeatedly

* anecstor -> ancestor

* becasue -> because

* processer -> processor

* Prunning -> Pruning

* insterested -> interested

* unuseful -> not useful

* yeided -> yielded

* descendfing -> descending

* corresponts -> corresponds

* survivew -> survive

* keps -> keeps

* ligh -> light

* prerequisities -> prerequisites

* positiion -> position

* depedency -> dependency

* extrinisic -> extrinsic

* atomicaly -> atomically

* staticly -> statically

* resul -> result

* timestamb -> timestamp

* Utilites -> Utilities

* ammount -> amount

* pocess -> process

* exteral -> external

* Update client/finality-grandpa/src/tests.rs

* Update primitives/io/src/lib.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update primitives/blockchain/src/lib.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update frame/support/src/weights.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update bin/node/cli/tests/common.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update client/api/src/execution_extensions.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update client/cli/src/params.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update client/executor/common/src/sandbox.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update client/api/src/execution_extensions.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update client/finality-grandpa/src/communication/mod.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update client/state-db/src/pruning.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update frame/contracts/src/tests.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update client/api/src/execution_extensions.rs

* bump impl

* timestamb -> timestamp

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
This commit is contained in:
Shawn Tabrizi
2020-02-17 15:07:24 +01:00
committed by GitHub
parent 86ab0cb4d9
commit c7a14db792
169 changed files with 281 additions and 282 deletions
+1 -1
View File
@@ -1224,7 +1224,7 @@ impl<T: Trait<I>, I: Instance> ReservableCurrency<T::AccountId> for Module<T, I>
let actual = cmp::min(account.reserved, value);
account.reserved -= actual;
// defensive only: this can never fail since total issuance which is at least free+reserved
// fits into the same datatype.
// fits into the same data type.
account.free = account.free.saturating_add(actual);
value - actual
})
+1 -1
View File
@@ -15,7 +15,7 @@
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
//! Collective system: Members of a set of account IDs can make their collective feelings known
//! through dispatched calls from one of two specialised origins.
//! through dispatched calls from one of two specialized origins.
//!
//! The membership can be provided in one of two ways: either directly, using the Root-dispatchable
//! function `set_members`, or indirectly, through implementing the `ChangeMembers`
+2 -2
View File
@@ -141,7 +141,7 @@ Note that in case of storage modification we need to construct a key in the unde
- then perform `blake2_256` hashing of the storage key.
- concatenation of these hashes will constitute the key in the underlying storage.
There is also a special case to think of: if the balance of some account goes below `existential_deposit`, then all storage entries of that account will be erased, which requires time proprotional to the number of storage entries that account has.
There is also a special case to think of: if the balance of some account goes below `existential_deposit`, then all storage entries of that account will be erased, which requires time proportional to the number of storage entries that account has.
**complexity**: `N` inserts into a `Map` or eventually into the storage (if committed). Every deleted account will induce removal of all its storage which is proportional to the number of storage entries that account has.
@@ -236,7 +236,7 @@ This function takes the code of the constructor and input data. Instantiation of
**Note** that the complexity of executing the constructor code should be considered separately.
**Note** that the complexity of `DetermineContractAddress` hook should be considered separately as well. Most likely it will use some kind of hashing over the code of the constructor and input data. The default `SimpleAddressDeterminator` does precisely that.
**Note** that the complexity of `DetermineContractAddress` hook should be considered separately as well. Most likely it will use some kind of hashing over the code of the constructor and input data. The default `SimpleAddressDeterminer` does precisely that.
**Note** that the constructor returns code in the owned form and it's obtained via return facilities, which should have take fee for the return value.
+1 -1
View File
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
//! A crate that hosts a common definitions that are relevent for the pallet-contracts.
//! A crate that hosts a common definitions that are relevant for the pallet-contracts.
#![cfg_attr(not(feature = "std"), no_std)]
@@ -76,7 +76,7 @@ sp_api::decl_runtime_apis! {
/// Returns the projected time a given contract will be able to sustain paying its rent.
///
/// The returned projection is relevent for the current block, i.e. it is as if the contract
/// The returned projection is relevant for the current block, i.e. it is as if the contract
/// was accessed at the current block.
///
/// Returns `Err` if the contract is in a tombstone state or doesn't exist.
+1 -1
View File
@@ -138,7 +138,7 @@ pub trait ContractsApi<BlockHash, BlockNumber, AccountId, Balance> {
/// Returns the projected time a given contract will be able to sustain paying its rent.
///
/// The returned projection is relevent for the given block, i.e. it is as if the contract was
/// The returned projection is relevant for the given block, i.e. it is as if the contract was
/// accessed at the beginning of that block.
///
/// Returns `None` if the contract is exempted from rent.
+1 -1
View File
@@ -1122,7 +1122,7 @@ mod tests {
);
});
// This test sends 50 units of currency as an endownment to a newly
// This test sends 50 units of currency as an endowment to a newly
// instantiated contract.
ExtBuilder::default().existential_deposit(15).build().execute_with(|| {
let mut loader = MockLoader::empty();
+4 -4
View File
@@ -143,7 +143,7 @@ pub trait ComputeDispatchFee<Call, Balance> {
fn compute_dispatch_fee(call: &Call) -> Balance;
}
/// Information for managing an acocunt and its sub trie abstraction.
/// Information for managing an account and its sub trie abstraction.
/// This is the required info to cache for an account
#[derive(Encode, Decode, RuntimeDebug)]
pub enum ContractInfo<T: Trait> {
@@ -432,8 +432,8 @@ pub trait Trait: frame_system::Trait {
/// and the account id that requested the account creation.
///
/// Formula: `blake2_256(blake2_256(code) + blake2_256(data) + origin)`
pub struct SimpleAddressDeterminator<T: Trait>(PhantomData<T>);
impl<T: Trait> ContractAddressFor<CodeHash<T>, T::AccountId> for SimpleAddressDeterminator<T>
pub struct SimpleAddressDeterminer<T: Trait>(PhantomData<T>);
impl<T: Trait> ContractAddressFor<CodeHash<T>, T::AccountId> for SimpleAddressDeterminer<T>
where
T::AccountId: UncheckedFrom<T::Hash> + AsRef<[u8]>
{
@@ -494,7 +494,7 @@ decl_module! {
/// The minimum amount required to generate a tombstone.
const TombstoneDeposit: BalanceOf<T> = T::TombstoneDeposit::get();
/// Size of a contract at the time of instantiaion. This is a simple way to ensure that
/// Size of a contract at the time of instantiation. This is a simple way to ensure that
/// empty contracts eventually gets deleted.
const StorageSizeOffset: u32 = T::StorageSizeOffset::get();
+1 -1
View File
@@ -327,7 +327,7 @@ pub fn snitch_contract_should_be_evicted<T: Trait>(
}
/// Returns the projected time a given contract will be able to sustain paying its rent. The
/// returned projection is relevent for the current block, i.e. it is as if the contract was
/// returned projection is relevant for the current block, i.e. it is as if the contract was
/// accessed at the beginning of the current block. Returns `None` in case if the contract was
/// evicted before or as a result of the rent collection.
///
+6 -6
View File
@@ -597,7 +597,7 @@ fn dispatch_call() {
topics: vec![],
},
// Event emited as a result of dispatch.
// Event emitted as a result of dispatch.
EventRecord {
phase: Phase::ApplyExtrinsic(0),
event: MetaEvent::contracts(RawEvent::Dispatched(BOB, true)),
@@ -1052,7 +1052,7 @@ fn claim_surcharge_malus() {
}
/// Claim surcharge with the given trigger_call at the given blocks.
/// if removes is true then assert that the contract is a tombstonedead
/// If `removes` is true then assert that the contract is a tombstone.
fn claim_surcharge(blocks: u64, trigger_call: impl Fn() -> bool, removes: bool) {
let (wasm, code_hash) = compile_module::<Test>(CODE_SET_RENT).unwrap();
@@ -2119,11 +2119,11 @@ const CODE_SELF_DESTRUCT: &str = r#"
;; Read own address into memory.
(call $ext_scratch_read
(i32.const 16) ;; Pointer to write address to
(i32.const 0) ;; Offset into scrach buffer
(i32.const 0) ;; Offset into scratch buffer
(i32.const 8) ;; Length of encoded address
)
;; Recursively call self with empty imput data.
;; Recursively call self with empty input data.
(call $assert
(i32.eq
(call $ext_call
@@ -2155,7 +2155,7 @@ const CODE_SELF_DESTRUCT: &str = r#"
;; Read balance into memory.
(call $ext_scratch_read
(i32.const 8) ;; Pointer to write balance to
(i32.const 0) ;; Offset into scrach buffer
(i32.const 0) ;; Offset into scratch buffer
(i32.const 8) ;; Length of encoded balance
)
@@ -2484,7 +2484,7 @@ const CODE_SELF_DESTRUCTING_CONSTRUCTOR: &str = r#"
;; Read balance into memory.
(call $ext_scratch_read
(i32.const 8) ;; Pointer to write balance to
(i32.const 0) ;; Offset into scrach buffer
(i32.const 0) ;; Offset into scratch buffer
(i32.const 8) ;; Length of encoded balance
)
@@ -716,10 +716,10 @@ define_env!(Env, <E: Ext>,
// Record a request to restore the caller contract to the specified contract.
//
// At the finalization stage, i.e. when all changes from the extrinsic that invoked this
// contract are commited, this function will compute a tombstone hash from the caller's
// contract are committed, this function will compute a tombstone hash from the caller's
// storage and the given code hash and if the hash matches the hash found in the tombstone at
// the specified address - kill the caller contract and restore the destination contract and set
// the specified `rent_allowance`. All caller's funds are transfered to the destination.
// the specified `rent_allowance`. All caller's funds are transferred to the destination.
//
// This function doesn't perform restoration right away but defers it to the end of the
// transaction. If there is no tombstone in the destination address or if the hashes don't match
+2 -2
View File
@@ -2066,7 +2066,7 @@ mod tests {
}
#[test]
/// If transactor already voted, delegated vote is overwriten.
/// If transactor already voted, delegated vote is overwritten.
fn single_proposal_should_work_with_vote_and_delegation() {
new_test_ext().execute_with(|| {
System::set_block_number(0);
@@ -2121,7 +2121,7 @@ mod tests {
}
#[test]
/// If transactor voted, delegated vote is overwriten.
/// If transactor voted, delegated vote is overwritten.
fn single_proposal_should_work_with_delegation_and_vote() {
new_test_ext().execute_with(|| {
System::set_block_number(0);
+1 -1
View File
@@ -81,7 +81,7 @@ mod tests;
// for B blocks following, there's a counting period whereby each of the candidates that believe
// they fall in the top K+C voted can present themselves. they get the total stake
// recorded (based on the snapshot); an ordered list is maintained (the leaderboard). Noone may
// recorded (based on the snapshot); an ordered list is maintained (the leaderboard). No one may
// present themselves that, if elected, would result in being included twice in the collective
// (important since existing members will have their approval votes as it may be that they
// don't get removed), nor if existing presenters would mean they're not in the top K+C.
+1 -1
View File
@@ -29,7 +29,7 @@ pub struct Log {
pub address: H160,
/// Topics of the log.
pub topics: Vec<H256>,
/// Bytearray data of the log.
/// Byte array data of the log.
pub data: Vec<u8>,
}
+1 -1
View File
@@ -177,7 +177,7 @@ decl_module! {
fn deposit_event() = default;
/// Despoit balance from currency/balances module into EVM.
/// Deposit balance from currency/balances module into EVM.
#[weight = SimpleDispatchInfo::FixedNormal(10_000)]
fn deposit_balance(origin, value: BalanceOf<T>) {
let sender = ensure_signed(origin)?;
+3 -3
View File
@@ -32,7 +32,7 @@
//! not the internals of the module implementation. Only state inputs,
//! outputs, and a brief description that mentions whether calling it
//! requires root, but without repeating the source code details.
//! Capitalise the first word of each documentation comment and end it with
//! Capitalize the first word of each documentation comment and end it with
//! a full stop. See
//! <a href="https://github.com/paritytech/substrate#72-contributing-to-documentation-for-substrate-packages"
//! target="_blank"> Generic example of annotating source code with documentation comments</a></li>
@@ -383,7 +383,7 @@ decl_event!(
// - Unsigned calls that can be of two kinds:
// * "Inherent extrinsics" that are opinions generally held by the block
// authors that build child blocks.
// * Unsigned Transactions that are of intrinsic recognisable utility to the
// * Unsigned Transactions that are of intrinsic recognizable utility to the
// network, and are validated by the runtime.
//
// Information about where this dispatch initiated from is provided as the first argument
@@ -572,7 +572,7 @@ impl<T: Trait> Module<T> {
// method. This example will not cover this type of extension. See `CheckRuntime` in system module
// for an example.
//
// Using the extension, you can add some hooks to the lifecycle of each transaction. Note that by
// Using the extension, you can add some hooks to the life cycle of each transaction. Note that by
// default, an extension is applied to all `Call` functions (i.e. all transactions). the `Call` enum
// variant is given to each function of `SignedExtension`. Hence, you can filter based on module or
// a particular call if needed.
+2 -2
View File
@@ -208,7 +208,7 @@ impl<T: Trait> Subtrait for T {
/// Asset creation options.
#[derive(Clone, Encode, Decode, PartialEq, Eq, RuntimeDebug)]
pub struct AssetOptions<Balance: HasCompact, AccountId> {
/// Initial issuance of this asset. All deposit to the creater of the asset.
/// Initial issuance of this asset. All deposit to the creator of the asset.
#[codec(compact)]
pub initial_issuance: Balance,
/// Which accounts are allowed to possess this asset.
@@ -898,7 +898,7 @@ pub trait AssetIdProvider {
fn asset_id() -> Self::AssetId;
}
// wrapping these imbalanes in a private module is necessary to ensure absolute privacy
// wrapping these imbalances in a private module is necessary to ensure absolute privacy
// of the inner member.
mod imbalances {
use super::{
+2 -2
View File
@@ -440,7 +440,7 @@ fn reserve_should_not_moves_amount_from_balance_to_reserved_balance() {
// Then
// - unreserved should return 20.
#[test]
fn unreserve_should_return_substratced_value_from_unreserved_amount_by_actual_acount_balance() {
fn unreserve_should_return_subtracted_value_from_unreserved_amount_by_actual_account_balance() {
ExtBuilder::default().free_balance((1, 0, 100)).build().execute_with(|| {
GenericAsset::set_reserved_balance(&1, &0, 100);
assert_eq!(GenericAsset::unreserve(&1, &0, 120), 20);
@@ -553,7 +553,7 @@ fn slash_reserved_should_return_none() {
// Then
// - Should not return None.
#[test]
fn repatriate_reserved_return_amount_substracted_by_slash_amount() {
fn repatriate_reserved_return_amount_subtracted_by_slash_amount() {
ExtBuilder::default().build().execute_with(|| {
GenericAsset::set_reserved_balance(&1, &0, 100);
assert_eq!(GenericAsset::repatriate_reserved(&1, &0, &1, 130, BalanceStatus::Free), 30);
+2 -2
View File
@@ -154,7 +154,7 @@ decl_storage! {
/// DEPRECATED
///
/// This used to store the current authority set, which has been migrated to the well-known
/// GRANDPA_AUTHORITES_KEY unhashed key.
/// GRANDPA_AUTHORITIES_KEY unhashed key.
#[cfg(feature = "migrate-authorities")]
pub(crate) Authorities get(fn authorities): AuthorityList;
@@ -435,7 +435,7 @@ impl<T: Trait> pallet_session::OneSessionHandler<T::AccountId> for Module<T>
where I: Iterator<Item=(&'a T::AccountId, AuthorityId)>
{
// Always issue a change if `session` says that the validators have changed.
// Even if their session keys are the same as before, the underyling economic
// Even if their session keys are the same as before, the underlying economic
// identities have changed.
let current_set_id = if changed {
let next_authorities = validators.map(|(_, k)| (k, 1)).collect::<Vec<_>>();
+1 -1
View File
@@ -627,7 +627,7 @@ decl_module! {
/// - `max_fee`: The maximum fee that may be paid. This should just be auto-populated as:
///
/// ```nocompile
/// Self::registrars(reg_index).uwnrap().fee
/// Self::registrars(reg_index).unwrap().fee
/// ```
///
/// Emits `JudgementRequested` if successful.
+3 -3
View File
@@ -233,7 +233,7 @@ pub trait Trait: frame_system::Trait + pallet_session::historical::Trait {
/// An expected duration of the session.
///
/// This parameter is used to determine the longevity of `heartbeat` transaction
/// and a rough time when we should start considering sending hearbeats,
/// and a rough time when we should start considering sending heartbeats,
/// since the workers avoids sending them at the very beginning of the session, assuming
/// there is a chance the authority will produce a block and they won't be necessary.
type SessionDuration: Get<Self::BlockNumber>;
@@ -369,7 +369,7 @@ decl_module! {
type OffchainResult<T, A> = Result<A, OffchainErr<<T as frame_system::Trait>::BlockNumber>>;
/// Keep track of number of authored blocks per authority, uncles are counted as
/// well since they're a valid proof of onlineness.
/// well since they're a valid proof of being online.
impl<T: Trait + pallet_authorship::Trait> pallet_authorship::EventHandler<T::ValidatorId, T::BlockNumber> for Module<T> {
fn note_author(author: T::ValidatorId) {
Self::note_authorship(author);
@@ -576,7 +576,7 @@ impl<T: Trait> pallet_session::OneSessionHandler<T::AccountId> for Module<T> {
{
// Tell the offchain worker to start making the next session's heartbeats.
// Since we consider producing blocks as being online,
// the heartbeat is defered a bit to prevent spaming.
// the heartbeat is deferred a bit to prevent spamming.
let block_number = <frame_system::Module<T>>::block_number();
let half_session = T::SessionDuration::get() / 2.into();
<HeartbeatAfter<T>>::put(block_number + half_session);
+1 -1
View File
@@ -328,7 +328,7 @@ fn should_not_send_a_report_if_already_online() {
// then
let transaction = pool_state.write().transactions.pop().unwrap();
// All validators have `0` as their session key, but we should only produce 1 hearbeat.
// All validators have `0` as their session key, but we should only produce 1 heartbeat.
assert_eq!(pool_state.read().transactions.len(), 0);
// check stuff about the transaction.
let ex: Extrinsic = Decode::decode(&mut &*transaction).unwrap();
+1 -1
View File
@@ -130,7 +130,7 @@ decl_module! {
}
/// Assign an index already owned by the sender to another account. The balance reservation
/// is effectively transfered to the new account.
/// is effectively transferred to the new account.
///
/// The dispatch origin for this call must be _Signed_.
///
+1 -1
View File
@@ -233,7 +233,7 @@ mod tests {
};
use sp_core::H256;
// The testing primitives are very useful for avoiding having to work with signatures
// or public keys. `u64` is used as the `AccountId` and no `Signature`s are requried.
// or public keys. `u64` is used as the `AccountId` and no `Signature`s are required.
use sp_runtime::{Perbill, traits::{BlakeTwo256, IdentityLookup, BadOrigin}, testing::Header};
use frame_system::EnsureSignedBy;
+1 -1
View File
@@ -33,7 +33,7 @@ use sp_core::RuntimeDebug;
#[cfg(feature = "std")]
type StringBuf = String;
/// Curent prefix of metadata
/// Current prefix of metadata
pub const META_RESERVED: u32 = 0x6174656d; // 'meta' warn endianness
/// On `no_std` we do not support `Decode` and thus `StringBuf` is just `&'static str`.
+1 -1
View File
@@ -104,7 +104,7 @@ decl_error! {
TooShort,
/// A name is too long.
TooLong,
/// An account in't named.
/// An account isn't named.
Unnamed,
}
}
+1 -1
View File
@@ -187,7 +187,7 @@ struct TriageOutcome<T: Trait> {
concurrent_offenders: Vec<OffenceDetails<T::AccountId, T::IdentificationTuple>>,
}
/// An auxilary struct for working with storage of indexes localized for a specific offence
/// An auxiliary struct for working with storage of indexes localized for a specific offence
/// kind (specified by the `O` type parameter).
///
/// This struct is responsible for aggregating storage writes and the underlying storage should not
+1 -1
View File
@@ -98,7 +98,7 @@ fn should_report_in_different_time_slot() {
});
// when
// reportfor the second time
// report for the second time
offence.time_slot += 1;
Offences::report_offence(vec![], offence);
@@ -135,7 +135,7 @@ impl<T: Trait> Randomness<T::Hash> for Module<T> {
let hash_series = <RandomMaterial<T>>::get();
if !hash_series.is_empty() {
// Always the case after block 1 is initialised.
// Always the case after block 1 is initialized.
hash_series.iter()
.cycle()
.skip(index)
@@ -231,7 +231,7 @@ mod tests {
}
#[test]
fn test_random_material_parital() {
fn test_random_material_partial() {
new_test_ext().execute_with(|| {
let genesis_hash = System::parent_hash();
+2 -2
View File
@@ -44,9 +44,9 @@
//! the number of friends chosen. This deposit is returned in full when the account
//! owner removes their recovery configuration.
//!
//! ### Recovery Lifecycle
//! ### Recovery Life Cycle
//!
//! The intended lifecycle of a successful recovery takes the following steps:
//! The intended life cycle of a successful recovery takes the following steps:
//! 1. The account owner calls `create_recovery` to set up a recovery configuration
//! for their account.
//! 2. At some later time, the account owner loses access to their account and wants
+1 -1
View File
@@ -56,7 +56,7 @@ fn set_recovered_works() {
}
#[test]
fn recovery_lifecycle_works() {
fn recovery_life_cycle_works() {
new_test_ext().execute_with(|| {
let friends = vec![2, 3, 4];
let threshold = 3;
+1 -1
View File
@@ -22,7 +22,7 @@ use std::cell::RefCell;
use frame_support::{impl_outer_origin, parameter_types, weights::Weight, ord_parameter_types};
use sp_core::H256;
// The testing primitives are very useful for avoiding having to work with signatures
// or public keys. `u64` is used as the `AccountId` and no `Signature`s are requried.
// or public keys. `u64` is used as the `AccountId` and no `Signature`s are required.
use sp_runtime::{
Perbill, traits::{BlakeTwo256, IdentityLookup}, testing::Header,
};
+1 -1
View File
@@ -168,7 +168,7 @@ impl<A> SessionManager<A> for () {
fn end_session(_: SessionIndex) {}
}
/// Handler for session lifecycle events.
/// Handler for session life cycle events.
pub trait SessionHandler<ValidatorId> {
/// All the key type ids this session handler can process.
///
+1 -1
View File
@@ -834,7 +834,7 @@ decl_module! {
Self::deposit_event(RawEvent::Founded(founder));
}
/// Anull the founding of the society.
/// Annul the founding of the society.
///
/// The dispatch origin for this call must be Signed, and the signing account must be both
/// the `Founder` and the `Head`. This implies that it may only be done when there is one
+1 -1
View File
@@ -21,7 +21,7 @@ use super::*;
use frame_support::{impl_outer_origin, parameter_types, ord_parameter_types};
use sp_core::H256;
// The testing primitives are very useful for avoiding having to work with signatures
// or public keys. `u64` is used as the `AccountId` and no `Signature`s are requried.
// or public keys. `u64` is used as the `AccountId` and no `Signature`s are required.
use sp_runtime::{
Perbill,
testing::Header,
+1 -1
View File
@@ -282,7 +282,7 @@ fn slash_payout_multi_works() {
}
#[test]
fn suspended_member_lifecycle_works() {
fn suspended_member_life_cycle_works() {
EnvBuilder::new().execute(|| {
// Add 20 to members, who is not the head and can be suspended/removed.
assert_ok!(Society::add_member(&20));
@@ -27,7 +27,7 @@ use syn::parse::{Parse, ParseStream};
/// Expressed in millionth, must be between 0_100_000 and 0_900_000.
///
/// - `falloff`: Known as `decay_rate` in the literature. A co-efficient dictating the strength of
/// the global incentivisation to get the `ideal_stake`. A higher number results in less typical
/// the global incentivization to get the `ideal_stake`. A higher number results in less typical
/// inflation at the cost of greater volatility for validators.
/// Expressed in millionth, must be between 0 and 1_000_000.
///
@@ -271,7 +271,7 @@ fn compute_points(input: &INposInput) -> Vec<(u32, u32)> {
points.push((0, inpos.i_0));
points.push((inpos.x_ideal, inpos.i_ideal_times_x_ideal));
// For each point p: (next_p.0 - p.0) < segment_lenght && (next_p.1 - p.1) < segment_lenght.
// For each point p: (next_p.0 - p.0) < segment_length && (next_p.1 - p.1) < segment_length.
// This ensures that the total number of segment doesn't overflow max_piece_count.
let max_length = (input.max_inflation - input.min_inflation + 1_000_000 - inpos.x_ideal)
/ (input.max_piece_count - 1);
+1 -1
View File
@@ -24,7 +24,7 @@ use sp_runtime::{Perbill, PerThing, traits::AtLeast32Bit, curve::PiecewiseLinear
/// The total payout to all validators (and their nominators) per era.
///
/// Defined as such:
/// `payout = yearly_inflation(npos_token_staked / total_tokens) * total_tokans / era_per_year`
/// `payout = yearly_inflation(npos_token_staked / total_tokens) * total_tokens / era_per_year`
///
/// `era_duration` is expressed in millisecond.
pub fn compute_total_payout<N>(
+2 -2
View File
@@ -171,7 +171,7 @@
//!
//! Validators and nominators are rewarded at the end of each era. The total reward of an era is
//! calculated using the era duration and the staking rate (the total amount of tokens staked by
//! nominators and validators, divided by the total token supply). It aims to incentivise toward a
//! nominators and validators, divided by the total token supply). It aims to incentivize toward a
//! defined staking rate. The full specification can be found
//! [here](https://research.web3.foundation/en/latest/polkadot/Token%20Economics.html#inflation-model).
//!
@@ -1360,7 +1360,7 @@ impl<T: Trait> Module<T> {
Self::new_era(session_index)
}
/// Initialise the first session (and consequently the first era)
/// Initialize the first session (and consequently the first era)
fn initial_session() -> Option<Vec<T::AccountId>> {
// note: `CurrentEraStart` is set in `on_finalize` of the first block because now is not
// available yet.
+12 -12
View File
@@ -235,7 +235,7 @@ fn multi_era_reward_should_work() {
// Compute now as other parameter won't change
let total_payout_0 = current_total_payout_for_duration(3000);
assert!(total_payout_0 > 10); // Test is meaningfull if reward something
assert!(total_payout_0 > 10); // Test is meaningful if reward something
<Module<Test>>::reward_by_ids(vec![(11, 1)]);
start_session(0);
@@ -249,7 +249,7 @@ fn multi_era_reward_should_work() {
start_session(4);
let total_payout_1 = current_total_payout_for_duration(3000);
assert!(total_payout_1 > 10); // Test is meaningfull if reward something
assert!(total_payout_1 > 10); // Test is meaningful if reward something
<Module<Test>>::reward_by_ids(vec![(11, 101)]);
// new era is triggered here.
@@ -458,7 +458,7 @@ fn nominating_and_rewards_should_work() {
// the total reward for era 0
let total_payout_0 = current_total_payout_for_duration(3000);
assert!(total_payout_0 > 100); // Test is meaningfull if reward something
assert!(total_payout_0 > 100); // Test is meaningful if reward something
<Module<Test>>::reward_by_ids(vec![(41, 1)]);
<Module<Test>>::reward_by_ids(vec![(31, 1)]);
<Module<Test>>::reward_by_ids(vec![(21, 10)]); // must be no-op
@@ -506,7 +506,7 @@ fn nominating_and_rewards_should_work() {
// the total reward for era 1
let total_payout_1 = current_total_payout_for_duration(3000);
assert!(total_payout_1 > 100); // Test is meaningfull if reward something
assert!(total_payout_1 > 100); // Test is meaningful if reward something
<Module<Test>>::reward_by_ids(vec![(41, 10)]); // must be no-op
<Module<Test>>::reward_by_ids(vec![(31, 10)]); // must be no-op
<Module<Test>>::reward_by_ids(vec![(21, 2)]);
@@ -575,7 +575,7 @@ fn nominators_also_get_slashed() {
assert_ok!(Staking::nominate(Origin::signed(2), vec![20, 10]));
let total_payout = current_total_payout_for_duration(3000);
assert!(total_payout > 100); // Test is meaningfull if reward something
assert!(total_payout > 100); // Test is meaningful if reward something
<Module<Test>>::reward_by_ids(vec![(11, 1)]);
// new era, pay rewards,
@@ -850,7 +850,7 @@ fn reward_destination_works() {
// Compute total payout now for whole duration as other parameter won't change
let total_payout_0 = current_total_payout_for_duration(3000);
assert!(total_payout_0 > 100); // Test is meaningfull if reward something
assert!(total_payout_0 > 100); // Test is meaningful if reward something
<Module<Test>>::reward_by_ids(vec![(11, 1)]);
start_era(1);
@@ -872,7 +872,7 @@ fn reward_destination_works() {
// Compute total payout now for whole duration as other parameter won't change
let total_payout_1 = current_total_payout_for_duration(3000);
assert!(total_payout_1 > 100); // Test is meaningfull if reward something
assert!(total_payout_1 > 100); // Test is meaningful if reward something
<Module<Test>>::reward_by_ids(vec![(11, 1)]);
start_era(2);
@@ -899,7 +899,7 @@ fn reward_destination_works() {
// Compute total payout now for whole duration as other parameter won't change
let total_payout_2 = current_total_payout_for_duration(3000);
assert!(total_payout_2 > 100); // Test is meaningfull if reward something
assert!(total_payout_2 > 100); // Test is meaningful if reward something
<Module<Test>>::reward_by_ids(vec![(11, 1)]);
start_era(3);
@@ -949,7 +949,7 @@ fn validator_payment_prefs_work() {
// Compute total payout now for whole duration as other parameter won't change
let total_payout_0 = current_total_payout_for_duration(3000);
assert!(total_payout_0 > 100); // Test is meaningfull if reward something
assert!(total_payout_0 > 100); // Test is meaningful if reward something
<Module<Test>>::reward_by_ids(vec![(11, 1)]);
start_era(1);
@@ -1393,7 +1393,7 @@ fn slot_stake_is_least_staked_validator_and_exposure_defines_maximum_punishment(
// Compute total payout now for whole duration as other parameter won't change
let total_payout_0 = current_total_payout_for_duration(3000);
assert!(total_payout_0 > 100); // Test is meaningfull if reward something
assert!(total_payout_0 > 100); // Test is meaningful if reward something
<Module<Test>>::reward_by_ids(vec![(11, 1)]);
<Module<Test>>::reward_by_ids(vec![(21, 1)]);
@@ -1678,7 +1678,7 @@ fn bond_with_little_staked_value_bounded_by_slot_stake() {
assert_ok!(Staking::validate(Origin::signed(2), ValidatorPrefs::default()));
let total_payout_0 = current_total_payout_for_duration(3000);
assert!(total_payout_0 > 100); // Test is meaningfull if reward something
assert!(total_payout_0 > 100); // Test is meaningful if reward something
reward_all_elected();
start_era(1);
@@ -1693,7 +1693,7 @@ fn bond_with_little_staked_value_bounded_by_slot_stake() {
assert_eq!(Balances::free_balance(2), init_balance_2);
let total_payout_1 = current_total_payout_for_duration(3000);
assert!(total_payout_1 > 100); // Test is meaningfull if reward something
assert!(total_payout_1 > 100); // Test is meaningful if reward something
reward_all_elected();
start_era(2);
@@ -91,7 +91,7 @@ impl Parse for WhereSection {
}) = definitions.first()
{
let msg = format!(
"`{:?}` was declared above. Please use exactly one delcataion for `{:?}`.",
"`{:?}` was declared above. Please use exactly one declaration for `{:?}`.",
kind, kind
);
return Err(Error::new(*kind_span, msg));
@@ -123,7 +123,7 @@ use proc_macro::TokenStream;
/// And [`StoragePrefixedMap`](../frame_support/storage/trait.StoragePrefixedMap.html).
///
/// `$hash1` and `$hash2` representing choices of hashing algorithms available in the
/// [`Hashable`](../frame_support/trait.Hashable.html) trait. They must be choosen with care, see
/// [`Hashable`](../frame_support/trait.Hashable.html) trait. They must be chosen with care, see
/// generator documentation.
///
/// If the first key is untrusted, a cryptographic `hasher` such as `blake2_256` or
@@ -200,7 +200,7 @@ use proc_macro::TokenStream;
///
/// ```nocompile
/// construct_runtime!(
/// pub enum Runtume with ... {
/// pub enum Runtime with ... {
/// ...,
/// Example: example::{Module, Storage, ..., Config<T>},
/// ...,
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
//! Genesis config defintion.
//! Genesis config definition.
use frame_support_procedural_tools::syn_ext as ext;
use proc_macro2::TokenStream;
@@ -29,7 +29,7 @@ use frame_support_procedural_tools::{
generate_crate_access, generate_hidden_includes, syn_ext as ext
};
/// All informations contained in input of decl_storage
/// All information contained in input of decl_storage
pub struct DeclStorageDef {
/// Name of the module used to import hidden imports.
hidden_crate: Option<syn::Ident>,
@@ -219,9 +219,9 @@ pub struct StorageLineDefExt {
storage_trait: proc_macro2::TokenStream,
/// Full trait, for example: `storage::generator::StorageMap<u32, u32>`.
storage_generator_trait: proc_macro2::TokenStream,
/// Weither the storage is generic.
/// Whether the storage is generic.
is_generic: bool,
/// Weither the storage value is an option.
/// Whether the storage value is an option.
is_option: bool,
}
@@ -283,7 +283,7 @@ impl StorageLineDefExt {
None
};
let storage_trait_trunkated = match &storage_def.storage_type {
let storage_trait_truncated = match &storage_def.storage_type {
StorageLineTypeDef::Simple(_) => {
quote!( StorageValue<#value_type> )
},
@@ -302,8 +302,8 @@ impl StorageLineDefExt {
},
};
let storage_trait = quote!( storage::#storage_trait_trunkated );
let storage_generator_trait = quote!( storage::generator::#storage_trait_trunkated );
let storage_trait = quote!( storage::#storage_trait_truncated );
let storage_generator_trait = quote!( storage::generator::#storage_trait_truncated );
let doc_attrs = storage_def.attrs.iter()
.filter_map(|a| a.parse_meta().ok())
@@ -180,7 +180,7 @@ pub fn extract_type_option(typ: &syn::Type) -> Option<syn::Type> {
None
}
/// Auxialary structure to check if a given `Ident` is contained in an ast.
/// Auxiliary structure to check if a given `Ident` is contained in an ast.
struct ContainsIdent<'a> {
ident: &'a Ident,
result: bool,
+1 -1
View File
@@ -24,7 +24,7 @@
//! and size of the blob. Luckily there are some ways to mitigate
//! this that are described below.
//!
//! First component to utilize debug-printing and loggin is actually
//! First component to utilize debug-printing and logging is actually
//! located in `primitives` crate: `sp_core::RuntimeDebug`.
//! This custom-derive generates `core::fmt::Debug` implementation,
//! just like regular `derive(Debug)`, however it does not generate
+1 -1
View File
@@ -819,7 +819,7 @@ macro_rules! decl_module {
// TODO: this probably should be a different macro?
(@call
$ingore:ident
$ignore:ident
$mod_type:ident<$trait_instance:ident $(, $instance:ident)?> $fn_name:ident $origin:ident $system:ident [ $( $param_name:ident),* ]
) => {
<$mod_type<$trait_instance $(, $instance)?>>::$fn_name( $origin $(, $param_name )* )
+1 -1
View File
@@ -28,7 +28,7 @@ pub use frame_metadata::{ModuleErrorMetadata, ErrorMetadata, DecodeDifferent};
/// implements `From<ErrorType> for DispatchResult` to make the error type usable as error
/// in the dispatchable functions.
///
/// It is required that the error type is registed in `decl_module!` to make the error
/// It is required that the error type is registered in `decl_module!` to make the error
/// exported in the metadata.
///
/// # Usage
+1 -1
View File
@@ -641,7 +641,7 @@ mod tests {
}
decl_event!(
/// Event finish formatting on an unnamed one with trailling comma
/// Event finish formatting on an unnamed one with trailing comma
pub enum Event<T> where
<T as Trait>::Balance,
<T as Trait>::Origin,
+1 -1
View File
@@ -22,7 +22,7 @@
//!
//! A **key collision free** unique id is required as parameter to avoid key collision
//! between child tries.
//! This unique id management and generation responsability is delegated to pallet module.
//! This unique id management and generation responsibility is delegated to pallet module.
// NOTE: could replace unhashed by having only one kind of storage (root being null storage key (storage_key can become Option<&[u8]>).
use crate::sp_std::prelude::*;
+1 -1
View File
@@ -67,7 +67,7 @@ pub trait ClassifyDispatch<T> {
fn classify_dispatch(&self, target: T) -> DispatchClass;
}
/// Means of determining the weight of a block's lifecycle hooks: on_initialize, on_finalize and
/// Means of determining the weight of a block's life cycle hooks: `on_initialize`, `on_finalize` and
/// such.
pub trait WeighBlock<BlockNumber> {
/// Return the weight of the block's on_initialize hook.
@@ -1,4 +1,4 @@
error: `Block` was declared above. Please use exactly one delcataion for `Block`.
error: `Block` was declared above. Please use exactly one declaration for `Block`.
--> $DIR/abundant_where_param.rs:7:3
|
7 | Block = Block1,
@@ -5,7 +5,7 @@ construct_runtime! {
Block = Block,
NodeBlock = Block,
TypeX = Block,
UnchekcedExtrinsic = UnchekcedExtrinsic,
UncheckedExtrinsic = UncheckedExtrinsic,
{}
}
@@ -300,7 +300,7 @@ fn new_test_ext() -> sp_io::TestExternalities {
}
#[test]
fn storage_instance_independance() {
fn storage_instance_independence() {
let mut storage = sp_core::storage::Storage {
top: std::collections::BTreeMap::new(),
children: std::collections::HashMap::new()
+1 -1
View File
@@ -720,7 +720,7 @@ impl<T: Trait> Module<T> {
/// Even more dangerous is to note that this function does NOT take any action, if the new sum
/// of block weight is more than the block weight limit. This is what the _unchecked_.
///
/// Another potential use-case could be for the `on_initialise` and `on_finalize` hooks.
/// Another potential use-case could be for the `on_initialize` and `on_finalize` hooks.
///
/// If no previous weight exists, the function initializes the weight to zero.
pub fn register_extra_weight_unchecked(weight: Weight) {
+1 -1
View File
@@ -68,7 +68,7 @@ pub trait Signer<Public, Signature> {
/// A `Signer` implementation for any `AppPublic` type.
///
/// This implementation additionaly supports conversion to/from multi-signature/multi-signer
/// This implementation additionally supports conversion to/from multi-signature/multi-signer
/// wrappers.
/// If the wrapped crypto doesn't match `AppPublic`s crypto `None` is returned.
impl<Public, Signature, TAnyAppPublic> Signer<Public, Signature> for TAnyAppPublic where
+5 -5
View File
@@ -38,7 +38,7 @@
//! should be paid.
//!
//! A group of `Tippers` is determined through the config `Trait`. After half of these have declared
//! some amount that they believe a particular reported reason deserves, then a countfown period is
//! some amount that they believe a particular reported reason deserves, then a countdown period is
//! entered where any remaining members can declare their tip amounts also. After the close of the
//! countdown period, the median of all declared tips is paid to the reported beneficiary, along
//! with any finders fee, in case of a public (and bonded) original report.
@@ -1052,14 +1052,14 @@ mod tests {
}
#[test]
fn reject_non_existant_spend_proposal_fails() {
fn reject_non_existent_spend_proposal_fails() {
new_test_ext().execute_with(|| {
assert_noop!(Treasury::reject_proposal(Origin::ROOT, 0), Error::<Test>::InvalidProposalIndex);
});
}
#[test]
fn accept_non_existant_spend_proposal_fails() {
fn accept_non_existent_spend_proposal_fails() {
new_test_ext().execute_with(|| {
assert_noop!(Treasury::approve_proposal(Origin::ROOT, 0), Error::<Test>::InvalidProposalIndex);
});
@@ -1135,9 +1135,9 @@ mod tests {
}
// In case treasury account is not existing then it works fine.
// This is usefull for chain that will just update runtime.
// This is useful for chain that will just update runtime.
#[test]
fn inexisting_account_works() {
fn inexistent_account_works() {
let mut t = frame_system::GenesisConfig::default().build_storage::<Test>().unwrap();
pallet_balances::GenesisConfig::<Test>{
balances: vec![(0, 100), (1, 99), (2, 1)],
+2 -2
View File
@@ -105,7 +105,7 @@ pub trait Trait: frame_system::Trait {
/// composite was created to be uniquely identified.
#[derive(Copy, Clone, Eq, PartialEq, Encode, Decode, Default, RuntimeDebug)]
pub struct Timepoint<BlockNumber> {
/// The hieght of the chain at the point in time.
/// The height of the chain at the point in time.
height: BlockNumber,
/// The index of the extrinsic at the point in time.
index: u32,
@@ -210,7 +210,7 @@ impl<Call: GetDispatchInfo> PaysFee<(&u16, &Box<Call>)> for Passthrough<Call> {
}
}
/// Sumation pass-through for the weight function of the batch call.
/// Summation pass-through for the weight function of the batch call.
///
/// This just adds all of the weights together of all of the calls.
struct BatchPassthrough<Call>(sp_std::marker::PhantomData<Call>);