diff --git a/substrate/.maintain/kubernetes/templates/service.yaml b/substrate/.maintain/kubernetes/templates/service.yaml index 01ba9d5a56..b14bb74c10 100644 --- a/substrate/.maintain/kubernetes/templates/service.yaml +++ b/substrate/.maintain/kubernetes/templates/service.yaml @@ -33,7 +33,7 @@ spec: app: {{ .Values.GitlabEnvSlug | default .Values.app }} sessionAffinity: None type: NodePort - # don't route exteral traffic to non-local pods + # don't route external traffic to non-local pods externalTrafficPolicy: Local {{- else if .Values.validator.keys }} {{- $root := . -}} diff --git a/substrate/.maintain/kubernetes/values.yaml b/substrate/.maintain/kubernetes/values.yaml index 89a6445e00..4c3cb5c7d7 100644 --- a/substrate/.maintain/kubernetes/values.yaml +++ b/substrate/.maintain/kubernetes/values.yaml @@ -48,7 +48,7 @@ validator: {} # substrate-1-node-key # # pod names are canonical. changing these or providing different amount of - # keys than the replicas count will lead to behavior noone ever has + # keys than the replicas count will lead to behavior no one ever has # experienced before. diff --git a/substrate/bin/node-template/pallets/template/src/lib.rs b/substrate/bin/node-template/pallets/template/src/lib.rs index a1615b4c1f..aa4d2cbc99 100644 --- a/substrate/bin/node-template/pallets/template/src/lib.rs +++ b/substrate/bin/node-template/pallets/template/src/lib.rs @@ -41,7 +41,7 @@ decl_event!( pub enum Event where AccountId = ::AccountId { /// Just a dummy event. /// Event `Something` is declared with a parameter of the type `u32` and `AccountId` - /// To emit this event, we call the deposit funtion, from our runtime funtions + /// To emit this event, we call the deposit function, from our runtime functions SomethingStored(u32, AccountId), } ); diff --git a/substrate/bin/node-template/pallets/template/src/tests.rs b/substrate/bin/node-template/pallets/template/src/tests.rs index 44a423c948..ec123a50c7 100644 --- a/substrate/bin/node-template/pallets/template/src/tests.rs +++ b/substrate/bin/node-template/pallets/template/src/tests.rs @@ -6,7 +6,7 @@ use frame_support::{assert_ok, assert_noop}; #[test] fn it_works_for_default_value() { new_test_ext().execute_with(|| { - // Just a dummy test for the dummy funtion `do_something` + // Just a dummy test for the dummy function `do_something` // calling the `do_something` function with a value 42 assert_ok!(TemplateModule::do_something(Origin::signed(1), 42)); // asserting that the stored value is equal to what we stored diff --git a/substrate/bin/node-template/runtime/src/lib.rs b/substrate/bin/node-template/runtime/src/lib.rs index 67510c4bf2..153d9cf49d 100644 --- a/substrate/bin/node-template/runtime/src/lib.rs +++ b/substrate/bin/node-template/runtime/src/lib.rs @@ -69,7 +69,7 @@ pub type DigestItem = generic::DigestItem; /// Opaque types. These are used by the CLI to instantiate machinery that don't need to know /// the specifics of the runtime. They can then be made to be agnostic over specific formats /// of data like extrinsics, allowing for them to continue syncing the network through upgrades -/// to even the core datastructures. +/// to even the core data structures. pub mod opaque { use super::*; @@ -109,7 +109,7 @@ pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber); pub const HOURS: BlockNumber = MINUTES * 60; pub const DAYS: BlockNumber = HOURS * 24; -/// The version infromation used to identify this runtime when compiled natively. +/// The version information used to identify this runtime when compiled natively. #[cfg(feature = "std")] pub fn native_version() -> NativeVersion { NativeVersion { diff --git a/substrate/bin/node/cli/tests/common.rs b/substrate/bin/node/cli/tests/common.rs index 96060bf85d..4044f69d08 100644 --- a/substrate/bin/node/cli/tests/common.rs +++ b/substrate/bin/node/cli/tests/common.rs @@ -16,7 +16,7 @@ use std::{process::{Child, ExitStatus}, thread, time::Duration}; -/// Wait for the given `child` the given ammount of `secs`. +/// Wait for the given `child` the given number of `secs`. /// /// Returns the `Some(exit status)` or `None` if the process did not finish in the given time. pub fn wait_for(child: &mut Child, secs: usize) -> Option { diff --git a/substrate/bin/node/cli/tests/running_the_node_and_interrupt.rs b/substrate/bin/node/cli/tests/running_the_node_and_interrupt.rs index 6ab719de91..dbb57bdd21 100644 --- a/substrate/bin/node/cli/tests/running_the_node_and_interrupt.rs +++ b/substrate/bin/node/cli/tests/running_the_node_and_interrupt.rs @@ -38,7 +38,7 @@ fn running_the_node_works_and_can_be_interrupted() { assert_eq!( common::wait_for(&mut cmd, 30).map(|x| x.success()), Some(true), - "the pocess must exit gracefully after signal {}", + "the process must exit gracefully after signal {}", signal, ); } diff --git a/substrate/bin/node/rpc-client/src/main.rs b/substrate/bin/node/rpc-client/src/main.rs index b28c9f8ff6..c547d30002 100644 --- a/substrate/bin/node/rpc-client/src/main.rs +++ b/substrate/bin/node/rpc-client/src/main.rs @@ -19,7 +19,7 @@ //! Example substrate RPC client code. //! //! This module shows how you can write a Rust RPC client that connects to a running -//! substrate node and use staticly typed RPC wrappers. +//! substrate node and use statically typed RPC wrappers. use futures::Future; use hyper::rt; @@ -55,7 +55,7 @@ fn main() { /// 1. Calls the `pending_extrinsics` method to get all extrinsics in the pool. /// 2. Then calls `remove_extrinsic` passing the obtained raw extrinsics. /// -/// As the resul of running the code the entire content of the transaction pool is going +/// As the result of running the code the entire content of the transaction pool is going /// to be removed and the extrinsics are going to be temporarily banned. fn remove_all_extrinsics(client: AuthorClient) -> impl Future { client.pending_extrinsics() diff --git a/substrate/bin/node/runtime/src/lib.rs b/substrate/bin/node/runtime/src/lib.rs index 97424950fc..d80986c0df 100644 --- a/substrate/bin/node/runtime/src/lib.rs +++ b/substrate/bin/node/runtime/src/lib.rs @@ -83,7 +83,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // implementation changes and behavior does not, then leave spec_version as // is and increment impl_version. spec_version: 219, - impl_version: 0, + impl_version: 1, apis: RUNTIME_API_VERSIONS, }; @@ -419,7 +419,7 @@ impl pallet_contracts::Trait for Runtime { type Randomness = RandomnessCollectiveFlip; type Call = Call; type Event = Event; - type DetermineContractAddress = pallet_contracts::SimpleAddressDeterminator; + type DetermineContractAddress = pallet_contracts::SimpleAddressDeterminer; type ComputeDispatchFee = pallet_contracts::DefaultDispatchFeeComputor; type TrieIdGenerator = pallet_contracts::TrieIdFromParentCounter; type GasPayment = (); diff --git a/substrate/bin/node/testing/benches/import.rs b/substrate/bin/node/testing/benches/import.rs index 9ffeb4ffd7..b294ae3604 100644 --- a/substrate/bin/node/testing/benches/import.rs +++ b/substrate/bin/node/testing/benches/import.rs @@ -174,7 +174,7 @@ impl BenchDb { let mut inherent_data = InherentData::new(); inherent_data.put_data(sp_timestamp::INHERENT_IDENTIFIER, ×tamp) - .expect("Put timestamb failed"); + .expect("Put timestamp failed"); inherent_data.put_data(sp_finality_tracker::INHERENT_IDENTIFIER, &0) .expect("Put finality tracker failed"); diff --git a/substrate/bin/node/testing/src/client.rs b/substrate/bin/node/testing/src/client.rs index 29b086c3c1..963bac7041 100644 --- a/substrate/bin/node/testing/src/client.rs +++ b/substrate/bin/node/testing/src/client.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -//! Utilites to build a `TestClient` for `node-runtime`. +//! Utilities to build a `TestClient` for `node-runtime`. use sp_runtime::BuildStorage; diff --git a/substrate/bin/utils/subkey/src/main.rs b/substrate/bin/utils/subkey/src/main.rs index 4d7e220642..33209692ca 100644 --- a/substrate/bin/utils/subkey/src/main.rs +++ b/substrate/bin/utils/subkey/src/main.rs @@ -280,7 +280,7 @@ fn get_app<'a, 'b>(usage: &'a str) -> App<'a, 'b> { SubCommand::with_name("transfer") .about("Author and sign a Node pallet_balances::Transfer transaction with a given (secret) key") .args_from_usage(" - -g, --genesis 'The genesis hash or a recognised \ + -g, --genesis 'The genesis hash or a recognized \ chain identifier (dev, elm, alex).' 'The signing secret key URI.' 'The destination account public key URI.' @@ -572,7 +572,7 @@ fn read_genesis_hash(matches: &ArgMatches) -> Result { "elm" => hex!["10c08714a10c7da78f40a60f6f732cf0dba97acfb5e2035445b032386157d5c3"].into(), "alex" => hex!["dcd1346701ca8396496e52aa2785b1748deb6db09551b72159dcb3e08991025b"].into(), h => Decode::decode(&mut &decode_hex(h)?[..]) - .expect("Invalid genesis hash or unrecognised chain identifier"), + .expect("Invalid genesis hash or unrecognized chain identifier"), }; println!( "Using a genesis hash of {}", diff --git a/substrate/client/api/src/execution_extensions.rs b/substrate/client/api/src/execution_extensions.rs index 1a986a23a4..10d33c20e6 100644 --- a/substrate/client/api/src/execution_extensions.rs +++ b/substrate/client/api/src/execution_extensions.rs @@ -64,7 +64,7 @@ impl Default for ExecutionStrategies { /// Generate the starting set of ExternalitiesExtensions based upon the given capabilities pub trait ExtensionsFactory: Send + Sync { - /// Make `Extensions` for given Capapbilities + /// Make `Extensions` for given `Capabilities`. fn extensions_for(&self, capabilities: offchain::Capabilities) -> Extensions; } @@ -77,7 +77,7 @@ impl ExtensionsFactory for () { /// A producer of execution extensions for offchain calls. /// /// This crate aggregates extensions available for the offchain calls -/// and is responsbile to produce a right `Extensions` object +/// and is responsible for producing a correct `Extensions` object. /// for each call, based on required `Capabilities`. pub struct ExecutionExtensions { strategies: ExecutionStrategies, @@ -125,7 +125,7 @@ impl ExecutionExtensions { /// To break retain cycle between `Client` and `TransactionPool` we require this /// extension to be a `Weak` reference. /// That's also the reason why it's being registered lazily instead of - /// during initialisation. + /// during initialization. pub fn register_transaction_pool(&self, pool: Weak>) { *self.transaction_pool.write() = Some(pool); } diff --git a/substrate/client/chain-spec/derive/src/impls.rs b/substrate/client/chain-spec/derive/src/impls.rs index 2caf1c5a9c..43874241f6 100644 --- a/substrate/client/chain-spec/derive/src/impls.rs +++ b/substrate/client/chain-spec/derive/src/impls.rs @@ -108,7 +108,7 @@ pub fn derive( let err = || { let err = Error::new( Span::call_site(), - "ChainSpecGroup is only avaible for structs with named fields." + "ChainSpecGroup is only available for structs with named fields." ).to_compile_error(); quote!( #err ).into() }; diff --git a/substrate/client/chain-spec/src/chain_spec.rs b/substrate/client/chain-spec/src/chain_spec.rs index 81cbce5ea7..696fef5664 100644 --- a/substrate/client/chain-spec/src/chain_spec.rs +++ b/substrate/client/chain-spec/src/chain_spec.rs @@ -336,7 +336,7 @@ mod tests { type TestSpec = ChainSpec; #[test] - fn should_deserailize_example_chain_spec() { + fn should_deserialize_example_chain_spec() { let spec1 = TestSpec::from_json_bytes(Cow::Owned( include_bytes!("../res/chain_spec.json").to_vec() )).unwrap(); diff --git a/substrate/client/cli/src/params.rs b/substrate/client/cli/src/params.rs index 2ffa8bd61b..9ae7bd7748 100644 --- a/substrate/client/cli/src/params.rs +++ b/substrate/client/cli/src/params.rs @@ -718,7 +718,7 @@ pub struct BuildSpecCmd { pub node_key_params: NodeKeyParams, } -/// Wrapper type of `String` which holds an arbitary sized unsigned integer formatted as decimal. +/// Wrapper type of `String` that holds an unsigned integer of arbitrary size, formatted as a decimal. #[derive(Debug, Clone)] pub struct BlockNumber(String); @@ -908,7 +908,7 @@ pub enum Subcommand { /// Import blocks from file. ImportBlocks(ImportBlocksCmd), - /// Validte a single block. + /// Validate a single block. CheckBlock(CheckBlockCmd), /// Revert chain to the previous state. @@ -1266,4 +1266,3 @@ impl BenchmarkCmd { Ok(()) } } - diff --git a/substrate/client/consensus/babe/src/tests.rs b/substrate/client/consensus/babe/src/tests.rs index 67e9d707cf..6c1ffa2c3a 100644 --- a/substrate/client/consensus/babe/src/tests.rs +++ b/substrate/client/consensus/babe/src/tests.rs @@ -316,12 +316,12 @@ impl TestNetFactory for BabeTestNet { } fn peer(&mut self, i: usize) -> &mut Peer { - trace!(target: "babe", "Retreiving a peer"); + trace!(target: "babe", "Retrieving a peer"); &mut self.peers[i] } fn peers(&self) -> &Vec> { - trace!(target: "babe", "Retreiving peers"); + trace!(target: "babe", "Retrieving peers"); &self.peers } diff --git a/substrate/client/consensus/epochs/src/lib.rs b/substrate/client/consensus/epochs/src/lib.rs index cf3d9f5c4c..05ee611de1 100644 --- a/substrate/client/consensus/epochs/src/lib.rs +++ b/substrate/client/consensus/epochs/src/lib.rs @@ -141,7 +141,7 @@ impl ViableEpoch where } } -/// The datatype encoded on disk. +/// The data type encoded on disk. #[derive(Clone, Encode, Decode)] pub enum PersistedEpoch { /// Genesis persisted epoch data. epoch_0, epoch_1. diff --git a/substrate/client/db/src/cache/list_cache.rs b/substrate/client/db/src/cache/list_cache.rs index 72278a1e85..f3a8171342 100644 --- a/substrate/client/db/src/cache/list_cache.rs +++ b/substrate/client/db/src/cache/list_cache.rs @@ -357,7 +357,7 @@ impl> ListCache // it is possible that we're inserting extra (but still required) fork here let new_storage_entry = StorageEntry { prev_valid_from: Some(prev_valid_from), - value: value.expect("chcecked abpve that !value.is_none(); qed"), + value: value.expect("checked above that !value.is_none(); qed"), }; tx.insert_storage_entry(&block, &new_storage_entry); diff --git a/substrate/client/db/src/cache/list_entry.rs b/substrate/client/db/src/cache/list_entry.rs index d3f7dd5769..e184343290 100644 --- a/substrate/client/db/src/cache/list_entry.rs +++ b/substrate/client/db/src/cache/list_entry.rs @@ -69,7 +69,7 @@ impl Entry { .map(|(entry, next)| (entry.valid_from, next))) } - /// Searches the list, ending with THIS entry for the best entry preceeding (or at) + /// Searches the list, ending with THIS entry for the best entry preceding (or at) /// given block number. /// If the entry is found, result is the entry and the block id of next entry (if exists). /// NOTE that this function does not check that the passed block is actually linked to diff --git a/substrate/client/db/src/changes_tries_storage.rs b/substrate/client/db/src/changes_tries_storage.rs index 72163a5694..99488bbaed 100644 --- a/substrate/client/db/src/changes_tries_storage.rs +++ b/substrate/client/db/src/changes_tries_storage.rs @@ -48,7 +48,7 @@ pub fn extract_new_configuration(header: &Header) -> Option<&Op /// Opaque configuration cache transaction. During its lifetime, no-one should modify cache. This is currently /// guaranteed because import lock is held during block import/finalization. pub struct DbChangesTrieStorageTransaction { - /// Cache operations that must be performed after db transaction is comitted. + /// Cache operations that must be performed after db transaction is committed. cache_ops: DbCacheTransactionOps, /// New configuration (if changed at current block). new_config: Option>, diff --git a/substrate/client/db/src/children.rs b/substrate/client/db/src/children.rs index c90af66027..2ef67de6a8 100644 --- a/substrate/client/db/src/children.rs +++ b/substrate/client/db/src/children.rs @@ -100,7 +100,7 @@ mod tests { children2.push(1_6); write_children(&mut tx, 0, PREFIX, 1_2, children2); - db.write(tx.clone()).expect("(2) Commiting transaction failed"); + db.write(tx.clone()).expect("(2) Committing transaction failed"); let r1: Vec = read_children(&db, 0, PREFIX, 1_1).expect("(1) Getting r1 failed"); let r2: Vec = read_children(&db, 0, PREFIX, 1_2).expect("(1) Getting r2 failed"); @@ -109,7 +109,7 @@ mod tests { assert_eq!(r2, vec![1_4, 1_6]); remove_children(&mut tx, 0, PREFIX, 1_2); - db.write(tx).expect("(2) Commiting transaction failed"); + db.write(tx).expect("(2) Committing transaction failed"); let r1: Vec = read_children(&db, 0, PREFIX, 1_1).expect("(2) Getting r1 failed"); let r2: Vec = read_children(&db, 0, PREFIX, 1_2).expect("(2) Getting r2 failed"); diff --git a/substrate/client/db/src/lib.rs b/substrate/client/db/src/lib.rs index b641234281..5173497509 100644 --- a/substrate/client/db/src/lib.rs +++ b/substrate/client/db/src/lib.rs @@ -741,7 +741,7 @@ impl FrozenForDuration { /// Disk backend. /// -/// Disk backend keps data in a key-value store. In archive mode, trie nodes are kept from all blocks. +/// Disk backend keeps data in a key-value store. In archive mode, trie nodes are kept from all blocks. /// Otherwise, trie nodes are kept only from some recent blocks. pub struct Backend { storage: Arc>, @@ -878,7 +878,7 @@ impl Backend { inmem } - /// Returns total numbet of blocks (headers) in the block DB. + /// Returns total number of blocks (headers) in the block DB. #[cfg(feature = "test-helpers")] pub fn blocks_count(&self) -> u64 { self.blockchain.db.iter(columns::HEADER).count() as u64 @@ -1000,7 +1000,7 @@ impl Backend { Ok((*hash, number, false, true)) } - // performs forced canonicaliziation with a delay after importing a non-finalized block. + // performs forced canonicalization with a delay after importing a non-finalized block. fn force_delayed_canonicalize( &self, transaction: &mut DBTransaction, diff --git a/substrate/client/db/src/light.rs b/substrate/client/db/src/light.rs index bea08d6467..14ce6ac0f9 100644 --- a/substrate/client/db/src/light.rs +++ b/substrate/client/db/src/light.rs @@ -815,7 +815,7 @@ pub(crate) mod tests { } #[test] - fn get_cht_fails_for_non_existant_cht() { + fn get_cht_fails_for_non_existent_cht() { let cht_size: u64 = cht::size(); assert!(LightStorage::::new_test().header_cht_root(cht_size, cht_size / 2).unwrap().is_none()); } diff --git a/substrate/client/db/src/storage_cache.rs b/substrate/client/db/src/storage_cache.rs index fd85a899b6..6ef29f47b8 100644 --- a/substrate/client/db/src/storage_cache.rs +++ b/substrate/client/db/src/storage_cache.rs @@ -338,7 +338,7 @@ impl CacheChanges { is_best, ); let cache = &mut *cache; - // Filter out commiting block if any. + // Filter out committing block if any. let enacted: Vec<_> = enacted .iter() .filter(|h| commit_hash.as_ref().map_or(true, |p| *h != p)) @@ -1453,7 +1453,7 @@ mod qc { self.head_state( self.canon.last() - .expect("wasn't forking to emptiness so there shoud be one!") + .expect("wasn't forking to emptiness so there should be one!") .hash ) }, diff --git a/substrate/client/db/src/upgrade.rs b/substrate/client/db/src/upgrade.rs index 69230e7851..971acf8456 100644 --- a/substrate/client/db/src/upgrade.rs +++ b/substrate/client/db/src/upgrade.rs @@ -118,7 +118,7 @@ fn current_version(path: &Path) -> sp_blockchain::Result { } } -/// Opens database of givent type with given number of columns. +/// Opens database of given type with given number of columns. fn open_database(db_path: &Path, db_type: DatabaseType, db_columns: u32) -> sp_blockchain::Result { let db_path = db_path.to_str() .ok_or_else(|| sp_blockchain::Error::Backend("Invalid database path".into()))?; diff --git a/substrate/client/executor/common/src/error.rs b/substrate/client/executor/common/src/error.rs index b8d40d4d91..66d520e942 100644 --- a/substrate/client/executor/common/src/error.rs +++ b/substrate/client/executor/common/src/error.rs @@ -27,7 +27,7 @@ pub type Result = std::result::Result; pub enum Error { /// Unserializable Data InvalidData(sp_serializer::Error), - /// Trap occured during execution + /// Trap occurred during execution Trap(wasmi::Trap), /// Wasmi loading/instantiating error Wasmi(wasmi::Error), diff --git a/substrate/client/executor/common/src/sandbox.rs b/substrate/client/executor/common/src/sandbox.rs index f920a47ca7..ccfdc2f3e0 100644 --- a/substrate/client/executor/common/src/sandbox.rs +++ b/substrate/client/executor/common/src/sandbox.rs @@ -498,7 +498,7 @@ pub fn instantiate<'a, FE: SandboxCapabilities>( /// /// This is generic over a supervisor function reference type. pub struct Store { - // Memories and instances are `Some` untill torndown. + // Memories and instances are `Some` until torn down. instances: Vec>>>, memories: Vec>, } diff --git a/substrate/client/executor/wasmi/src/lib.rs b/substrate/client/executor/wasmi/src/lib.rs index b90c0f05f5..a0e11dfcf8 100644 --- a/substrate/client/executor/wasmi/src/lib.rs +++ b/substrate/client/executor/wasmi/src/lib.rs @@ -276,7 +276,7 @@ struct Resolver<'a> { /// Will be used as initial and maximum size of the imported memory. heap_pages: usize, /// By default, runtimes should import memory and this is `Some(_)` after - /// reolving. However, to be backwards compatible, we also support memory + /// resolving. However, to be backwards compatible, we also support memory /// exported by the WASM blob (this will be `None` after resolving). import_memory: RefCell>, } diff --git a/substrate/client/executor/wasmtime/src/instance_wrapper.rs b/substrate/client/executor/wasmtime/src/instance_wrapper.rs index 013651cd7a..159746801a 100644 --- a/substrate/client/executor/wasmtime/src/instance_wrapper.rs +++ b/substrate/client/executor/wasmtime/src/instance_wrapper.rs @@ -32,7 +32,7 @@ use wasmtime::{Instance, Module, Memory, Table, Val}; /// routines. pub struct InstanceWrapper { instance: Instance, - // The memory instance of the `intance`. + // The memory instance of the `instance`. // // It is important to make sure that we don't make any copies of this to make it easier to proof // See `memory_as_slice` and `memory_as_slice_mut`. @@ -142,7 +142,7 @@ impl InstanceWrapper { Val::I64(val) => Ok(Some(Value::I64(val))), Val::F32(val) => Ok(Some(Value::F32(val))), Val::F64(val) => Ok(Some(Value::F64(val))), - _ => Err("Unknow value type".into()), + _ => Err("Unknown value type".into()), } } } diff --git a/substrate/client/finality-grandpa/src/communication/mod.rs b/substrate/client/finality-grandpa/src/communication/mod.rs index 540923c1b1..050a3c8642 100644 --- a/substrate/client/finality-grandpa/src/communication/mod.rs +++ b/substrate/client/finality-grandpa/src/communication/mod.rs @@ -74,7 +74,7 @@ mod cost { pub(super) const MALFORMED_CATCH_UP: Rep = Rep::new(-1000, "Grandpa: Malformed cath-up"); pub(super) const MALFORMED_COMMIT: Rep = Rep::new(-1000, "Grandpa: Malformed commit"); pub(super) const FUTURE_MESSAGE: Rep = Rep::new(-500, "Grandpa: Future message"); - pub(super) const UNKNOWN_VOTER: Rep = Rep::new(-150, "Grandpa: Uknown voter"); + pub(super) const UNKNOWN_VOTER: Rep = Rep::new(-150, "Grandpa: Unknown voter"); pub(super) const INVALID_VIEW_CHANGE: Rep = Rep::new(-500, "Grandpa: Invalid view change"); pub(super) const PER_UNDECODABLE_BYTE: i32 = -5; @@ -83,7 +83,7 @@ mod cost { pub(super) const INVALID_CATCH_UP: Rep = Rep::new(-5000, "Grandpa: Invalid catch-up"); pub(super) const INVALID_COMMIT: Rep = Rep::new(-5000, "Grandpa: Invalid commit"); pub(super) const OUT_OF_SCOPE_MESSAGE: Rep = Rep::new(-500, "Grandpa: Out-of-scope message"); - pub(super) const CATCH_UP_REQUEST_TIMEOUT: Rep = Rep::new(-200, "Grandpa: Catch-up reqeust timeout"); + pub(super) const CATCH_UP_REQUEST_TIMEOUT: Rep = Rep::new(-200, "Grandpa: Catch-up request timeout"); // cost of answering a catch up request pub(super) const CATCH_UP_REPLY: Rep = Rep::new(-200, "Grandpa: Catch-up reply"); @@ -153,14 +153,14 @@ pub(crate) struct NetworkBridge> { /// `NeighborPacketWorker` processing packets sent through the `NeighborPacketSender`. // - // `NetworkBridge` is required to be clonable, thus one needs to be able to clone its children, - // thus one has to wrap neighor_packet_worker with an `Arc` `Mutex`. + // `NetworkBridge` is required to be cloneable, thus one needs to be able to clone its children, + // thus one has to wrap `neighbor_packet_worker` with an `Arc` `Mutex`. neighbor_packet_worker: Arc>>, /// Receiver side of the peer report stream populated by the gossip validator, forwarded to the /// gossip engine. // - // `NetworkBridge` is required to be clonable, thus one needs to be able to clone its children, + // `NetworkBridge` is required to be cloneable, thus one needs to be able to clone its children, // thus one has to wrap gossip_validator_report_stream with an `Arc` `Mutex`. Given that it is // just an `UnboundedReceiver`, one could also switch to a multi-producer-*multi*-consumer // channel implementation. diff --git a/substrate/client/finality-grandpa/src/finality_proof.rs b/substrate/client/finality-grandpa/src/finality_proof.rs index fb0f7fd4a9..9da99ab531 100644 --- a/substrate/client/finality-grandpa/src/finality_proof.rs +++ b/substrate/client/finality-grandpa/src/finality_proof.rs @@ -920,7 +920,7 @@ pub(crate) mod tests { } #[test] - fn finality_proof_check_fails_when_intemediate_fragment_has_unknown_headers() { + fn finality_proof_check_fails_when_intermediate_fragment_has_unknown_headers() { let blockchain = test_blockchain(); // when intermediate (#0) fragment has non-empty unknown headers @@ -945,7 +945,7 @@ pub(crate) mod tests { } #[test] - fn finality_proof_check_fails_when_intemediate_fragment_has_no_authorities_proof() { + fn finality_proof_check_fails_when_intermediate_fragment_has_no_authorities_proof() { let blockchain = test_blockchain(); // when intermediate (#0) fragment has empty authorities proof @@ -1004,7 +1004,7 @@ pub(crate) mod tests { #[test] fn finality_proof_is_none_if_first_justification_is_generated_by_unknown_set() { // this is the case for forced change: set_id has been forcibly increased on full node - // and ligh node missed that + // and light node missed that // => justification verification will fail on light node anyways, so we do not return // finality proof at all let blockchain = test_blockchain(); diff --git a/substrate/client/finality-grandpa/src/tests.rs b/substrate/client/finality-grandpa/src/tests.rs index 71cc72b059..9b9063f2c1 100644 --- a/substrate/client/finality-grandpa/src/tests.rs +++ b/substrate/client/finality-grandpa/src/tests.rs @@ -147,7 +147,7 @@ impl TestNetFactory for GrandpaTestNet { use crate::light_import::tests::light_block_import_without_justifications; let authorities_provider = Arc::new(self.test_config.clone()); - // forbid direct finalization using justification that cames with the block + // forbid direct finalization using justification that came with the block // => light clients will try to fetch finality proofs let import = light_block_import_without_justifications( client.clone(), @@ -982,7 +982,7 @@ fn force_change_to_new_set() { // it will only finalize if the forced transition happens. // we add_blocks after the voters are spawned because otherwise - // the link-halfs have the wrong AuthoritySet + // the link-halves have the wrong AuthoritySet run_to_completion(&mut runtime, 25, net, peers_a); } diff --git a/substrate/client/keystore/src/lib.rs b/substrate/client/keystore/src/lib.rs index ef81c40c10..92c8f4f9a5 100644 --- a/substrate/client/keystore/src/lib.rs +++ b/substrate/client/keystore/src/lib.rs @@ -260,7 +260,7 @@ impl Store { /// Get public keys of all stored keys that match the key type. /// /// This will just use the type of the public key (a list of which to be returned) in order - /// to determine the key type. Unless you use a specialised application-type public key, then + /// to determine the key type. Unless you use a specialized application-type public key, then /// this only give you keys registered under generic cryptography, and will not return keys /// registered under the application type. pub fn public_keys(&self) -> Result> { diff --git a/substrate/client/network-gossip/src/state_machine.rs b/substrate/client/network-gossip/src/state_machine.rs index 2acfdc3785..26433e63ec 100644 --- a/substrate/client/network-gossip/src/state_machine.rs +++ b/substrate/client/network-gossip/src/state_machine.rs @@ -45,7 +45,7 @@ mod rep { pub const DUPLICATE_GOSSIP: Rep = Rep::new(-(1 << 2), "Duplicate gossip"); /// Reputation change when a peer sends us a gossip message for an unknown engine, whatever that /// means. - pub const UNKNOWN_GOSSIP: Rep = Rep::new(-(1 << 6), "Unknown gossup message engine id"); + pub const UNKNOWN_GOSSIP: Rep = Rep::new(-(1 << 6), "Unknown gossip message engine id"); /// Reputation change when a peer sends a message from a topic it isn't registered on. pub const UNREGISTERED_TOPIC: Rep = Rep::new(-(1 << 10), "Unregistered gossip message topic"); } diff --git a/substrate/client/network/src/discovery.rs b/substrate/client/network/src/discovery.rs index 2d69e679ff..a236ceb1a8 100644 --- a/substrate/client/network/src/discovery.rs +++ b/substrate/client/network/src/discovery.rs @@ -192,7 +192,7 @@ pub enum DiscoveryOut { /// e.g. obtained through the `identify` protocol. UnroutablePeer(PeerId), - /// The DHT yeided results for the record request, grouped in (key, value) pairs. + /// The DHT yielded results for the record request, grouped in (key, value) pairs. ValueFound(Vec<(record::Key, Vec)>), /// The record requested was not found in the DHT. diff --git a/substrate/client/network/src/protocol.rs b/substrate/client/network/src/protocol.rs index 0a909fe2fe..9e098c27e9 100644 --- a/substrate/client/network/src/protocol.rs +++ b/substrate/client/network/src/protocol.rs @@ -81,7 +81,7 @@ pub use light_client_handler::LightClientHandler; const REQUEST_TIMEOUT_SEC: u64 = 40; /// Interval at which we perform time based maintenance const TICK_TIMEOUT: time::Duration = time::Duration::from_millis(1100); -/// Interval at which we propagate exstrinsics; +/// Interval at which we propagate extrinsics; const PROPAGATE_TIMEOUT: time::Duration = time::Duration::from_millis(2900); /// Maximim number of known block hashes to keep for a peer. @@ -97,7 +97,7 @@ pub(crate) const MIN_VERSION: u32 = 3; // Maximum allowed entries in `BlockResponse` const MAX_BLOCK_DATA_RESPONSE: u32 = 128; /// When light node connects to the full node and the full node is behind light node -/// for at least `LIGHT_MAXIMAL_BLOCKS_DIFFERENCE` blocks, we consider it unuseful +/// for at least `LIGHT_MAXIMAL_BLOCKS_DIFFERENCE` blocks, we consider it not useful /// and disconnect to free connection slot. const LIGHT_MAXIMAL_BLOCKS_DIFFERENCE: u64 = 8192; @@ -183,7 +183,7 @@ struct Peer { info: PeerInfo, /// Current block request, if any. block_request: Option<(Instant, message::BlockRequest)>, - /// Requests we are no longer insterested in. + /// Requests we are no longer interested in. obsolete_requests: HashMap, /// Holds a set of transactions known to this peer. known_extrinsics: LruHashSet, diff --git a/substrate/client/network/src/protocol/event.rs b/substrate/client/network/src/protocol/event.rs index e239e9d983..78490863be 100644 --- a/substrate/client/network/src/protocol/event.rs +++ b/substrate/client/network/src/protocol/event.rs @@ -36,7 +36,7 @@ pub enum DhtEvent { /// The record has been successfully inserted into the DHT. ValuePut(Key), - /// An error has occured while putting a record into the DHT. + /// An error has occurred while putting a record into the DHT. ValuePutFailed(Key), } diff --git a/substrate/client/network/src/protocol/light_client_handler.rs b/substrate/client/network/src/protocol/light_client_handler.rs index 63c1f8a443..b31877d928 100644 --- a/substrate/client/network/src/protocol/light_client_handler.rs +++ b/substrate/client/network/src/protocol/light_client_handler.rs @@ -836,10 +836,10 @@ where }; if let Some(peer) = available_peer { let id = self.next_request_id(); - let rq = serialise_request(id, &request.request); + let rq = serialize_request(id, &request.request); let mut buf = Vec::with_capacity(rq.encoded_len()); if let Err(e) = rq.encode(&mut buf) { - log::debug!("failed to serialise request {}: {}", id, e); + log::debug!("failed to serialize request {}: {}", id, e); send_reply(Err(ClientError::RemoteFetchFailed), request.request) } else { log::trace!("sending request {} to peer {}", id, peer); @@ -917,7 +917,7 @@ fn retries(request: &Request) -> usize { rc.unwrap_or(0) } -fn serialise_request(id: u64, request: &Request) -> api::v1::light::Request { +fn serialize_request(id: u64, request: &Request) -> api::v1::light::Request { let request = match request { Request::Header { request, .. } => { let r = api::v1::light::RemoteHeaderRequest { block: request.block.encode() }; @@ -1051,7 +1051,7 @@ where /// Sends a request to remote and awaits the response. #[derive(Debug, Clone)] pub struct OutboundProtocol { - /// The serialised protobuf request. + /// The serialized protobuf request. request: Vec, /// The max. request length in bytes. max_data_size: usize, diff --git a/substrate/client/network/src/protocol/light_dispatch.rs b/substrate/client/network/src/protocol/light_dispatch.rs index 3402e7c329..738847dbaf 100644 --- a/substrate/client/network/src/protocol/light_dispatch.rs +++ b/substrate/client/network/src/protocol/light_dispatch.rs @@ -227,7 +227,7 @@ impl FetchChecker for AlwaysBadChecker { impl LightDispatch where B::Header: HeaderT, { - /// Creates new light client requests processer. + /// Creates new light client requests processor. pub fn new(checker: Arc>) -> Self { LightDispatch { checker, @@ -567,7 +567,7 @@ impl LightDispatch where // return peer to the back of the queue self.idle_peers.push_back(peer.clone()); - // we have enumerated all peers and noone can handle request + // we have enumerated all peers and no one can handle request if Some(peer) == last_peer { let request = self.pending_requests.pop_front().expect("checked in loop condition; qed"); unhandled_requests.push_back(request); diff --git a/substrate/client/network/src/protocol/message.rs b/substrate/client/network/src/protocol/message.rs index ef7d550de6..a2261b2059 100644 --- a/substrate/client/network/src/protocol/message.rs +++ b/substrate/client/network/src/protocol/message.rs @@ -209,13 +209,13 @@ pub mod generic { RemoteHeaderResponse(RemoteHeaderResponse
), /// Remote changes request. RemoteChangesRequest(RemoteChangesRequest), - /// Remote changes reponse. + /// Remote changes response. RemoteChangesResponse(RemoteChangesResponse), /// Remote child storage read request. RemoteReadChildRequest(RemoteReadChildRequest), /// Finality proof request. FinalityProofRequest(FinalityProofRequest), - /// Finality proof reponse. + /// Finality proof response. FinalityProofResponse(FinalityProofResponse), /// Batch of consensus protocol messages. ConsensusBatch(Vec), diff --git a/substrate/client/network/src/protocol/schema/api.v1.proto b/substrate/client/network/src/protocol/schema/api.v1.proto index e4c32ec585..73128c53de 100644 --- a/substrate/client/network/src/protocol/schema/api.v1.proto +++ b/substrate/client/network/src/protocol/schema/api.v1.proto @@ -8,7 +8,7 @@ package api.v1; enum Direction { // Enumerate in ascending order (from child to parent). Ascending = 0; - // Enumerate in descendfing order (from parent to canonical child). + // Enumerate in descending order (from parent to canonical child). Descending = 1; } diff --git a/substrate/client/network/src/protocol/sync.rs b/substrate/client/network/src/protocol/sync.rs index a513d47ca4..3b909b3303 100644 --- a/substrate/client/network/src/protocol/sync.rs +++ b/substrate/client/network/src/protocol/sync.rs @@ -751,7 +751,7 @@ impl ChainSync { | PeerSyncState::DownloadingFinalityProof(..) => Vec::new() } } else { - // When request.is_none() just acccept blocks + // When request.is_none() just accept blocks blocks.into_iter().map(|b| { IncomingBlock { hash: b.hash, @@ -955,7 +955,7 @@ impl ChainSync { }, Err(BlockImportError::MissingState) => { // This may happen if the chain we were requesting upon has been discarded - // in the meantime becasue other chain has been finalized. + // in the meantime because other chain has been finalized. // Don't mark it as bad as it still may be synced if explicitly requested. trace!(target: "sync", "Obsolete block"); }, diff --git a/substrate/client/network/src/protocol/sync/extra_requests.rs b/substrate/client/network/src/protocol/sync/extra_requests.rs index a5fb232b8d..19c6b50743 100644 --- a/substrate/client/network/src/protocol/sync/extra_requests.rs +++ b/substrate/client/network/src/protocol/sync/extra_requests.rs @@ -469,7 +469,7 @@ mod tests { } #[test] - fn anecstor_roots_are_finalized_when_finality_notification_is_missed() { + fn ancestor_roots_are_finalized_when_finality_notification_is_missed() { let mut finality_proofs = ExtraRequests::::new("test"); let hash4 = [4; 32].into(); diff --git a/substrate/client/network/src/service.rs b/substrate/client/network/src/service.rs index 922333a9eb..8d99028298 100644 --- a/substrate/client/network/src/service.rs +++ b/substrate/client/network/src/service.rs @@ -367,7 +367,7 @@ impl, H: ExHashT> NetworkWorker /// Get network state. /// - /// **Note**: Use this only for debugging. This API is unstable. There are warnings literaly + /// **Note**: Use this only for debugging. This API is unstable. There are warnings literally /// everywhere about this. Please don't use this function to retrieve actual information. pub fn network_state(&mut self) -> NetworkState { let swarm = &mut self.network_service; diff --git a/substrate/client/network/test/src/lib.rs b/substrate/client/network/test/src/lib.rs index 82d1737e9e..c15bd33655 100644 --- a/substrate/client/network/test/src/lib.rs +++ b/substrate/client/network/test/src/lib.rs @@ -766,7 +766,7 @@ pub trait TestNetFactory: Sized { /// Blocks the current thread until we are sync'ed. /// - /// Calls `poll_until_sync` repeatidely with the runtime passed as parameter. + /// Calls `poll_until_sync` repeatedly with the runtime passed as parameter. fn block_until_sync(&mut self, runtime: &mut tokio::runtime::current_thread::Runtime) { runtime.block_on(futures::future::poll_fn::<(), (), _>(|| Ok(self.poll_until_sync()))).unwrap(); } diff --git a/substrate/client/offchain/src/api/http.rs b/substrate/client/offchain/src/api/http.rs index 84c3ecd69b..7aa0963fcf 100644 --- a/substrate/client/offchain/src/api/http.rs +++ b/substrate/client/offchain/src/api/http.rs @@ -18,7 +18,7 @@ //! function returns a pair of [`HttpApi`] and [`HttpWorker`] that share some state. //! //! The [`HttpApi`] is (indirectly) passed to the runtime when calling an offchain worker, while -//! the [`HttpWorker`] must be processed in the background. The [`HttpApi`] mimicks the API of the +//! the [`HttpWorker`] must be processed in the background. The [`HttpApi`] mimics the API of the //! HTTP-related methods available to offchain workers. //! //! The reason for this design is driven by the fact that HTTP requests should continue running @@ -110,7 +110,7 @@ struct HttpApiRequestRp { } impl HttpApi { - /// Mimicks the corresponding method in the offchain API. + /// Mimics the corresponding method in the offchain API. pub fn request_start( &mut self, method: &str, @@ -138,7 +138,7 @@ impl HttpApi { Ok(new_id) } - /// Mimicks the corresponding method in the offchain API. + /// Mimics the corresponding method in the offchain API. pub fn request_add_header( &mut self, request_id: HttpRequestId, @@ -158,7 +158,7 @@ impl HttpApi { Ok(()) } - /// Mimicks the corresponding method in the offchain API. + /// Mimics the corresponding method in the offchain API. pub fn request_write_body( &mut self, request_id: HttpRequestId, @@ -266,7 +266,7 @@ impl HttpApi { } } - /// Mimicks the corresponding method in the offchain API. + /// Mimics the corresponding method in the offchain API. pub fn response_wait( &mut self, ids: &[HttpRequestId], @@ -392,7 +392,7 @@ impl HttpApi { } } - /// Mimicks the corresponding method in the offchain API. + /// Mimics the corresponding method in the offchain API. pub fn response_headers( &mut self, request_id: HttpRequestId @@ -411,7 +411,7 @@ impl HttpApi { .collect() } - /// Mimicks the corresponding method in the offchain API. + /// Mimics the corresponding method in the offchain API. pub fn response_read_body( &mut self, request_id: HttpRequestId, @@ -947,7 +947,7 @@ mod tests { #[test] fn fuzzing() { - // Uses the API in random ways to try to trigger panicks. + // Uses the API in random ways to try to trigger panics. // Doesn't test some paths, such as waiting for multiple requests. Also doesn't test what // happens if the server force-closes our socket. diff --git a/substrate/client/offchain/src/api/http_dummy.rs b/substrate/client/offchain/src/api/http_dummy.rs index 8725c89899..5ff77a1068 100644 --- a/substrate/client/offchain/src/api/http_dummy.rs +++ b/substrate/client/offchain/src/api/http_dummy.rs @@ -33,7 +33,7 @@ pub struct HttpApi; pub struct HttpWorker; impl HttpApi { - /// Mimicks the corresponding method in the offchain API. + /// Mimics the corresponding method in the offchain API. pub fn request_start( &mut self, _: &str, @@ -43,7 +43,7 @@ impl HttpApi { Err(()) } - /// Mimicks the corresponding method in the offchain API. + /// Mimics the corresponding method in the offchain API. pub fn request_add_header( &mut self, _: HttpRequestId, @@ -54,7 +54,7 @@ impl HttpApi { never be called; qed") } - /// Mimicks the corresponding method in the offchain API. + /// Mimics the corresponding method in the offchain API. pub fn request_write_body( &mut self, _: HttpRequestId, @@ -65,7 +65,7 @@ impl HttpApi { never be called; qed") } - /// Mimicks the corresponding method in the offchain API. + /// Mimics the corresponding method in the offchain API. pub fn response_wait( &mut self, requests: &[HttpRequestId], @@ -79,7 +79,7 @@ impl HttpApi { } } - /// Mimicks the corresponding method in the offchain API. + /// Mimics the corresponding method in the offchain API. pub fn response_headers( &mut self, _: HttpRequestId @@ -88,7 +88,7 @@ impl HttpApi { never be called; qed") } - /// Mimicks the corresponding method in the offchain API. + /// Mimics the corresponding method in the offchain API. pub fn response_read_body( &mut self, _: HttpRequestId, diff --git a/substrate/client/offchain/src/lib.rs b/substrate/client/offchain/src/lib.rs index ac8cc14861..7fc9671fcb 100644 --- a/substrate/client/offchain/src/lib.rs +++ b/substrate/client/offchain/src/lib.rs @@ -217,6 +217,6 @@ mod tests { // then assert_eq!(pool.0.status().ready, 1); - assert_eq!(pool.0.ready().next().unwrap().is_propagateable(), false); + assert_eq!(pool.0.ready().next().unwrap().is_propagable(), false); } } diff --git a/substrate/client/rpc-api/src/author/mod.rs b/substrate/client/rpc-api/src/author/mod.rs index 4fbf0c73a3..49c4c996fa 100644 --- a/substrate/client/rpc-api/src/author/mod.rs +++ b/substrate/client/rpc-api/src/author/mod.rs @@ -77,7 +77,7 @@ pub trait AuthorApi { /// Submit an extrinsic to watch. /// /// See [`TransactionStatus`](sp_transaction_pool::TransactionStatus) for details on transaction - /// lifecycle. + /// life cycle. #[pubsub( subscription = "author_extrinsicUpdate", subscribe, diff --git a/substrate/client/rpc-api/src/errors.rs b/substrate/client/rpc-api/src/errors.rs index 9db41d0497..b75c34ead3 100644 --- a/substrate/client/rpc-api/src/errors.rs +++ b/substrate/client/rpc-api/src/errors.rs @@ -20,7 +20,7 @@ pub fn internal(e: E) -> jsonrpc_core::Error { warn!("Unknown error: {:?}", e); jsonrpc_core::Error { code: jsonrpc_core::ErrorCode::InternalError, - message: "Unknown error occured".into(), + message: "Unknown error occurred".into(), data: Some(format!("{:?}", e).into()), } } diff --git a/substrate/client/rpc-api/src/subscriptions.rs b/substrate/client/rpc-api/src/subscriptions.rs index 808c9d5ba4..54881bad51 100644 --- a/substrate/client/rpc-api/src/subscriptions.rs +++ b/substrate/client/rpc-api/src/subscriptions.rs @@ -71,7 +71,7 @@ impl Subscriptions { /// Borrows the internal task executor. /// - /// This can be used to spawn additional tasks on the underyling event loop. + /// This can be used to spawn additional tasks on the underlying event loop. pub fn executor(&self) -> &TaskExecutor { &self.executor } diff --git a/substrate/client/service/src/lib.rs b/substrate/client/service/src/lib.rs index 55fdba706b..c358e5993e 100644 --- a/substrate/client/service/src/lib.rs +++ b/substrate/client/service/src/lib.rs @@ -625,7 +625,7 @@ where E: IntoPoolError + From, { pool.ready() - .filter(|t| t.is_propagateable()) + .filter(|t| t.is_propagable()) .map(|t| { let hash = t.hash().clone(); let ex: B::Extrinsic = t.data().clone(); diff --git a/substrate/client/service/test/src/lib.rs b/substrate/client/service/test/src/lib.rs index 723c13ec82..b65bccc151 100644 --- a/substrate/client/service/test/src/lib.rs +++ b/substrate/client/service/test/src/lib.rs @@ -498,7 +498,7 @@ pub fn consensus( const NUM_FULL_NODES: usize = 10; const NUM_LIGHT_NODES: usize = 10; const NUM_BLOCKS: usize = 10; // 10 * 2 sec block production time = ~20 seconds - let temp = tempdir_with_prefix("substrate-conensus-test"); + let temp = tempdir_with_prefix("substrate-consensus-test"); let mut network = TestNet::new( &temp, spec.clone(), diff --git a/substrate/client/src/client.rs b/substrate/client/src/client.rs index d085b92025..e9a8f1228c 100644 --- a/substrate/client/src/client.rs +++ b/substrate/client/src/client.rs @@ -1192,7 +1192,7 @@ impl Client where // NOTE: we're setting the finalized block as best block, this might // be slightly inaccurate since we might have a "better" block // further along this chain, but since best chain selection logic is - // pluggable we cannot make a better choice here. usages that need + // plugable we cannot make a better choice here. usages that need // an accurate "best" block need to go through `SelectChain` // instead. operation.op.mark_head(BlockId::Hash(block))?; @@ -3041,7 +3041,7 @@ pub(crate) mod tests { .unwrap().build().unwrap().block; // we will finalize A2 which should make it impossible to import a new - // B3 at the same height but that doesnt't include it + // B3 at the same height but that doesn't include it ClientExt::finalize_block(&client, BlockId::Hash(a2.hash()), None).unwrap(); let import_err = client.import(BlockOrigin::Own, b3).err().unwrap(); diff --git a/substrate/client/state-db/src/lib.rs b/substrate/client/state-db/src/lib.rs index f2722ae308..0eab640de8 100644 --- a/substrate/client/state-db/src/lib.rs +++ b/substrate/client/state-db/src/lib.rs @@ -102,7 +102,7 @@ impl fmt::Debug for Error { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self { Error::Db(e) => e.fmt(f), - Error::Decoding(e) => write!(f, "Error decoding slicable value: {}", e.what()), + Error::Decoding(e) => write!(f, "Error decoding sliceable value: {}", e.what()), Error::InvalidBlock => write!(f, "Trying to canonicalize invalid block"), Error::InvalidBlockNumber => write!(f, "Trying to insert block with invalid number"), Error::InvalidParent => write!(f, "Trying to insert block with unknown parent"), diff --git a/substrate/client/state-db/src/noncanonical.rs b/substrate/client/state-db/src/noncanonical.rs index 373c1aa0da..db2f58fa89 100644 --- a/substrate/client/state-db/src/noncanonical.rs +++ b/substrate/client/state-db/src/noncanonical.rs @@ -106,7 +106,7 @@ fn discard_descendants( // save to be discarded later. pinned_insertions.insert(overlay.hash.clone(), overlay.inserted); } else { - // discard immediatelly. + // discard immediately. parents.remove(&overlay.hash); discard_values(&mut values, overlay.inserted); } diff --git a/substrate/client/state-db/src/pruning.rs b/substrate/client/state-db/src/pruning.rs index a993df4f11..71d018087b 100644 --- a/substrate/client/state-db/src/pruning.rs +++ b/substrate/client/state-db/src/pruning.rs @@ -36,7 +36,7 @@ pub struct RefWindow { death_rows: VecDeque>, /// An index that maps each key from `death_rows` to block number. death_index: HashMap, - /// Block number that corresponts to the front of `death_rows` + /// Block number that corresponds to the front of `death_rows`. pending_number: u64, /// Number of call of `note_canonical` after /// last call `apply_pending` or `revert_pending` @@ -348,7 +348,7 @@ mod tests { } #[test] - fn reinserted_survivew_pending() { + fn reinserted_survive_pending() { let mut db = make_db(&[1, 2, 3]); let mut pruning: RefWindow = RefWindow::new(&db).unwrap(); let mut commit = make_commit(&[], &[2]); diff --git a/substrate/client/telemetry/src/lib.rs b/substrate/client/telemetry/src/lib.rs index 1c6f1425d6..f8ca6d5c73 100644 --- a/substrate/client/telemetry/src/lib.rs +++ b/substrate/client/telemetry/src/lib.rs @@ -126,7 +126,7 @@ pub struct Telemetry { /// Behind the `Mutex` in `Telemetry`. /// -/// Note that ideally we wouldn't have to make the `Telemetry` clonable, as that would remove the +/// Note that ideally we wouldn't have to make the `Telemetry` cloneable, as that would remove the /// need for a `Mutex`. However there is currently a weird hack in place in `sc-service` /// where we extract the telemetry registration so that it continues running during the shutdown /// process. @@ -195,7 +195,7 @@ impl Stream for Telemetry { fn poll_next(self: Pin<&mut Self>, cx: &mut Context) -> Poll> { let before = Instant::now(); - // Because the `Telemetry` is clonable, we need to put the actual fields behind a `Mutex`. + // Because the `Telemetry` is cloneable, we need to put the actual fields behind a `Mutex`. // However, the user is only ever supposed to poll from one instance of `Telemetry`, while // the other instances are used only for RAII purposes. // We assume that the user is following this advice and therefore that the `Mutex` is only diff --git a/substrate/client/transaction-pool/graph/src/base_pool.rs b/substrate/client/transaction-pool/graph/src/base_pool.rs index 8a33d8244e..33b7a51f94 100644 --- a/substrate/client/transaction-pool/graph/src/base_pool.rs +++ b/substrate/client/transaction-pool/graph/src/base_pool.rs @@ -138,7 +138,7 @@ impl InPoolTransaction for Transaction { &self.provides } - fn is_propagateable(&self) -> bool { + fn is_propagable(&self) -> bool { self.propagate } } @@ -1058,7 +1058,7 @@ requires: [03,02], provides: [04], data: [4]}".to_owned() requires: vec![vec![3], vec![2]], provides: vec![vec![4]], propagate: true, - }.is_propagateable(), true); + }.is_propagable(), true); assert_eq!(Transaction { data: vec![4u8], @@ -1069,7 +1069,7 @@ requires: [03,02], provides: [04], data: [4]}".to_owned() requires: vec![vec![3], vec![2]], provides: vec![vec![4]], propagate: false, - }.is_propagateable(), false); + }.is_propagable(), false); } #[test] @@ -1126,7 +1126,7 @@ requires: [03,02], provides: [04], data: [4]}".to_owned() } #[test] - fn should_accept_future_transactions_when_explcitly_asked_to() { + fn should_accept_future_transactions_when_explicitly_asked_to() { // given let mut pool = pool(); pool.reject_future_transactions = true; diff --git a/substrate/client/transaction-pool/graph/src/listener.rs b/substrate/client/transaction-pool/graph/src/listener.rs index be6fb5c990..92ba71007e 100644 --- a/substrate/client/transaction-pool/graph/src/listener.rs +++ b/substrate/client/transaction-pool/graph/src/listener.rs @@ -58,7 +58,7 @@ impl Listener { /// Creates a new watcher for given verified extrinsic. /// - /// The watcher can be used to subscribe to lifecycle events of that extrinsic. + /// The watcher can be used to subscribe to life-cycle events of that extrinsic. pub fn create_watcher(&mut self, hash: H) -> watcher::Watcher> { let sender = self.watchers.entry(hash.clone()).or_insert_with(watcher::Sender::default); sender.new_watcher(hash) diff --git a/substrate/client/transaction-pool/graph/src/pool.rs b/substrate/client/transaction-pool/graph/src/pool.rs index 103f556d0e..12601bb8d2 100644 --- a/substrate/client/transaction-pool/graph/src/pool.rs +++ b/substrate/client/transaction-pool/graph/src/pool.rs @@ -308,7 +308,7 @@ impl Pool { let reverified_transactions = self.verify(at, pruned_transactions, false).await?; - log::trace!(target: "txpool", "Prunning at {:?}. Resubmitting transactions.", at); + log::trace!(target: "txpool", "Pruning at {:?}. Resubmitting transactions.", at); // And finally - submit reverified transactions back to the pool self.validated_pool.resubmit_pruned( diff --git a/substrate/client/transaction-pool/src/testing/pool.rs b/substrate/client/transaction-pool/src/testing/pool.rs index ed7c3e2d7a..c194a8615b 100644 --- a/substrate/client/transaction-pool/src/testing/pool.rs +++ b/substrate/client/transaction-pool/src/testing/pool.rs @@ -222,7 +222,7 @@ fn should_revalidate_during_maintenance() { } #[test] -fn should_resubmit_from_retracted_during_maintaince() { +fn should_resubmit_from_retracted_during_maintenance() { let xt = uxt(Alice, 209); let retracted_hash = Hash::random(); diff --git a/substrate/docs/CODE_OF_CONDUCT.adoc b/substrate/docs/CODE_OF_CONDUCT.adoc index 7cb0210e8e..0f7de7c7ef 100644 --- a/substrate/docs/CODE_OF_CONDUCT.adoc +++ b/substrate/docs/CODE_OF_CONDUCT.adoc @@ -22,7 +22,7 @@ Examples of unacceptable behavior by participants include: * Publishing others' private information, such as a physical or electronic address, without explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting -=== Facilitation, Not Strongarming +=== Facilitation, Not Strong Arming We recognize that this software is merely a tool for users to create and maintain their blockchain of preference. We see that blockchains are naturally community platforms with users being the ultimate decision makers. We assert that good software will maximize user agency by facilitate user-expression on the network. As such: diff --git a/substrate/docs/CONTRIBUTING.adoc b/substrate/docs/CONTRIBUTING.adoc index 817e1d7489..c83b686b09 100644 --- a/substrate/docs/CONTRIBUTING.adoc +++ b/substrate/docs/CONTRIBUTING.adoc @@ -52,7 +52,7 @@ If your PR changes the external APIs or interfaces used by Polkadot, **a corresp To update a corresponding Polkadot PR: -0. Pull lastet Polkadot master (or clone it, if you haven't yet). +0. Pull latest Polkadot master (or clone it, if you haven't yet). 1. Replace `polkadot-master` in all `Cargo.toml` with the name of the PR-branch - e.g. by running `find . -name "Cargo.toml" -exec sed -i "s/polkadot-master/PR_BRANCH/g" {}` (and to your repo, if the branch is not on mainline); Commit this change. 2. Make the changes required to pass the build again. 3. Submit all this as a PR against the Polkadot Repo, link that new PR in the existing substrate PR for reference diff --git a/substrate/docs/README.adoc b/substrate/docs/README.adoc index d8c582296c..bbc2713fbe 100644 --- a/substrate/docs/README.adoc +++ b/substrate/docs/README.adoc @@ -24,13 +24,13 @@ Substrate is designed for use in one of three ways: **1. Trivial**: By running the Substrate binary `substrate` and configuring it with a genesis block that includes the current demonstration runtime. In this case, you just build Substrate, configure a JSON file, and launch your own blockchain. This affords you the least amount of customizability, primarily allowing you to change the genesis parameters of the various included runtime modules such as balances, staking, block-period, fees, and governance. -**2. Modular**: By hacking together pallets built with Substrate FRAME into a new runtime and possibly altering or reconfiguring the Substrate client's block authoring logic. This affords you a very large amount of freedom over your blockchain's logic, letting you change datatypes, add or remove modules, and crucially, add your own modules. Much can be changed without touching the block authoring logic (since it is generic). If this is the case, then the existing Substrate binary can be used for block authoring and syncing. If the block authoring logic needs to be tweaked, then a new, altered block authoring binary must be built as a separate project and used by validators. This is how the Polkadot relay chain is built and should suffice for almost all circumstances in the near to mid-term. +**2. Modular**: By hacking together pallets built with Substrate FRAME into a new runtime and possibly altering or reconfiguring the Substrate client's block authoring logic. This affords you a very large amount of freedom over your blockchain's logic, letting you change data types, add or remove modules, and crucially, add your own modules. Much can be changed without touching the block authoring logic (since it is generic). If this is the case, then the existing Substrate binary can be used for block authoring and syncing. If the block authoring logic needs to be tweaked, then a new, altered block authoring binary must be built as a separate project and used by validators. This is how the Polkadot relay chain is built and should suffice for almost all circumstances in the near to mid-term. **3. Generic**: The entire SRML can be ignored and the entire runtime designed and implemented from scratch. If desired, this can be done in a language other than Rust, provided it can target WebAssembly. If the runtime can be made compatible with the existing client's block authoring logic, then you can simply construct a new genesis block from your Wasm blob and launch your chain with the existing Rust-based Substrate client. If not, then you'll need to alter the client's block authoring logic accordingly. This is probably a useless option for most projects right now, but provides complete flexibility allowing for a long-term, far-reaching upgrade path for the Substrate paradigm. === The Basics of Substrate -Substrate is a blockchain platform with a completely generic state transition function. That said, it does come with both standards and conventions (particularly regarding the Runtime Module Library) regarding underlying data structures. Roughly speaking, these core datatypes correspond to +trait+s in terms of the actual non-negotiable standard and generic +struct+s in terms of the convention. +Substrate is a blockchain platform with a completely generic state transition function. That said, it does come with both standards and conventions (particularly regarding the Runtime Module Library) regarding underlying data structures. Roughly speaking, these core data types correspond to +trait+s in terms of the actual non-negotiable standard and generic +struct+s in terms of the convention. ``` Header := Parent + ExtrinsicsRoot + StorageRoot + Digest diff --git a/substrate/docs/SECURITY.md b/substrate/docs/SECURITY.md index b850e5462e..7240218fa8 100644 --- a/substrate/docs/SECURITY.md +++ b/substrate/docs/SECURITY.md @@ -36,7 +36,7 @@ Responsible investigation and reporting includes, but isn't limited to, the foll ## Bug Bounty Program -Our Bug Bounty Program allows us to recognise and reward members of the Parity community for helping us find and address significant bugs, in accordance with the terms of the Parity Bug Bounty Program. A detailed description on eligibility, rewards, legal information and terms & conditions for contributors can be found on [our website](https://paritytech.io/bug-bounty.html). +Our Bug Bounty Program allows us to recognize and reward members of the Parity community for helping us find and address significant bugs, in accordance with the terms of the Parity Bug Bounty Program. A detailed description on eligibility, rewards, legal information and terms & conditions for contributors can be found on [our website](https://paritytech.io/bug-bounty.html). diff --git a/substrate/docs/Structure.adoc b/substrate/docs/Structure.adoc index cb0e4b28cb..c8cd63506a 100644 --- a/substrate/docs/Structure.adoc +++ b/substrate/docs/Structure.adoc @@ -67,7 +67,7 @@ There are a few crates with the `frame-` prefix. These do not contain domain-spe ** only helpers may be published ** purely testing crates must be `publish = false` -All tests that have to pull (dev)-dependencies out of their subtree and would thus break the dependency rules are considered intergration tests and should be stored in here. Only helper-crates in here shall be published, everything else is expected to be non-publish. +All tests that have to pull (dev)-dependencies out of their subtree and would thus break the dependency rules are considered integration tests and should be stored in here. Only helper-crates in here shall be published, everything else is expected to be non-publish. === Binaries and template diff --git a/substrate/frame/balances/src/lib.rs b/substrate/frame/balances/src/lib.rs index fc2294dd51..2c8ae3e18f 100644 --- a/substrate/frame/balances/src/lib.rs +++ b/substrate/frame/balances/src/lib.rs @@ -1224,7 +1224,7 @@ impl, I: Instance> ReservableCurrency for Module 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 }) diff --git a/substrate/frame/collective/src/lib.rs b/substrate/frame/collective/src/lib.rs index e9e6c75b83..a3ea901a6f 100644 --- a/substrate/frame/collective/src/lib.rs +++ b/substrate/frame/collective/src/lib.rs @@ -15,7 +15,7 @@ // along with Substrate. If not, see . //! 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` diff --git a/substrate/frame/contracts/COMPLEXITY.md b/substrate/frame/contracts/COMPLEXITY.md index a29127f778..e44d3006c8 100644 --- a/substrate/frame/contracts/COMPLEXITY.md +++ b/substrate/frame/contracts/COMPLEXITY.md @@ -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. diff --git a/substrate/frame/contracts/common/src/lib.rs b/substrate/frame/contracts/common/src/lib.rs index e54b4c8d55..6a74a417fa 100644 --- a/substrate/frame/contracts/common/src/lib.rs +++ b/substrate/frame/contracts/common/src/lib.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -//! 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)] diff --git a/substrate/frame/contracts/rpc/runtime-api/src/lib.rs b/substrate/frame/contracts/rpc/runtime-api/src/lib.rs index fd83ba6534..6fb629b024 100644 --- a/substrate/frame/contracts/rpc/runtime-api/src/lib.rs +++ b/substrate/frame/contracts/rpc/runtime-api/src/lib.rs @@ -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. diff --git a/substrate/frame/contracts/rpc/src/lib.rs b/substrate/frame/contracts/rpc/src/lib.rs index b0d6037416..52dddb177b 100644 --- a/substrate/frame/contracts/rpc/src/lib.rs +++ b/substrate/frame/contracts/rpc/src/lib.rs @@ -138,7 +138,7 @@ pub trait ContractsApi { /// 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. diff --git a/substrate/frame/contracts/src/exec.rs b/substrate/frame/contracts/src/exec.rs index ec9fad93b4..53a6c484fc 100644 --- a/substrate/frame/contracts/src/exec.rs +++ b/substrate/frame/contracts/src/exec.rs @@ -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(); diff --git a/substrate/frame/contracts/src/lib.rs b/substrate/frame/contracts/src/lib.rs index 19e070bd03..42cbaa3a7c 100644 --- a/substrate/frame/contracts/src/lib.rs +++ b/substrate/frame/contracts/src/lib.rs @@ -143,7 +143,7 @@ pub trait ComputeDispatchFee { 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 { @@ -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(PhantomData); -impl ContractAddressFor, T::AccountId> for SimpleAddressDeterminator +pub struct SimpleAddressDeterminer(PhantomData); +impl ContractAddressFor, T::AccountId> for SimpleAddressDeterminer where T::AccountId: UncheckedFrom + AsRef<[u8]> { @@ -494,7 +494,7 @@ decl_module! { /// The minimum amount required to generate a tombstone. const TombstoneDeposit: BalanceOf = 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(); diff --git a/substrate/frame/contracts/src/rent.rs b/substrate/frame/contracts/src/rent.rs index 49beebbf0c..8b6825419c 100644 --- a/substrate/frame/contracts/src/rent.rs +++ b/substrate/frame/contracts/src/rent.rs @@ -327,7 +327,7 @@ pub fn snitch_contract_should_be_evicted( } /// 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. /// diff --git a/substrate/frame/contracts/src/tests.rs b/substrate/frame/contracts/src/tests.rs index 0062e2bbd4..ddd532334c 100644 --- a/substrate/frame/contracts/src/tests.rs +++ b/substrate/frame/contracts/src/tests.rs @@ -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::(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 ) diff --git a/substrate/frame/contracts/src/wasm/runtime.rs b/substrate/frame/contracts/src/wasm/runtime.rs index b6a8928180..a84556d884 100644 --- a/substrate/frame/contracts/src/wasm/runtime.rs +++ b/substrate/frame/contracts/src/wasm/runtime.rs @@ -716,10 +716,10 @@ define_env!(Env, , // 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 diff --git a/substrate/frame/democracy/src/lib.rs b/substrate/frame/democracy/src/lib.rs index 33ddf69427..c2c44918b0 100644 --- a/substrate/frame/democracy/src/lib.rs +++ b/substrate/frame/democracy/src/lib.rs @@ -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); diff --git a/substrate/frame/elections/src/lib.rs b/substrate/frame/elections/src/lib.rs index a3fdd74426..95d1858476 100644 --- a/substrate/frame/elections/src/lib.rs +++ b/substrate/frame/elections/src/lib.rs @@ -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. diff --git a/substrate/frame/evm/src/backend.rs b/substrate/frame/evm/src/backend.rs index b6c3078a33..d72c8b785e 100644 --- a/substrate/frame/evm/src/backend.rs +++ b/substrate/frame/evm/src/backend.rs @@ -29,7 +29,7 @@ pub struct Log { pub address: H160, /// Topics of the log. pub topics: Vec, - /// Bytearray data of the log. + /// Byte array data of the log. pub data: Vec, } diff --git a/substrate/frame/evm/src/lib.rs b/substrate/frame/evm/src/lib.rs index a12d06c69b..abf20114f2 100644 --- a/substrate/frame/evm/src/lib.rs +++ b/substrate/frame/evm/src/lib.rs @@ -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) { let sender = ensure_signed(origin)?; diff --git a/substrate/frame/example/src/lib.rs b/substrate/frame/example/src/lib.rs index fb8a162d41..dbdc2efcf8 100644 --- a/substrate/frame/example/src/lib.rs +++ b/substrate/frame/example/src/lib.rs @@ -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 //! Generic example of annotating source code with documentation comments @@ -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 Module { // 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. diff --git a/substrate/frame/generic-asset/src/lib.rs b/substrate/frame/generic-asset/src/lib.rs index 59535de447..233054dd9d 100644 --- a/substrate/frame/generic-asset/src/lib.rs +++ b/substrate/frame/generic-asset/src/lib.rs @@ -208,7 +208,7 @@ impl Subtrait for T { /// Asset creation options. #[derive(Clone, Encode, Decode, PartialEq, Eq, RuntimeDebug)] pub struct AssetOptions { - /// 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::{ diff --git a/substrate/frame/generic-asset/src/tests.rs b/substrate/frame/generic-asset/src/tests.rs index ad8fc2bf1b..d5c0a877df 100644 --- a/substrate/frame/generic-asset/src/tests.rs +++ b/substrate/frame/generic-asset/src/tests.rs @@ -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); diff --git a/substrate/frame/grandpa/src/lib.rs b/substrate/frame/grandpa/src/lib.rs index 6164e5ab4b..6d3223f094 100644 --- a/substrate/frame/grandpa/src/lib.rs +++ b/substrate/frame/grandpa/src/lib.rs @@ -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 pallet_session::OneSessionHandler for Module where I: Iterator { // 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::>(); diff --git a/substrate/frame/identity/src/lib.rs b/substrate/frame/identity/src/lib.rs index 5470e3d4b0..341356394d 100644 --- a/substrate/frame/identity/src/lib.rs +++ b/substrate/frame/identity/src/lib.rs @@ -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. diff --git a/substrate/frame/im-online/src/lib.rs b/substrate/frame/im-online/src/lib.rs index 9a3fc2430c..a050ad3d8a 100644 --- a/substrate/frame/im-online/src/lib.rs +++ b/substrate/frame/im-online/src/lib.rs @@ -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; @@ -369,7 +369,7 @@ decl_module! { type OffchainResult = Result::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 pallet_authorship::EventHandler for Module { fn note_author(author: T::ValidatorId) { Self::note_authorship(author); @@ -576,7 +576,7 @@ impl pallet_session::OneSessionHandler for Module { { // 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 = >::block_number(); let half_session = T::SessionDuration::get() / 2.into(); >::put(block_number + half_session); diff --git a/substrate/frame/im-online/src/tests.rs b/substrate/frame/im-online/src/tests.rs index adc126094b..808978d403 100644 --- a/substrate/frame/im-online/src/tests.rs +++ b/substrate/frame/im-online/src/tests.rs @@ -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(); diff --git a/substrate/frame/indices/src/lib.rs b/substrate/frame/indices/src/lib.rs index ad1a7f300f..d59a501793 100644 --- a/substrate/frame/indices/src/lib.rs +++ b/substrate/frame/indices/src/lib.rs @@ -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_. /// diff --git a/substrate/frame/membership/src/lib.rs b/substrate/frame/membership/src/lib.rs index 62d1315ee2..c275bb783b 100644 --- a/substrate/frame/membership/src/lib.rs +++ b/substrate/frame/membership/src/lib.rs @@ -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; diff --git a/substrate/frame/metadata/src/lib.rs b/substrate/frame/metadata/src/lib.rs index a7410bbfbc..5ecb9f3443 100644 --- a/substrate/frame/metadata/src/lib.rs +++ b/substrate/frame/metadata/src/lib.rs @@ -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`. diff --git a/substrate/frame/nicks/src/lib.rs b/substrate/frame/nicks/src/lib.rs index 6a86f08093..16797ffdef 100644 --- a/substrate/frame/nicks/src/lib.rs +++ b/substrate/frame/nicks/src/lib.rs @@ -104,7 +104,7 @@ decl_error! { TooShort, /// A name is too long. TooLong, - /// An account in't named. + /// An account isn't named. Unnamed, } } diff --git a/substrate/frame/offences/src/lib.rs b/substrate/frame/offences/src/lib.rs index ea6f96cbc3..7831ba65a3 100644 --- a/substrate/frame/offences/src/lib.rs +++ b/substrate/frame/offences/src/lib.rs @@ -187,7 +187,7 @@ struct TriageOutcome { concurrent_offenders: Vec>, } -/// 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 diff --git a/substrate/frame/offences/src/tests.rs b/substrate/frame/offences/src/tests.rs index 703361f77f..f2f82cf7a8 100644 --- a/substrate/frame/offences/src/tests.rs +++ b/substrate/frame/offences/src/tests.rs @@ -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); diff --git a/substrate/frame/randomness-collective-flip/src/lib.rs b/substrate/frame/randomness-collective-flip/src/lib.rs index 64d8f40099..53d640688e 100644 --- a/substrate/frame/randomness-collective-flip/src/lib.rs +++ b/substrate/frame/randomness-collective-flip/src/lib.rs @@ -135,7 +135,7 @@ impl Randomness for Module { let hash_series = >::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(); diff --git a/substrate/frame/recovery/src/lib.rs b/substrate/frame/recovery/src/lib.rs index d293e1da9a..b456d17c68 100644 --- a/substrate/frame/recovery/src/lib.rs +++ b/substrate/frame/recovery/src/lib.rs @@ -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 diff --git a/substrate/frame/recovery/src/tests.rs b/substrate/frame/recovery/src/tests.rs index af4eadb58f..97d4791cce 100644 --- a/substrate/frame/recovery/src/tests.rs +++ b/substrate/frame/recovery/src/tests.rs @@ -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; diff --git a/substrate/frame/scored-pool/src/mock.rs b/substrate/frame/scored-pool/src/mock.rs index 38a01a69af..cccb3c2b4c 100644 --- a/substrate/frame/scored-pool/src/mock.rs +++ b/substrate/frame/scored-pool/src/mock.rs @@ -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, }; diff --git a/substrate/frame/session/src/lib.rs b/substrate/frame/session/src/lib.rs index a18d55d26c..5226415400 100644 --- a/substrate/frame/session/src/lib.rs +++ b/substrate/frame/session/src/lib.rs @@ -168,7 +168,7 @@ impl SessionManager for () { fn end_session(_: SessionIndex) {} } -/// Handler for session lifecycle events. +/// Handler for session life cycle events. pub trait SessionHandler { /// All the key type ids this session handler can process. /// diff --git a/substrate/frame/society/src/lib.rs b/substrate/frame/society/src/lib.rs index e803e54d4f..38dc491b80 100644 --- a/substrate/frame/society/src/lib.rs +++ b/substrate/frame/society/src/lib.rs @@ -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 diff --git a/substrate/frame/society/src/mock.rs b/substrate/frame/society/src/mock.rs index 081d68ada4..84b2343fae 100644 --- a/substrate/frame/society/src/mock.rs +++ b/substrate/frame/society/src/mock.rs @@ -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, diff --git a/substrate/frame/society/src/tests.rs b/substrate/frame/society/src/tests.rs index 47d13d8361..8b10dc32e7 100644 --- a/substrate/frame/society/src/tests.rs +++ b/substrate/frame/society/src/tests.rs @@ -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)); diff --git a/substrate/frame/staking/reward-curve/src/lib.rs b/substrate/frame/staking/reward-curve/src/lib.rs index 3c31cecc21..51af0a33a3 100644 --- a/substrate/frame/staking/reward-curve/src/lib.rs +++ b/substrate/frame/staking/reward-curve/src/lib.rs @@ -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); diff --git a/substrate/frame/staking/src/inflation.rs b/substrate/frame/staking/src/inflation.rs index d5135fcc1f..e75ac3af2b 100644 --- a/substrate/frame/staking/src/inflation.rs +++ b/substrate/frame/staking/src/inflation.rs @@ -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( diff --git a/substrate/frame/staking/src/lib.rs b/substrate/frame/staking/src/lib.rs index 447f655048..3f84597912 100644 --- a/substrate/frame/staking/src/lib.rs +++ b/substrate/frame/staking/src/lib.rs @@ -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 Module { 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> { // note: `CurrentEraStart` is set in `on_finalize` of the first block because now is not // available yet. diff --git a/substrate/frame/staking/src/tests.rs b/substrate/frame/staking/src/tests.rs index 73f1afd634..73215d6117 100644 --- a/substrate/frame/staking/src/tests.rs +++ b/substrate/frame/staking/src/tests.rs @@ -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 >::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 >::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 >::reward_by_ids(vec![(41, 1)]); >::reward_by_ids(vec![(31, 1)]); >::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 >::reward_by_ids(vec![(41, 10)]); // must be no-op >::reward_by_ids(vec![(31, 10)]); // must be no-op >::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 >::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 >::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 >::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 >::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 >::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 >::reward_by_ids(vec![(11, 1)]); >::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); diff --git a/substrate/frame/support/procedural/src/construct_runtime/parse.rs b/substrate/frame/support/procedural/src/construct_runtime/parse.rs index b7d60c7155..4a81a7efd6 100644 --- a/substrate/frame/support/procedural/src/construct_runtime/parse.rs +++ b/substrate/frame/support/procedural/src/construct_runtime/parse.rs @@ -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)); diff --git a/substrate/frame/support/procedural/src/lib.rs b/substrate/frame/support/procedural/src/lib.rs index c59d630928..8849e52c79 100644 --- a/substrate/frame/support/procedural/src/lib.rs +++ b/substrate/frame/support/procedural/src/lib.rs @@ -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}, /// ..., diff --git a/substrate/frame/support/procedural/src/storage/genesis_config/genesis_config_def.rs b/substrate/frame/support/procedural/src/storage/genesis_config/genesis_config_def.rs index 100907b292..ae7ffa64bf 100644 --- a/substrate/frame/support/procedural/src/storage/genesis_config/genesis_config_def.rs +++ b/substrate/frame/support/procedural/src/storage/genesis_config/genesis_config_def.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -//! Genesis config defintion. +//! Genesis config definition. use frame_support_procedural_tools::syn_ext as ext; use proc_macro2::TokenStream; diff --git a/substrate/frame/support/procedural/src/storage/mod.rs b/substrate/frame/support/procedural/src/storage/mod.rs index 453cb9c467..3345c5a123 100644 --- a/substrate/frame/support/procedural/src/storage/mod.rs +++ b/substrate/frame/support/procedural/src/storage/mod.rs @@ -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, @@ -219,9 +219,9 @@ pub struct StorageLineDefExt { storage_trait: proc_macro2::TokenStream, /// Full trait, for example: `storage::generator::StorageMap`. 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()) diff --git a/substrate/frame/support/procedural/tools/src/syn_ext.rs b/substrate/frame/support/procedural/tools/src/syn_ext.rs index 7b0a2cb93f..4577437232 100644 --- a/substrate/frame/support/procedural/tools/src/syn_ext.rs +++ b/substrate/frame/support/procedural/tools/src/syn_ext.rs @@ -180,7 +180,7 @@ pub fn extract_type_option(typ: &syn::Type) -> Option { 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, diff --git a/substrate/frame/support/src/debug.rs b/substrate/frame/support/src/debug.rs index 29847b70e5..4b7ff6cc39 100644 --- a/substrate/frame/support/src/debug.rs +++ b/substrate/frame/support/src/debug.rs @@ -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 diff --git a/substrate/frame/support/src/dispatch.rs b/substrate/frame/support/src/dispatch.rs index c2f42fd561..2a3e638de3 100644 --- a/substrate/frame/support/src/dispatch.rs +++ b/substrate/frame/support/src/dispatch.rs @@ -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 )* ) diff --git a/substrate/frame/support/src/error.rs b/substrate/frame/support/src/error.rs index 34de38108f..3b105e979d 100644 --- a/substrate/frame/support/src/error.rs +++ b/substrate/frame/support/src/error.rs @@ -28,7 +28,7 @@ pub use frame_metadata::{ModuleErrorMetadata, ErrorMetadata, DecodeDifferent}; /// implements `From 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 diff --git a/substrate/frame/support/src/event.rs b/substrate/frame/support/src/event.rs index d30e6ddeea..8b7de01159 100644 --- a/substrate/frame/support/src/event.rs +++ b/substrate/frame/support/src/event.rs @@ -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 where ::Balance, ::Origin, diff --git a/substrate/frame/support/src/storage/child.rs b/substrate/frame/support/src/storage/child.rs index f549ffc25f..d4d046a9d4 100644 --- a/substrate/frame/support/src/storage/child.rs +++ b/substrate/frame/support/src/storage/child.rs @@ -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::*; diff --git a/substrate/frame/support/src/weights.rs b/substrate/frame/support/src/weights.rs index 34166c368c..60f0d4a8b2 100644 --- a/substrate/frame/support/src/weights.rs +++ b/substrate/frame/support/src/weights.rs @@ -67,7 +67,7 @@ pub trait ClassifyDispatch { 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 { /// Return the weight of the block's on_initialize hook. diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/abundant_where_param.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/abundant_where_param.stderr index 4bac57d63c..b622adbfe6 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/abundant_where_param.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/abundant_where_param.stderr @@ -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, diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/invalid_where_param.rs b/substrate/frame/support/test/tests/construct_runtime_ui/invalid_where_param.rs index 13536338e0..dc1dc430ed 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/invalid_where_param.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/invalid_where_param.rs @@ -5,7 +5,7 @@ construct_runtime! { Block = Block, NodeBlock = Block, TypeX = Block, - UnchekcedExtrinsic = UnchekcedExtrinsic, + UncheckedExtrinsic = UncheckedExtrinsic, {} } diff --git a/substrate/frame/support/test/tests/instance.rs b/substrate/frame/support/test/tests/instance.rs index 48854baad9..6fa2806dd3 100644 --- a/substrate/frame/support/test/tests/instance.rs +++ b/substrate/frame/support/test/tests/instance.rs @@ -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() diff --git a/substrate/frame/system/src/lib.rs b/substrate/frame/system/src/lib.rs index c351020a41..57be7b157c 100644 --- a/substrate/frame/system/src/lib.rs +++ b/substrate/frame/system/src/lib.rs @@ -720,7 +720,7 @@ impl Module { /// 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) { diff --git a/substrate/frame/system/src/offchain.rs b/substrate/frame/system/src/offchain.rs index b26f4be4b4..507092f626 100644 --- a/substrate/frame/system/src/offchain.rs +++ b/substrate/frame/system/src/offchain.rs @@ -68,7 +68,7 @@ pub trait Signer { /// 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 Signer for TAnyAppPublic where diff --git a/substrate/frame/treasury/src/lib.rs b/substrate/frame/treasury/src/lib.rs index 36f92c401e..192dd1aff6 100644 --- a/substrate/frame/treasury/src/lib.rs +++ b/substrate/frame/treasury/src/lib.rs @@ -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::::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::::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::().unwrap(); pallet_balances::GenesisConfig::{ balances: vec![(0, 100), (1, 99), (2, 1)], diff --git a/substrate/frame/utility/src/lib.rs b/substrate/frame/utility/src/lib.rs index 414651659c..c19b044ad7 100644 --- a/substrate/frame/utility/src/lib.rs +++ b/substrate/frame/utility/src/lib.rs @@ -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 { - /// 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 PaysFee<(&u16, &Box)> for Passthrough { } } -/// 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(sp_std::marker::PhantomData); diff --git a/substrate/primitives/allocator/src/freeing_bump.rs b/substrate/primitives/allocator/src/freeing_bump.rs index caac9dd6c4..0d15ed11f7 100644 --- a/substrate/primitives/allocator/src/freeing_bump.rs +++ b/substrate/primitives/allocator/src/freeing_bump.rs @@ -37,7 +37,7 @@ //! allocation size is capped, therefore the number of orders and thus the linked lists is as well //! limited. //! -//! When the allocater serves an allocation request it first checks the linked list for the respective +//! When the allocator serves an allocation request it first checks the linked list for the respective //! order. If it doesn't have any free chunks, the allocator requests memory from the bump allocator. //! In any case the order is stored in the header of the allocation. //! @@ -48,7 +48,7 @@ use crate::Error; use sp_std::{convert::{TryFrom, TryInto}, ops::{Range, Index, IndexMut}}; use sp_wasm_interface::{Pointer, WordSize}; -/// The minimal alignment guaranteed by this allocator. The alignment of 8 is choosen because it is +/// The minimal alignment guaranteed by this allocator. The alignment of 8 is chosen because it is /// the alignment guaranteed by wasm32. const ALIGNMENT: u32 = 8; diff --git a/substrate/primitives/arithmetic/fuzzer/src/biguint.rs b/substrate/primitives/arithmetic/fuzzer/src/biguint.rs index 1e2ec2a502..f217b080d2 100644 --- a/substrate/primitives/arithmetic/fuzzer/src/biguint.rs +++ b/substrate/primitives/arithmetic/fuzzer/src/biguint.rs @@ -22,7 +22,7 @@ //! Once a panic is found, it can be debugged with //! `cargo hfuzz run-debug biguint hfuzz_workspace/biguint/*.fuzz`. //! -//! # More infomation +//! # More information //! More information about `honggfuzz` can be found //! [here](https://docs.rs/honggfuzz/). diff --git a/substrate/primitives/arithmetic/fuzzer/src/rational128.rs b/substrate/primitives/arithmetic/fuzzer/src/rational128.rs index 60aa315c18..586a165272 100644 --- a/substrate/primitives/arithmetic/fuzzer/src/rational128.rs +++ b/substrate/primitives/arithmetic/fuzzer/src/rational128.rs @@ -22,7 +22,7 @@ //! Once a panic is found, it can be debugged with //! `cargo hfuzz run-debug rational128 hfuzz_workspace/rational128/*.fuzz`. //! -//! # More infomation +//! # More information //! More information about `honggfuzz` can be found //! [here](https://docs.rs/honggfuzz/). diff --git a/substrate/primitives/block-builder/src/lib.rs b/substrate/primitives/block-builder/src/lib.rs index d963fb7e30..f050979bd8 100644 --- a/substrate/primitives/block-builder/src/lib.rs +++ b/substrate/primitives/block-builder/src/lib.rs @@ -26,7 +26,7 @@ use sp_inherents::{InherentData, CheckInherentsResult}; /// /// These definitions are taken from the 2c58e30246a029b53d51e5b24c31974ac539ee8b git revision. #[deprecated(note = "These definitions here are only for compatibility reasons")] -pub mod compatability_v3 { +pub mod compatibility_v3 { use sp_runtime::{DispatchOutcome, transaction_validity}; use codec::{Encode, Decode}; @@ -51,7 +51,7 @@ sp_api::decl_runtime_apis! { #[changed_in(4)] #[allow(deprecated)] fn apply_extrinsic(extrinsic: ::Extrinsic) - -> self::compatability_v3::ApplyResult; + -> self::compatibility_v3::ApplyResult; /// Apply the given extrinsic. /// diff --git a/substrate/primitives/blockchain/src/error.rs b/substrate/primitives/blockchain/src/error.rs index 24872448ab..ece20d1cf8 100644 --- a/substrate/primitives/blockchain/src/error.rs +++ b/substrate/primitives/blockchain/src/error.rs @@ -20,7 +20,7 @@ use std::{self, error, result}; use sp_state_machine; use sp_runtime::transaction_validity::TransactionValidityError; #[allow(deprecated)] -use sp_block_builder::compatability_v3; +use sp_block_builder::compatibility_v3; use sp_consensus; use derive_more::{Display, From}; use codec::Error as CodecError; @@ -37,7 +37,7 @@ pub enum ApplyExtrinsicFailed { /// unappliable onto the current block. #[display(fmt = "Extrinsic is not valid: {:?}", _0)] Validity(TransactionValidityError), - /// This is used for miscelanious errors that can be represented by string and not handleable. + /// This is used for miscellaneous errors that can be represented by string and not handleable. /// /// This will become obsolete with complete migration to v4 APIs. #[display(fmt = "Extrinsic failed: {:?}", _0)] @@ -151,9 +151,9 @@ impl<'a> From<&'a str> for Error { } #[allow(deprecated)] -impl From for ApplyExtrinsicFailed { - fn from(e: compatability_v3::ApplyError) -> Self { - use self::compatability_v3::ApplyError::*; +impl From for ApplyExtrinsicFailed { + fn from(e: compatibility_v3::ApplyError) -> Self { + use self::compatibility_v3::ApplyError::*; match e { Validity(tx_validity) => Self::Validity(tx_validity), e => Self::Msg(format!("Apply extrinsic failed: {:?}", e)), diff --git a/substrate/primitives/blockchain/src/lib.rs b/substrate/primitives/blockchain/src/lib.rs index 21c5bc99d2..8f83c7aec5 100644 --- a/substrate/primitives/blockchain/src/lib.rs +++ b/substrate/primitives/blockchain/src/lib.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -//! Substrate blockchain traits and primtives +//! Substrate blockchain traits and primitives. mod backend; mod header_metadata; diff --git a/substrate/primitives/consensus/common/src/block_import.rs b/substrate/primitives/consensus/common/src/block_import.rs index 76655acbd6..3000477ded 100644 --- a/substrate/primitives/consensus/common/src/block_import.rs +++ b/substrate/primitives/consensus/common/src/block_import.rs @@ -229,7 +229,7 @@ impl BlockImportParams { } } - /// Take interemdiate by given key, and remove it from the processing list. + /// Take intermediate by given key, and remove it from the processing list. pub fn take_intermediate(&mut self, key: &[u8]) -> Result, Error> { let (k, v) = self.intermediates.remove_entry(key).ok_or(Error::NoIntermediate)?; diff --git a/substrate/primitives/consensus/common/src/error.rs b/substrate/primitives/consensus/common/src/error.rs index c802831d65..d7e396223a 100644 --- a/substrate/primitives/consensus/common/src/error.rs +++ b/substrate/primitives/consensus/common/src/error.rs @@ -37,7 +37,7 @@ pub enum Error { /// Intermediate is of wrong type. #[display(fmt="Invalid intermediate.")] InvalidIntermediate, - /// Unable to schedule wakeup. + /// Unable to schedule wake-up. #[display(fmt="Timer error: {}", _0)] FaultyTimer(std::io::Error), /// Error while working with inherent data. diff --git a/substrate/primitives/consensus/common/src/import_queue/basic_queue.rs b/substrate/primitives/consensus/common/src/import_queue/basic_queue.rs index bd42ebd685..0d1aed7fb1 100644 --- a/substrate/primitives/consensus/common/src/import_queue/basic_queue.rs +++ b/substrate/primitives/consensus/common/src/import_queue/basic_queue.rs @@ -29,7 +29,7 @@ use crate::import_queue::{ }; /// Interface to a basic block import queue that is importing blocks sequentially in a separate -/// task, with pluggable verification. +/// task, with plugable verification. pub struct BasicQueue { /// Channel to send messages to the background task. sender: mpsc::UnboundedSender>, diff --git a/substrate/primitives/consensus/common/src/select_chain.rs b/substrate/primitives/consensus/common/src/select_chain.rs index 3ce2c6ccd0..d94511c110 100644 --- a/substrate/primitives/consensus/common/src/select_chain.rs +++ b/substrate/primitives/consensus/common/src/select_chain.rs @@ -22,16 +22,16 @@ use sp_runtime::traits::{Block as BlockT, NumberFor}; /// if multiple forks are present for an opaque definition of "best" in the /// specific chain build. /// -/// The Strategy can be customised for the two use cases of authoring new blocks +/// The Strategy can be customized for the two use cases of authoring new blocks /// upon the best chain or which fork to finalise. Unless implemented differently -/// by default finalisation methods fall back to use authoring, so as a minimum +/// by default finalization methods fall back to use authoring, so as a minimum /// `_authoring`-functions must be implemented. /// /// Any particular user must make explicit, however, whether they intend to finalise /// or author through the using the right function call, as these might differ in /// some implementations. /// -/// Non-deterministicly finalising chains may only use the `_authoring` functions. +/// Non-deterministically finalizing chains may only use the `_authoring` functions. pub trait SelectChain: Sync + Send + Clone { /// Get all leaves of the chain: block hashes that have no children currently. diff --git a/substrate/primitives/core/src/crypto.rs b/substrate/primitives/core/src/crypto.rs index 5ad5e19813..3833c8a912 100644 --- a/substrate/primitives/core/src/crypto.rs +++ b/substrate/primitives/core/src/crypto.rs @@ -882,7 +882,7 @@ pub trait CryptoType { /// An identifier for a type of cryptographic key. /// -/// To avoid clashes with other modules when distributing your module publically, register your +/// To avoid clashes with other modules when distributing your module publicly, register your /// `KeyTypeId` on the list here by making a PR. /// /// Values whose first character is `_` are reserved for private use and won't conflict with any diff --git a/substrate/primitives/core/src/ed25519.rs b/substrate/primitives/core/src/ed25519.rs index f3aba47c20..5e04dcceff 100644 --- a/substrate/primitives/core/src/ed25519.rs +++ b/substrate/primitives/core/src/ed25519.rs @@ -433,7 +433,7 @@ impl TraitPair for Pair { /// Make a new key pair from secret seed material. /// - /// You should never need to use this; generate(), generate_with_phrasee + /// You should never need to use this; generate(), generate_with_phrase fn from_seed(seed: &Seed) -> Pair { Self::from_seed_slice(&seed[..]).expect("seed has valid length; qed") } diff --git a/substrate/primitives/core/src/lib.rs b/substrate/primitives/core/src/lib.rs index b1a5916c92..f8c48ee970 100644 --- a/substrate/primitives/core/src/lib.rs +++ b/substrate/primitives/core/src/lib.rs @@ -201,7 +201,7 @@ impl PartialEq for NativeOrEncoded { } /// A value that is never in a native representation. -/// This is type is useful in conjuction with `NativeOrEncoded`. +/// This is type is useful in conjunction with `NativeOrEncoded`. #[cfg(feature = "std")] #[derive(PartialEq)] pub enum NeverNativeValue {} diff --git a/substrate/primitives/core/src/offchain/mod.rs b/substrate/primitives/core/src/offchain/mod.rs index 425957a21f..c393b0f9f8 100644 --- a/substrate/primitives/core/src/offchain/mod.rs +++ b/substrate/primitives/core/src/offchain/mod.rs @@ -135,7 +135,7 @@ pub enum HttpRequestStatus { /// Note the deadline is controlled by the calling part, it not necessarily /// means that the request has timed out. DeadlineReached, - /// An error has occured during the request, for example a timeout or the + /// An error has occurred during the request, for example a timeout or the /// remote has closed our socket. /// /// The request is now considered destroyed. To retry the request you need @@ -226,7 +226,7 @@ impl Duration { } impl Timestamp { - /// Creates new `Timestamp` given unix timestamp in miliseconds. + /// Creates new `Timestamp` given unix timestamp in milliseconds. pub fn from_unix_millis(millis: u64) -> Self { Timestamp(millis) } @@ -335,7 +335,7 @@ pub trait Externalities: Send { /// Returns a random seed. /// - /// This is a trully random non deterministic seed generated by host environment. + /// This is a truly random non deterministic seed generated by host environment. /// Obviously fine in the off-chain worker context. fn random_seed(&mut self) -> [u8; 32]; diff --git a/substrate/primitives/core/src/testing.rs b/substrate/primitives/core/src/testing.rs index 0def3454bc..247323f970 100644 --- a/substrate/primitives/core/src/testing.rs +++ b/substrate/primitives/core/src/testing.rs @@ -245,7 +245,7 @@ mod tests { let public = store.write() .ed25519_generate_new(ED25519, None) - .expect("Genrates key"); + .expect("Generates key"); let store_key_pair = store.read() .ed25519_key_pair(ED25519, &public) diff --git a/substrate/primitives/externalities/src/lib.rs b/substrate/primitives/externalities/src/lib.rs index 75193a4b9c..431e449846 100644 --- a/substrate/primitives/externalities/src/lib.rs +++ b/substrate/primitives/externalities/src/lib.rs @@ -196,7 +196,7 @@ pub trait Externalities: ExtensionStore { ) -> Vec; /// Get the change trie root of the current storage overlay at a block with given parent. - /// `parent` is expects a SCALE endcoded hash. + /// `parent` is expects a SCALE encoded hash. /// /// The hash is defined by the `Block`. /// diff --git a/substrate/primitives/finality-grandpa/src/lib.rs b/substrate/primitives/finality-grandpa/src/lib.rs index 205fce0ce3..9dcb1c2363 100644 --- a/substrate/primitives/finality-grandpa/src/lib.rs +++ b/substrate/primitives/finality-grandpa/src/lib.rs @@ -164,7 +164,7 @@ pub const AUTHORITIES_CALL: &str = "grandpa_authorities"; /// The current version of the stored AuthorityList type. The encoding version MUST be updated any /// time the AuthorityList type changes. -const AUTHORITIES_VERISON: u8 = 1; +const AUTHORITIES_VERSION: u8 = 1; /// An AuthorityList that is encoded with a version specifier. The encoding version is updated any /// time the AuthorityList type changes. This ensures that encodings of different versions of an @@ -193,18 +193,18 @@ impl<'a> Into for VersionedAuthorityList<'a> { impl<'a> Encode for VersionedAuthorityList<'a> { fn size_hint(&self) -> usize { - (AUTHORITIES_VERISON, self.0.as_ref()).size_hint() + (AUTHORITIES_VERSION, self.0.as_ref()).size_hint() } fn using_encoded R>(&self, f: F) -> R { - (AUTHORITIES_VERISON, self.0.as_ref()).using_encoded(f) + (AUTHORITIES_VERSION, self.0.as_ref()).using_encoded(f) } } impl<'a> Decode for VersionedAuthorityList<'a> { fn decode(value: &mut I) -> Result { let (version, authorities): (u8, AuthorityList) = Decode::decode(value)?; - if version != AUTHORITIES_VERISON { + if version != AUTHORITIES_VERSION { return Err("unknown Grandpa authorities version".into()); } Ok(authorities.into()) diff --git a/substrate/primitives/inherents/src/lib.rs b/substrate/primitives/inherents/src/lib.rs index f1b8db982d..e8df2c49e5 100644 --- a/substrate/primitives/inherents/src/lib.rs +++ b/substrate/primitives/inherents/src/lib.rs @@ -312,7 +312,7 @@ impl InherentDataProviders { /// Converts a given encoded error into a `String`. /// - /// Useful if the implementation encouters an error for an identifier it does not know. + /// Useful if the implementation encounters an error for an identifier it does not know. pub fn error_to_string(&self, identifier: &InherentIdentifier, error: &[u8]) -> String { let res = self.providers.read().iter().filter_map(|p| if p.inherent_identifier() == identifier { diff --git a/substrate/primitives/io/src/lib.rs b/substrate/primitives/io/src/lib.rs index ce8a546e86..a1e9181f28 100644 --- a/substrate/primitives/io/src/lib.rs +++ b/substrate/primitives/io/src/lib.rs @@ -594,7 +594,7 @@ pub trait Offchain { /// Returns a random seed. /// - /// This is a trully random non deterministic seed generated by host environment. + /// This is a truly random, non-deterministic seed generated by host environment. /// Obviously fine in the off-chain worker context. fn random_seed(&mut self) -> [u8; 32] { self.extension::() diff --git a/substrate/primitives/rpc/src/list.rs b/substrate/primitives/rpc/src/list.rs index b8b7c537c4..469eae3d14 100644 --- a/substrate/primitives/rpc/src/list.rs +++ b/substrate/primitives/rpc/src/list.rs @@ -23,7 +23,7 @@ use serde::{Serialize, Deserialize}; /// For some RPCs it's convenient to call them with either /// a single value or a whole list of values to get a proper response. /// In theory you could do a batch query, but it's: -/// 1. Less convient in client libraries +/// 1. Less convenient in client libraries /// 2. If the response value is small, the protocol overhead might be dominant. /// /// Also it's nice to be able to maintain backward compatibility for methods that diff --git a/substrate/primitives/runtime-interface/test-wasm/src/lib.rs b/substrate/primitives/runtime-interface/test-wasm/src/lib.rs index 467f58cb30..4e99c0f06c 100644 --- a/substrate/primitives/runtime-interface/test-wasm/src/lib.rs +++ b/substrate/primitives/runtime-interface/test-wasm/src/lib.rs @@ -25,7 +25,7 @@ use sp_std::{vec, vec::Vec, mem, convert::TryFrom}; use sp_core::{sr25519::Public, wasm_export_functions}; -// Inlucde the WASM binary +// Include the WASM binary #[cfg(feature = "std")] include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); diff --git a/substrate/primitives/runtime/src/curve.rs b/substrate/primitives/runtime/src/curve.rs index a230e2f32d..e04ce77fb2 100644 --- a/substrate/primitives/runtime/src/curve.rs +++ b/substrate/primitives/runtime/src/curve.rs @@ -65,7 +65,7 @@ impl<'a> PiecewiseLinear<'a> { next.0.deconstruct().saturating_sub(prev.0.deconstruct()), ); - // If both substration are same sign then result is positive + // If both subtractions are same sign then result is positive if (n > prev.0 * d.clone()) == (next.1.deconstruct() > prev.1.deconstruct()) { (prev.1 * d).saturating_add(delta_y) // Otherwise result is negative diff --git a/substrate/primitives/runtime/src/generic/digest.rs b/substrate/primitives/runtime/src/generic/digest.rs index 9d4fbe48d5..dad3e1fc26 100644 --- a/substrate/primitives/runtime/src/generic/digest.rs +++ b/substrate/primitives/runtime/src/generic/digest.rs @@ -365,7 +365,7 @@ impl<'a, Hash> DigestItemRef<'a, Hash> { } /// Try to match this digest item to the given opaque item identifier; if it matches, then - /// try to cast to the given datatype; if that works, return it. + /// try to cast to the given data type; if that works, return it. pub fn try_to(&self, id: OpaqueDigestItemId) -> Option { self.try_as_raw(id).and_then(|mut x| Decode::decode(&mut x).ok()) } diff --git a/substrate/primitives/runtime/src/lib.rs b/substrate/primitives/runtime/src/lib.rs index 517141a210..4d6739bb13 100644 --- a/substrate/primitives/runtime/src/lib.rs +++ b/substrate/primitives/runtime/src/lib.rs @@ -214,7 +214,7 @@ impl Default for MultiSigner { } } -/// NOTE: This implementations is required by `SimpleAddressDeterminator`, +/// NOTE: This implementations is required by `SimpleAddressDeterminer`, /// we convert the hash into some AccountId, it's fine to use any scheme. impl> crypto::UncheckedFrom for MultiSigner { fn unchecked_from(x: T) -> Self { @@ -458,7 +458,7 @@ pub type DispatchOutcome = Result<(), DispatchError>; /// /// Examples of reasons preventing inclusion in a block: /// - More block weight is required to process the extrinsic than is left in the block being built. -/// This doesn't neccessarily mean that the extrinsic is invalid, since it can still be +/// This doesn't necessarily mean that the extrinsic is invalid, since it can still be /// included in the next block if it has enough spare weight available. /// - The sender doesn't have enough funds to pay the transaction inclusion fee. Including such /// a transaction in the block doesn't make sense. diff --git a/substrate/primitives/runtime/src/offchain/http.rs b/substrate/primitives/runtime/src/offchain/http.rs index 50c4a5eae6..88f4323ad7 100644 --- a/substrate/primitives/runtime/src/offchain/http.rs +++ b/substrate/primitives/runtime/src/offchain/http.rs @@ -257,7 +257,7 @@ pub enum Error { DeadlineReached, /// Request had timed out. IoError, - /// Unknown error has been ecountered. + /// Unknown error has been encountered. Unknown, } diff --git a/substrate/primitives/runtime/src/offchain/storage.rs b/substrate/primitives/runtime/src/offchain/storage.rs index d5c2b47298..681bc14451 100644 --- a/substrate/primitives/runtime/src/offchain/storage.rs +++ b/substrate/primitives/runtime/src/offchain/storage.rs @@ -61,11 +61,11 @@ impl<'a> StorageValueRef<'a> { .map(|val| T::decode(&mut &*val).ok()) } - /// Retrieve & decode the value and set it to a new one atomicaly. + /// Retrieve & decode the value and set it to a new one atomically. /// /// Function `f` should return a new value that we should attempt to write to storage. /// This function returns: - /// 1. `Ok(Ok(T))` in case the value has been succesfuly set. + /// 1. `Ok(Ok(T))` in case the value has been successfully set. /// 2. `Ok(Err(T))` in case the value was returned, but it couldn't have been set. /// 3. `Err(_)` in case `f` returns an error. pub fn mutate(&self, f: F) -> Result, E> where diff --git a/substrate/primitives/runtime/src/traits.rs b/substrate/primitives/runtime/src/traits.rs index 4cb9cb3212..1b9b9eec70 100644 --- a/substrate/primitives/runtime/src/traits.rs +++ b/substrate/primitives/runtime/src/traits.rs @@ -955,7 +955,7 @@ pub trait ValidateUnsigned { fn validate_unsigned(call: &Self::Call) -> TransactionValidity; } -/// Opaque datatype that may be destructured into a series of raw byte slices (which represent +/// Opaque data type that may be destructured into a series of raw byte slices (which represent /// individual keys). pub trait OpaqueKeys: Clone { /// Types bound to this opaque keys that provide the key type ids returned. diff --git a/substrate/primitives/sandbox/src/lib.rs b/substrate/primitives/sandbox/src/lib.rs index e7cd684b45..1ef30ca5db 100755 --- a/substrate/primitives/sandbox/src/lib.rs +++ b/substrate/primitives/sandbox/src/lib.rs @@ -193,7 +193,7 @@ impl Instance { /// - This module doesn't have an exported function with the given name, /// - If types of the arguments passed to the function doesn't match function signature /// then trap occurs (as if the exported function was called via call_indirect), - /// - Trap occured at the execution time. + /// - Trap occurred at the execution time. pub fn invoke( &mut self, name: &str, diff --git a/substrate/primitives/state-machine/src/backend.rs b/substrate/primitives/state-machine/src/backend.rs index 396ef6575a..ca6612a5e9 100644 --- a/substrate/primitives/state-machine/src/backend.rs +++ b/substrate/primitives/state-machine/src/backend.rs @@ -209,7 +209,7 @@ pub trait Backend: std::fmt::Debug { /// Query backend usage statistics (i/o, memory) /// /// Not all implementations are expected to be able to do this. In the - /// case when thay don't, empty statistics is returned. + /// case when they don't, empty statistics is returned. fn usage_info(&self) -> UsageInfo { UsageInfo::empty() } diff --git a/substrate/primitives/state-machine/src/changes_trie/mod.rs b/substrate/primitives/state-machine/src/changes_trie/mod.rs index 12074b7261..d614992df3 100644 --- a/substrate/primitives/state-machine/src/changes_trie/mod.rs +++ b/substrate/primitives/state-machine/src/changes_trie/mod.rs @@ -16,7 +16,7 @@ //! Changes trie related structures and functions. //! -//! Changes trie is a trie built of { storage key => extrinsiscs } pairs +//! Changes trie is a trie built of { storage key => extrinsics } pairs //! at the end of each block. For every changed storage key it contains //! a pair, mapping key to the set of extrinsics where it has been changed. //! @@ -130,7 +130,7 @@ pub struct AnchorBlockId { pub struct State<'a, H, Number> { /// Configuration that is active at given block. pub config: Configuration, - /// Configuration activation block number. Zero if it is the first coonfiguration on the chain, + /// Configuration activation block number. Zero if it is the first configuration on the chain, /// or number of the block that have emit NewConfiguration signal (thus activating configuration /// starting from the **next** block). pub zero: Number, diff --git a/substrate/primitives/state-machine/src/lib.rs b/substrate/primitives/state-machine/src/lib.rs index bb62df6da4..bb2bb2c52c 100644 --- a/substrate/primitives/state-machine/src/lib.rs +++ b/substrate/primitives/state-machine/src/lib.rs @@ -377,7 +377,7 @@ impl<'a, B, H, N, Exec> StateMachine<'a, B, H, N, Exec> where /// Note: changes to code will be in place if this call is made again. For running partial /// blocks (e.g. a transaction at a time), ensure a different method is used. /// - /// Returns the result of the executed function either in native reprensentation `R` or + /// Returns the result of the executed function either in native representation `R` or /// in SCALE encoded representation. pub fn execute_using_consensus_failure_handler( &mut self, diff --git a/substrate/primitives/state-machine/src/overlayed_changes.rs b/substrate/primitives/state-machine/src/overlayed_changes.rs index 37187e163f..4eb44de7c5 100644 --- a/substrate/primitives/state-machine/src/overlayed_changes.rs +++ b/substrate/primitives/state-machine/src/overlayed_changes.rs @@ -55,7 +55,7 @@ pub struct OverlayedChanges { pub(crate) prospective: OverlayedChangeSet, /// Committed changes. pub(crate) committed: OverlayedChangeSet, - /// True if extrinsiscs stats must be collected. + /// True if extrinsics stats must be collected. pub(crate) collect_extrinsics: bool, } @@ -65,7 +65,7 @@ pub struct OverlayedChanges { pub struct OverlayedValue { /// Current value. None if value has been deleted. pub value: Option, - /// The set of extinsic indices where the values has been changed. + /// The set of extrinsic indices where the values has been changed. /// Is filled only if runtime has announced changes trie support. pub extrinsics: Option>, } @@ -371,7 +371,7 @@ impl OverlayedChanges { } if let Some((child_committed, _child_info)) = self.committed.children.get(storage_key) { - // Then do the same with keys from commited changes. + // Then do the same with keys from committed changes. // NOTE that we are making changes in the prospective change set. for key in child_committed.keys() { if key.starts_with(prefix) { diff --git a/substrate/primitives/state-machine/src/proving_backend.rs b/substrate/primitives/state-machine/src/proving_backend.rs index 70124927fd..672ec6ea79 100644 --- a/substrate/primitives/state-machine/src/proving_backend.rs +++ b/substrate/primitives/state-machine/src/proving_backend.rs @@ -436,7 +436,7 @@ mod tests { } #[test] - fn passes_throgh_backend_calls() { + fn passes_through_backend_calls() { let trie_backend = test_trie(); let proving_backend = test_proving(&trie_backend); assert_eq!(trie_backend.storage(b"key").unwrap(), proving_backend.storage(b"key").unwrap()); diff --git a/substrate/primitives/std/without_std.rs b/substrate/primitives/std/without_std.rs index 4424ca0e7d..6b28f66b43 100755 --- a/substrate/primitives/std/without_std.rs +++ b/substrate/primitives/std/without_std.rs @@ -35,7 +35,7 @@ pub use core::ops; pub use core::ptr; pub use core::result; pub use core::slice; -// Allow intepreting vectors of bytes as strings, but not constructing them. +// Allow interpreting vectors of bytes as strings, but not constructing them. pub use core::str; // We are trying to avoid certain things here, such as `core::string` // (if you need `String` you are probably doing something wrong, since diff --git a/substrate/primitives/transaction-pool/src/error.rs b/substrate/primitives/transaction-pool/src/error.rs index ecce202d7d..1a456ca4fd 100644 --- a/substrate/primitives/transaction-pool/src/error.rs +++ b/substrate/primitives/transaction-pool/src/error.rs @@ -52,7 +52,7 @@ pub enum Error { /// Transaction entering the pool. new: Priority }, - /// Deps cycle etected and we couldn't import transaction. + /// Deps cycle detected and we couldn't import transaction. #[display(fmt="Cycle Detected")] CycleDetected, /// Transaction was dropped immediately after it got inserted. diff --git a/substrate/primitives/transaction-pool/src/pool.rs b/substrate/primitives/transaction-pool/src/pool.rs index 8d8ff47cbe..89f327a523 100644 --- a/substrate/primitives/transaction-pool/src/pool.rs +++ b/substrate/primitives/transaction-pool/src/pool.rs @@ -169,7 +169,7 @@ pub trait InPoolTransaction { /// Get tags that transaction provides. fn provides(&self) -> &[TransactionTag]; /// Return a flag indicating if the transaction should be propagated to other peers. - fn is_propagateable(&self) -> bool; + fn is_propagable(&self) -> bool; } /// Transaction pool interface. @@ -249,7 +249,7 @@ pub enum ChainEvent { /// List of retracted blocks ordered by block number. retracted: Vec, }, - /// An existing block has been finalzied. + /// An existing block has been finalized. Finalized { /// Hash of just finalized block hash: B::Hash, diff --git a/substrate/primitives/trie/src/node_header.rs b/substrate/primitives/trie/src/node_header.rs index edcd28a568..7aa1629254 100644 --- a/substrate/primitives/trie/src/node_header.rs +++ b/substrate/primitives/trie/src/node_header.rs @@ -69,7 +69,7 @@ impl Decode for NodeHeader { } /// Returns an iterator over encoded bytes for node header and size. -/// Size encoding allows unlimited, length unefficient, representation, but +/// Size encoding allows unlimited, length inefficient, representation, but /// is bounded to 16 bit maximum value to avoid possible DOS. pub(crate) fn size_and_prefix_iterator(size: usize, prefix: u8) -> impl Iterator { let size = sp_std::cmp::min(trie_constants::NIBBLE_SIZE_BOUND, size); diff --git a/substrate/test-utils/client/src/lib.rs b/substrate/test-utils/client/src/lib.rs index e95c5ad162..afe11903d5 100644 --- a/substrate/test-utils/client/src/lib.rs +++ b/substrate/test-utils/client/src/lib.rs @@ -50,7 +50,7 @@ pub type LightBackend = sc_client::light::backend::Backend< Blake2Hasher, >; -/// A genesis storage initialisation trait. +/// A genesis storage initialization trait. pub trait GenesisInit: Default { /// Construct genesis storage. fn genesis_storage(&self) -> Storage; diff --git a/substrate/test-utils/runtime/src/lib.rs b/substrate/test-utils/runtime/src/lib.rs index c8dff15ef2..ed32cbef9c 100644 --- a/substrate/test-utils/runtime/src/lib.rs +++ b/substrate/test-utils/runtime/src/lib.rs @@ -55,7 +55,7 @@ use sp_core::storage::ChildType; pub use sp_consensus_babe::AuthorityId; pub type AuraId = sp_consensus_aura::sr25519::AuthorityId; -// Inlucde the WASM binary +// Include the WASM binary #[cfg(feature = "std")] include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); @@ -114,7 +114,7 @@ pub enum Extrinsic { ChangesTrieConfigUpdate(Option), } -parity_util_mem::malloc_size_of_is_0!(Extrinsic); // non-opaque extrinisic does not need this +parity_util_mem::malloc_size_of_is_0!(Extrinsic); // non-opaque extrinsic does not need this #[cfg(feature = "std")] impl serde::Serialize for Extrinsic { diff --git a/substrate/utils/fork-tree/src/lib.rs b/substrate/utils/fork-tree/src/lib.rs index 8ce0b729c6..d0cf9c9f37 100644 --- a/substrate/utils/fork-tree/src/lib.rs +++ b/substrate/utils/fork-tree/src/lib.rs @@ -23,7 +23,7 @@ use std::cmp::Reverse; use std::fmt; use codec::{Decode, Encode}; -/// Error occured when iterating with the tree. +/// Error occurred when iterating with the tree. #[derive(Clone, Debug, PartialEq)] pub enum Error { /// Adding duplicate node to tree. @@ -283,7 +283,7 @@ impl ForkTree where .map(|position| self.finalize_root_at(position)) } - /// Finalize root at given positiion. See `finalize_root` comment for details. + /// Finalize root at given position. See `finalize_root` comment for details. fn finalize_root_at(&mut self, position: usize) -> V { let node = self.roots.swap_remove(position); self.roots = node.children; diff --git a/substrate/utils/wasm-builder/README.md b/substrate/utils/wasm-builder/README.md index b21c588ac3..2fd9a6ab4c 100644 --- a/substrate/utils/wasm-builder/README.md +++ b/substrate/utils/wasm-builder/README.md @@ -57,7 +57,7 @@ be `NODE_RUNTIME`. ## Prerequisites: -WASM builder requires the following prerequisities for building the WASM binary: +WASM builder requires the following prerequisites for building the WASM binary: - rust nightly + `wasm32-unknown-unknown` toolchain diff --git a/substrate/utils/wasm-builder/src/lib.rs b/substrate/utils/wasm-builder/src/lib.rs index 80192eb361..8500eba4a0 100644 --- a/substrate/utils/wasm-builder/src/lib.rs +++ b/substrate/utils/wasm-builder/src/lib.rs @@ -73,7 +73,7 @@ //! //! ## Prerequisites: //! -//! WASM builder requires the following prerequisities for building the WASM binary: +//! WASM builder requires the following prerequisites for building the WASM binary: //! //! - rust nightly + `wasm32-unknown-unknown` toolchain //! diff --git a/substrate/utils/wasm-builder/src/wasm_project.rs b/substrate/utils/wasm-builder/src/wasm_project.rs index c9b573ff19..60be4684ba 100644 --- a/substrate/utils/wasm-builder/src/wasm_project.rs +++ b/substrate/utils/wasm-builder/src/wasm_project.rs @@ -431,7 +431,7 @@ fn generate_rerun_if_changed_instructions( .exec() .expect("`cargo metadata` can not fail!"); - // Make sure that if any file/folder of a depedency change, we need to rerun the `build.rs` + // Make sure that if any file/folder of a dependency change, we need to rerun the `build.rs` metadata.packages.into_iter() .filter(|package| !package.manifest_path.starts_with(wasm_workspace)) .for_each(|package| {