Fix typos and markdown (#2388)

* Fix typos

* Align properly

* Update core/consensus/slots/src/lib.rs

Co-Authored-By: cmichi <mich@elmueller.net>

* Update core/network/src/test/mod.rs

Co-Authored-By: cmichi <mich@elmueller.net>

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

Co-Authored-By: cmichi <mich@elmueller.net>

* Update core/consensus/common/src/import_queue.rs

Co-Authored-By: cmichi <mich@elmueller.net>
This commit is contained in:
Michael Müller
2019-04-26 14:09:13 +02:00
committed by Bastian Köcher
parent f0202aa425
commit a0e0d9b03d
31 changed files with 47 additions and 47 deletions
+3 -3
View File
@@ -255,7 +255,7 @@ pub fn refund_unused_gas<T: Trait>(
}
}
/// A little handy utility for converting a value in balance units into approximitate value in gas units
/// A little handy utility for converting a value in balance units into approximate value in gas units
/// at the given gas price.
pub fn approx_gas_for_balance<T: Trait>(gas_price: BalanceOf<T>, balance: BalanceOf<T>) -> T::Gas {
let amount_in_gas: BalanceOf<T> = balance / gas_price;
@@ -316,7 +316,7 @@ mod tests {
struct DoubleTokenMetadata {
multiplier: u64,
}
/// A simple token that charges for the given amount multipled to
/// A simple token that charges for the given amount multiplied to
/// a multiplier taken from a given metadata.
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
struct DoubleToken(u64);
@@ -324,7 +324,7 @@ mod tests {
impl Token<Test> for DoubleToken {
type Metadata = DoubleTokenMetadata;
fn calculate_amount(&self, metadata: &DoubleTokenMetadata) -> u64 {
// Probably you want to use saturating mul in producation code.
// Probably you want to use saturating mul in production code.
self.0 * metadata.multiplier
}
}
+2 -2
View File
@@ -308,7 +308,7 @@ decl_module! {
let result = ctx.call(dest, value, &mut gas_meter, &data, exec::EmptyOutputBuf::new());
if let Ok(_) = result {
// Commit all changes that made it thus far into the persistant storage.
// Commit all changes that made it thus far into the persistent storage.
DirectAccountDb.commit(ctx.overlay.into_change_set());
// Then deposit all events produced.
@@ -362,7 +362,7 @@ decl_module! {
let result = ctx.instantiate(endowment, &mut gas_meter, &code_hash, &data);
if let Ok(_) = result {
// Commit all changes that made it thus far into the persistant storage.
// Commit all changes that made it thus far into the persistent storage.
DirectAccountDb.commit(ctx.overlay.into_change_set());
// Then deposit all events produced.
@@ -167,7 +167,7 @@ macro_rules! register_func {
/// will panic if called with unexpected arguments.
///
/// It's up to the user of this macro to check signatures of wasm code to be executed
/// and reject the code if any imported function has a mismached signature.
/// and reject the code if any imported function has a mismatched signature.
macro_rules! define_env {
( $init_name:ident , < E: $ext_ty:tt > ,
$( $name:ident ( $ctx:ident $( , $names:ident : $params:ty )* )
+2 -2
View File
@@ -155,8 +155,8 @@ impl<'a, T: Trait> crate::exec::Vm<T> for WasmVm<'a, T> {
Err(err @ sandbox::Error::Execution) => to_execution_result(runtime, Some(err)),
Err(_err @ sandbox::Error::Module) => {
// `Error::Module` is returned only if instantiation or linking failed (i.e.
// wasm bianry tried to import a function that is not provided by the host).
// This shouldn't happen because validation proccess ought to reject such binaries.
// wasm binary tried to import a function that is not provided by the host).
// This shouldn't happen because validation process ought to reject such binaries.
//
// Because panics are really undesirable in the runtime code, we treat this as
// a trap for now. Eventually, we might want to revisit this.
+1 -1
View File
@@ -318,7 +318,7 @@ pub fn prepare_contract<T: Trait, C: ImportSatisfyCheck>(
(initial, Some(maximum)) => MemoryDefinition { initial, maximum },
(_, None) => {
// Maximum number of pages should be always declared.
// This isn't a hard requirement and can be treated as a maxiumum set
// This isn't a hard requirement and can be treated as a maximum set
// to configured maximum.
return Err("Maximum number of pages should be always declared.");
}
@@ -58,7 +58,7 @@ pub(crate) fn fields_access(
/// For enums:
/// variant are tested in order of definition.
/// Empty variant is always true.
/// Please use carefully, this will fully parse successfull variant twice.
/// Please use carefully, this will fully parse successful variant twice.
#[proc_macro_derive(Parse)]
pub fn derive_parse(input: TokenStream) -> TokenStream {
let item = parse_macro_input!(input as syn::Item);
@@ -71,8 +71,8 @@ pub fn generate_hidden_includes(unique_id: &str, def_crate: &str) -> TokenStream
}
}
// fn to remove white spaces arount string types
// (basically whitespaces arount tokens)
// fn to remove white spaces around string types
// (basically whitespaces around tokens)
pub fn clean_type_string(input: &str) -> String {
input
.replace(" ::", "::")
+2 -2
View File
@@ -372,7 +372,7 @@ pub fn ensure_inherent<OuterOrigin, AccountId>(o: OuterOrigin) -> Result<(), &'s
}
impl<T: Trait> Module<T> {
/// Gets the index of extrinsic that is currenty executing.
/// Gets the index of extrinsic that is currently executing.
pub fn extrinsic_index() -> Option<u32> {
storage::unhashed::get(well_known_keys::EXTRINSIC_INDEX)
}
@@ -462,7 +462,7 @@ impl<T: Trait> Module<T> {
<Number<T>>::put(n);
}
/// Sets the index of extrinsic that is currenty executing.
/// Sets the index of extrinsic that is currently executing.
#[cfg(any(feature = "std", test))]
pub fn set_extrinsic_index(extrinsic_index: u32) {
storage::unhashed::put(well_known_keys::EXTRINSIC_INDEX, &extrinsic_index)