diff --git a/.config/cargo_spellcheck.dic b/.config/cargo_spellcheck.dic index 52037641ce9..3ba67c5638e 100644 --- a/.config/cargo_spellcheck.dic +++ b/.config/cargo_spellcheck.dic @@ -1,7 +1,8 @@ -60 +70 WebAssembly Wasm +Wasm32 validator ERC fuzzer @@ -29,13 +30,26 @@ getter bitvector dereferencing recurse -kb +kB scalability scalable adjunctive invariants deserializes DApp +RPC +AST +untyped +variadic +evaluable +multisig +Gnosis +stdin +stdout +interoperate +cryptographic +Polkadot +bitwise hasher/S hashmap/S @@ -50,3 +64,8 @@ layout/JG endian/P accessor/S NFT/S +encoding/S +blockchain/S +backend/S +namespace/S +runtime/S diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 13e7f728b75..8e9ad8edfe8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -50,7 +50,7 @@ Following these will ensure that your pull request is going to be accepted. Please try to fix them by yourself and resolve all remaining to-do items. If that is not possible then write an issue for each of them and link to the source line and commit with a proper description. For more information go [here](#Issues-&-pull-requests). 1. Document everything properly that you have written, refactored or touched. Especially keeping documentation up-to-date is very important. For larger portions please try to also update the ink! wiki or write a new entry there. -1. Write tests for your code. If your code is hard to test, try to find a design that allows for testability. +1. Write tests for your code. If your code is hard to test, try to find a design that allows for testing. 1. If needed also update the [`README`](README.md). 1. For performance critical parts we also want additional performance tests. 1. If you implement a fix for a reported bug also include a regression test alongside the fix if possible. diff --git a/RELEASES.md b/RELEASES.md index 99236ab7084..505e1e64d52 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -243,7 +243,7 @@ pub struct Spreaded { ### Packing Storage -We can alter this behaviour by using the `ink_storage::Pack` abstraction: +We can alter this behavior by using the `ink_storage::Pack` abstraction: ```rust pub struct Spreaded { @@ -972,7 +972,7 @@ caller of a function or amount of value sent), but these will be added back in t ## ink!-less Implementations -It is also possible to annotate an entire impl blocks with: +It is also possible to annotate an entire `impl` blocks with: ```rust #[ink(impl)] @@ -983,6 +983,6 @@ impl Contract { }. ``` -This is useful if the `impl` block itself doesn't contain any ink! constructors or messages, but you +This is useful if the `impl` block itself does not contain any ink! constructors or messages, but you still need to access some of the "magic" provided by ink!. In the example above, you would not have access to `emit_event` without `#[ink(impl)]`. diff --git a/crates/engine/src/ext.rs b/crates/engine/src/ext.rs index df916e88963..e6fa38add61 100644 --- a/crates/engine/src/ext.rs +++ b/crates/engine/src/ext.rs @@ -421,7 +421,7 @@ impl Engine { /// Copies the `slice` into `output`. /// -/// Panics if the slice is too large and doesn't fit. +/// Panics if the slice is too large and does not fit. fn set_output(output: &mut &mut [u8], slice: &[u8]) { if slice.len() > output.len() { panic!( diff --git a/crates/env/src/api.rs b/crates/env/src/api.rs index ce8444a664a..ed69f42835b 100644 --- a/crates/env/src/api.rs +++ b/crates/env/src/api.rs @@ -177,11 +177,11 @@ where /// /// # Parameters /// -/// - `at_refcount`: The refcount assumed for the returned `custom_refcount_*` fields. +/// - `at_refcount`: The `refcount` assumed for the returned `custom_refcount_*` fields. /// If `None` is supplied the `custom_refcount_*` fields will also be `None`. /// /// The `current_*` fields of `RentStatus` do **not** consider changes to the code's -/// refcount made during the currently running call. +/// `refcount` made during the currently running call. /// /// # Errors /// @@ -415,7 +415,7 @@ where /// in the restorer contract to not influence the hash calculations. /// - Does *not* perform restoration right away but defers it to the end of /// the contract execution. -/// - Restoration is cancelled if there is no tombstone in the destination +/// - Restoration is canceled if there is no tombstone in the destination /// address or if the hashes don't match. No changes are made in this case. pub fn restore_contract( account_id: T::AccountId, @@ -467,7 +467,7 @@ where /// /// # Errors /// -/// - If the contract doesn't have sufficient funds. +/// - If the contract does not have sufficient funds. /// - If the transfer had brought the sender's total balance below the /// subsistence threshold. pub fn transfer(destination: T::AccountId, value: T::Balance) -> Result<()> diff --git a/crates/env/src/engine/experimental_off_chain/impls.rs b/crates/env/src/engine/experimental_off_chain/impls.rs index acf4128c02c..90f00e384f6 100644 --- a/crates/env/src/engine/experimental_off_chain/impls.rs +++ b/crates/env/src/engine/experimental_off_chain/impls.rs @@ -49,7 +49,7 @@ use ink_primitives::Key; /// The capacity of the static buffer. /// This is the same size as the ink! on-chain environment. We chose to use the same size /// to be as close to the on-chain behavior as possible. -const BUFFER_SIZE: usize = 1 << 14; // 16kB +const BUFFER_SIZE: usize = 1 << 14; // 16 kB impl CryptoHash for Blake2x128 { fn hash(input: &[u8], output: &mut ::Type) { diff --git a/crates/env/src/engine/experimental_off_chain/test_api.rs b/crates/env/src/engine/experimental_off_chain/test_api.rs index e44c9a5d238..aebdb46c7b4 100644 --- a/crates/env/src/engine/experimental_off_chain/test_api.rs +++ b/crates/env/src/engine/experimental_off_chain/test_api.rs @@ -140,7 +140,7 @@ pub fn recorded_debug_messages() -> RecordedDebugMessages { /// /// # Note /// -/// Useful for benchmarking because it ensures the initialized storage is maintained across runs, +/// Useful for benchmarks because it ensures the initialized storage is maintained across runs, /// because lazy storage structures automatically clear their associated cells when they are dropped. pub fn set_clear_storage_disabled(_disable: bool) { unimplemented!( @@ -233,7 +233,7 @@ where }) } -/// Runs the given closure test function with the default configuartion +/// Runs the given closure test function with the default configuration /// for the off-chain environment. pub fn run_test(f: F) -> Result<()> where diff --git a/crates/env/src/engine/off_chain/db/block.rs b/crates/env/src/engine/off_chain/db/block.rs index f6eb2d5d173..0906200d076 100644 --- a/crates/env/src/engine/off_chain/db/block.rs +++ b/crates/env/src/engine/off_chain/db/block.rs @@ -89,12 +89,12 @@ impl Block { /// # Note /// /// - This is the off-chain environment implementation of - /// [`random`][`crate::random`]. It provides the same behaviour in that it + /// [`random`][`crate::random`]. It provides the same behavior in that it /// will likely yield the same hash for the same subjects within the same /// block (or execution context). /// /// - Returned hashes on the surface might appear random, however for - /// testability purposes the actual implementation is quite simple and + /// testing purposes the actual implementation is quite simple and /// computes those "random" hashes by wrapping XOR of the internal entry hash /// with the eventually repeated sequence of the subject buffer. pub fn random(&self, subject: &[u8]) -> Result diff --git a/crates/env/src/engine/off_chain/mod.rs b/crates/env/src/engine/off_chain/mod.rs index bb3ce8d41b6..8df55ddfbb5 100644 --- a/crates/env/src/engine/off_chain/mod.rs +++ b/crates/env/src/engine/off_chain/mod.rs @@ -198,7 +198,7 @@ impl EnvInstance { ); // Initialize the execution context for the first contract execution. use crate::call::Selector; - // The below selector bytes are incorrect but since calling doesn't work + // The below selector bytes are incorrect but since calling does not work // yet we do not have to fix this now. let selector_bytes_for_call = [0x00; 4]; self.exec_context.push( diff --git a/crates/env/src/engine/off_chain/test_api.rs b/crates/env/src/engine/off_chain/test_api.rs index 41c979b9d53..0554e2e2b2d 100644 --- a/crates/env/src/engine/off_chain/test_api.rs +++ b/crates/env/src/engine/off_chain/test_api.rs @@ -206,7 +206,7 @@ where .map_err(Into::into) } -/// Update the [ChainSpec](`crate::test::ChainSpec`) for the test environment +/// Update the [`ChainSpec`](`crate::test::ChainSpec`) for the test environment pub fn update_chain_spec(f: F) -> Result<()> where F: FnOnce(&mut ChainSpec), @@ -261,7 +261,7 @@ where /// /// # Note /// -/// Useful for benchmarking because it ensures the initialized storage is maintained across runs, +/// Useful for benchmarks because it ensures the initialized storage is maintained across runs, /// because lazy storage structures automatically clear their associated cells when they are dropped. pub fn set_clear_storage_disabled(disable: bool) { ::on_instance(|instance| { @@ -321,7 +321,7 @@ where }) } -/// Runs the given closure test function with the default configuartion +/// Runs the given closure test function with the default configuration /// for the off-chain environment. pub fn run_test(f: F) -> Result<()> where diff --git a/crates/env/src/engine/off_chain/typed_encoded.rs b/crates/env/src/engine/off_chain/typed_encoded.rs index 13870129587..a590b74305d 100644 --- a/crates/env/src/engine/off_chain/typed_encoded.rs +++ b/crates/env/src/engine/off_chain/typed_encoded.rs @@ -41,14 +41,14 @@ pub struct TypedEncoded { /// - If this is `None` it means that the instance is currently untyped /// and will take over any given type upon the first typed interaction. /// - This is needed since instances of `TypedEncoded` are going to be used - /// in static memory where it isn't possible to decide about the used types + /// in static memory where it is not possible to decide about the used types /// given by `Environment` at initialization. type_id: Option, /// Classification marker. /// /// # Note /// - /// - This shouldn't be the typed that is actually stored as encoded + /// - This should not be the typed that is actually stored as encoded /// representation in `self.encoded` but should primarily be an /// abstract marker type that may be used for classification. /// - The idea behind the marker is to say that whenever two instances @@ -245,7 +245,7 @@ impl TypedEncoded { Ok(()) } - /// Evaluates the given clousure on the given typed encoded instances. + /// Evaluates the given closure on the given typed encoded instances. pub fn eval(&self, other: &Self, f: F) -> Result where T: scale::Decode + 'static, @@ -257,7 +257,7 @@ impl TypedEncoded { Ok(f(&decoded_self, &decoded_other)) } - /// Evaluates the given clousure on the given typed decoded instances + /// Evaluates the given closure on the given typed decoded instances /// and writes back the result into the typed encoded instance. pub fn eval_mut(&mut self, other: &Self, f: F) -> Result where diff --git a/crates/env/src/engine/on_chain/buffer.rs b/crates/env/src/engine/on_chain/buffer.rs index e378267df19..0ad13729c3c 100644 --- a/crates/env/src/engine/on_chain/buffer.rs +++ b/crates/env/src/engine/on_chain/buffer.rs @@ -12,15 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -/// A static buffer with 16kB of capacity. +/// A static buffer with 16 kB of capacity. pub struct StaticBuffer { - /// The static buffer with a total capacity of 16kB. + /// The static buffer with a total capacity of 16 kB. buffer: [u8; Self::CAPACITY], } impl StaticBuffer { /// The capacity of the static buffer. - const CAPACITY: usize = 1 << 14; // 16kB + const CAPACITY: usize = 1 << 14; // 16 kB /// Creates a new static buffer. pub const fn new() -> Self { @@ -105,7 +105,7 @@ impl<'a> scale::Output for EncodeScope<'a> { /// /// # Note /// -/// This is used to efficiently chunk up ink!'s internal static 16kB buffer +/// This is used to efficiently chunk up ink!'s internal static 16 kB buffer /// into smaller sub buffers for processing different parts of computations. #[derive(Debug)] pub struct ScopedBuffer<'a> { @@ -122,7 +122,7 @@ impl<'a> From<&'a mut [u8]> for ScopedBuffer<'a> { impl<'a> ScopedBuffer<'a> { /// Splits the scoped buffer into yet another piece to operate on it temporarily. /// - /// The splitted buffer will have an offset of 0 but be offset by `self`'s offset. + /// The split buffer will have an offset of 0 but be offset by `self`'s offset. pub fn split(&mut self) -> ScopedBuffer { ScopedBuffer { offset: 0, diff --git a/crates/env/src/engine/on_chain/ext.rs b/crates/env/src/engine/on_chain/ext.rs index 33c74eb30b5..1b0364f9e98 100644 --- a/crates/env/src/engine/on_chain/ext.rs +++ b/crates/env/src/engine/on_chain/ext.rs @@ -652,9 +652,9 @@ pub fn random(subject: &[u8], output: &mut &mut [u8]) { #[cfg(feature = "ink-debug")] /// Call `seal_debug_message` with the supplied UTF-8 encoded message. /// -/// If debug message recording is disabled in the contracts pallet, the first call to will -/// return LoggingDisabled error, and further calls will be a no-op to avoid the cost of calling -/// into the supervisor. +/// If debug message recording is disabled in the contracts pallet, the first call will +/// return a `LoggingDisabled` error, and further calls will be a no-op to avoid the cost +/// of calling into the supervisor. /// /// # Note /// diff --git a/crates/env/src/engine/on_chain/impls.rs b/crates/env/src/engine/on_chain/impls.rs index d3fc2da3a33..6fd58097155 100644 --- a/crates/env/src/engine/on_chain/impls.rs +++ b/crates/env/src/engine/on_chain/impls.rs @@ -170,7 +170,7 @@ where } impl EnvInstance { - /// Returns a new scoped buffer for the entire scope of the static 16kB buffer. + /// Returns a new scoped buffer for the entire scope of the static 16 kB buffer. fn scoped_buffer(&mut self) -> ScopedBuffer { ScopedBuffer::from(&mut self.buffer[..]) } diff --git a/crates/env/src/engine/on_chain/mod.rs b/crates/env/src/engine/on_chain/mod.rs index dc37aa5fe29..18302d8a76e 100644 --- a/crates/env/src/engine/on_chain/mod.rs +++ b/crates/env/src/engine/on_chain/mod.rs @@ -27,11 +27,11 @@ use super::OnInstance; /// The on-chain environment. pub struct EnvInstance { - /// Encode & decode buffer with static size of 16kB. + /// Encode & decode buffer with static size of 16 kB. /// /// If operations require more than that they will fail. - /// This limit was chosen after benchmarking Substrate storage - /// storage and load performance and was found to be a sweet spot. + /// This limit was found to be a sweet spot after running benchmarks + /// on Substrate's storage and load performance. /// /// Please note that this is still an implementation detail and /// might change. Users should generally avoid storing too big values diff --git a/crates/env/src/types.rs b/crates/env/src/types.rs index 922f9e716b8..7b358ffd68c 100644 --- a/crates/env/src/types.rs +++ b/crates/env/src/types.rs @@ -294,7 +294,7 @@ pub struct RentParams { /// The fraction of the deposit costs that should be used as rent per block. /// - /// When a contract doesn't have enough balance deposited to stay alive indefinitely + /// When a contract does not have enough balance deposited to stay alive indefinitely /// it needs to pay per block for the storage it consumes that is not covered by the /// deposit. This determines how high this rent payment is per block as a fraction /// of the deposit costs. @@ -322,18 +322,18 @@ pub struct RentParams { /// /// # Note /// -/// The `current_*` fields do **not** consider changes to the code's refcount made during -/// the currently running call. +/// The `current_*` fields do **not** consider changes to the code's `refcount` +/// made during the currently running call. #[derive(scale::Decode)] #[cfg_attr(test, derive(Debug, PartialEq))] pub struct RentStatus { /// Required deposit assuming that this contract is the only user of its code. pub max_deposit: T::Balance, - /// Required deposit assuming the code's current refcount. + /// Required deposit assuming the code's current `refcount`. pub current_deposit: T::Balance, - /// Required deposit assuming the specified refcount (`None` if `0` is supplied). + /// Required deposit assuming the specified `refcount` (`None` if `0` is supplied). pub custom_refcount_deposit: Option, /// Rent that is paid assuming that the contract is the only user of its code. diff --git a/crates/lang/codegen/src/generator/dispatch.rs b/crates/lang/codegen/src/generator/dispatch.rs index a78fd276135..af8009081b1 100644 --- a/crates/lang/codegen/src/generator/dispatch.rs +++ b/crates/lang/codegen/src/generator/dispatch.rs @@ -194,7 +194,7 @@ impl Dispatch<'_> { } } - /// Generates code for the dispatch trait impls for a generic ink! callable. + /// Generates code for the dispatch trait implementations for a generic ink! callable. fn generate_trait_impls_for_callable( &self, cws: ir::CallableWithSelector<'_, C>, @@ -247,7 +247,7 @@ impl Dispatch<'_> { /// Returns a tuple of: /// /// - Vector over the generated identifier bindings (`__ink_binding_N`) for all inputs. - /// - `TokenStream` representing the binding identifiers as tuple (for >=2 inputs), + /// - `TokenStream` representing the binding identifiers as tuple (for `>= 2` inputs), /// as single identifier (for exactly one input) or as wildcard (`_`) if there are /// no input bindings. /// @@ -271,7 +271,7 @@ impl Dispatch<'_> { /// # ; /// ``` /// - /// **Multiple (>=2) inputs:** + /// **Multiple `(>= 2)` inputs:** /// ``` /// # use quote::quote; /// # let __ink_binding_0 = (); diff --git a/crates/lang/codegen/src/generator/metadata.rs b/crates/lang/codegen/src/generator/metadata.rs index 0948b31e81c..06f8a6563d2 100644 --- a/crates/lang/codegen/src/generator/metadata.rs +++ b/crates/lang/codegen/src/generator/metadata.rs @@ -374,7 +374,7 @@ mod tests { /// line ), syn::parse_quote!( - /// commments + /// comments ), ]) .collect::>(), @@ -382,7 +382,7 @@ mod tests { " multiple".to_string(), " single".to_string(), " line".to_string(), - " commments".to_string(), + " comments".to_string(), ], ); assert_eq!( diff --git a/crates/lang/codegen/src/generator/storage.rs b/crates/lang/codegen/src/generator/storage.rs index 74c830c4f72..c24673d3628 100644 --- a/crates/lang/codegen/src/generator/storage.rs +++ b/crates/lang/codegen/src/generator/storage.rs @@ -25,7 +25,7 @@ use quote::{ }; use syn::spanned::Spanned as _; -/// Generator to create the ink! storage struct and important trait impls. +/// Generator to create the ink! storage struct and important trait implementations. #[derive(From)] pub struct Storage<'a> { contract: &'a ir::Contract, diff --git a/crates/lang/codegen/src/generator/trait_def.rs b/crates/lang/codegen/src/generator/trait_def.rs index 1f2ad385a87..39490e11c3b 100644 --- a/crates/lang/codegen/src/generator/trait_def.rs +++ b/crates/lang/codegen/src/generator/trait_def.rs @@ -22,7 +22,7 @@ use quote::{ quote_spanned, }; -/// Generator to create the ink! storage struct and important trait impls. +/// Generator to create the ink! storage struct and important trait implementations. #[derive(From)] pub struct TraitDefinition<'a> { trait_def: &'a ir::InkTrait, diff --git a/crates/lang/ir/src/ast/attr_args.rs b/crates/lang/ir/src/ast/attr_args.rs index c2a7582557a..187e19ede5b 100644 --- a/crates/lang/ir/src/ast/attr_args.rs +++ b/crates/lang/ir/src/ast/attr_args.rs @@ -36,7 +36,7 @@ pub struct AttributeArgs { args: Punctuated, } -/// A name-value pair within an attribute, like feature = "nightly". +/// A name-value pair within an attribute, like `feature = "nightly"`. /// /// The only difference from `syn::MetaNameValue` is that this additionally /// allows the `value` to be a plain identifier or path. diff --git a/crates/lang/ir/src/ast/mod.rs b/crates/lang/ir/src/ast/mod.rs index 77514d5974d..58b807472dd 100644 --- a/crates/lang/ir/src/ast/mod.rs +++ b/crates/lang/ir/src/ast/mod.rs @@ -20,9 +20,9 @@ //! syntax. //! //! At the time of this writing we currently only use this for the argument -//! parsing of ink! config header `#[ink(env = my::env::Types, etc...)]` in order -//! to be able to parse identifiers in `name = value` segments for the `value` -//! part. +//! parsing of ink! configuration header `#[ink(env = my::env::Types, etc...)]` +//! in order to be able to parse identifiers in `name = value` segments for +//! the `value` part. mod attr_args; diff --git a/crates/lang/ir/src/ir/attrs.rs b/crates/lang/ir/src/ir/attrs.rs index d5b9b380a68..7f384c8eafb 100644 --- a/crates/lang/ir/src/ir/attrs.rs +++ b/crates/lang/ir/src/ir/attrs.rs @@ -382,7 +382,7 @@ pub enum AttributeArg { /// This attribute supports a niche case that is rarely needed. /// /// Can be applied on ink! implementation blocks in order to make ink! aware - /// of them. This is useful if such an implementation block doesn't contain + /// of them. This is useful if such an implementation block does not contain /// any other ink! attributes, so it would be flagged by ink! as a Rust item. /// Adding `#[ink(impl)]` on such implementation blocks makes them treated /// as ink! implementation blocks thus allowing to access the environment @@ -966,7 +966,7 @@ mod tests { mod test { use crate::ir; - /// Mock for `ir::Attribute` to improve testability. + /// Mock for `ir::Attribute` to improve the ability to test. #[derive(Debug, PartialEq, Eq)] pub enum Attribute { Ink(Vec), @@ -996,7 +996,7 @@ mod tests { } } - /// Mock for `ir::InkAttribute` to improve testability. + /// Mock for `ir::InkAttribute` to improve the ability to test. #[derive(Debug, PartialEq, Eq)] pub struct InkAttribute { args: Vec, @@ -1027,7 +1027,7 @@ mod tests { } /// Asserts that the given [`syn::Attribute`] is converted into the expected - /// [`ir::Attribute]` or yields the expected error message. + /// [`ir::Attribute`] or yields the expected error message. fn assert_attribute_try_from( input: syn::Attribute, expected: Result, diff --git a/crates/lang/ir/src/ir/chain_extension.rs b/crates/lang/ir/src/ir/chain_extension.rs index 4597e321342..dd72625428e 100644 --- a/crates/lang/ir/src/ir/chain_extension.rs +++ b/crates/lang/ir/src/ir/chain_extension.rs @@ -230,7 +230,7 @@ impl ChainExtension { /// - If the input trait is an automatically implemented trait (`auto trait`). /// - If the input trait is generic over some set of types. /// - If the input trait's visibility is not public (`pub`). - /// - If the input trait has supertraits. + /// - If the input trait has super-traits. fn analyse_properties(item_trait: &syn::ItemTrait) -> Result<()> { if let Some(unsafety) = &item_trait.unsafety { return Err(format_err_spanned!( @@ -259,7 +259,7 @@ impl ChainExtension { if !item_trait.supertraits.is_empty() { return Err(format_err_spanned!( item_trait.supertraits, - "ink! chain extensions with supertraits are not supported, yet" + "ink! chain extensions with super-traits are not supported, yet" )) } Ok(()) @@ -326,7 +326,7 @@ impl ChainExtension { /// - associated constants (`const`) /// - associated types (`type`) /// - macros definitions or usages - /// - unknown token sequences (verbatims) + /// - unknown token sequences (`verbatim`'s) /// - methods with default implementations /// - If the trait contains methods which do not respect the ink! trait definition requirements: /// - All trait methods must not have a `self` receiver. @@ -569,7 +569,7 @@ mod tests { #[test] fn chain_extension_with_supertraits_is_denied() { assert_ink_chain_extension_eq_err!( - error: "ink! chain extensions with supertraits are not supported, yet", + error: "ink! chain extensions with super-traits are not supported, yet", pub trait MyChainExtension: SuperChainExtension {} ); } diff --git a/crates/lang/ir/src/ir/config.rs b/crates/lang/ir/src/ir/config.rs index d392d94669e..52cd4d80cc6 100644 --- a/crates/lang/ir/src/ir/config.rs +++ b/crates/lang/ir/src/ir/config.rs @@ -40,7 +40,7 @@ pub struct Config { env: Option, } -/// Return an error to notify about duplicate ink! config arguments. +/// Return an error to notify about duplicate ink! configuration arguments. fn duplicate_config_err(fst: F, snd: S, name: &str) -> syn::Error where F: Spanned, @@ -79,7 +79,7 @@ impl TryFrom for Config { } else { return Err(format_err_spanned!( arg, - "expected a bool literal for `dynamic_storage_allocator` ink! config argument", + "expected a bool literal for `dynamic_storage_allocator` ink! configuration argument", )) } } else if arg.name.is_ident("compile_as_dependency") { @@ -91,7 +91,7 @@ impl TryFrom for Config { } else { return Err(format_err_spanned!( arg, - "expected a bool literal for `compile_as_dependency` ink! config argument", + "expected a bool literal for `compile_as_dependency` ink! configuration argument", )) } } else if arg.name.is_ident("env") { @@ -103,13 +103,13 @@ impl TryFrom for Config { } else { return Err(format_err_spanned!( arg, - "expected a path for `env` ink! config argument", + "expected a path for `env` ink! configuration argument", )) } } else { return Err(format_err_spanned!( arg, - "encountered unknown or unsupported ink! config argument", + "encountered unknown or unsupported ink! configuration argument", )) } } @@ -206,7 +206,7 @@ mod tests { fn storage_alloc_invalid_value_fails() { assert_try_from( syn::parse_quote! { dynamic_storage_allocator = "invalid" }, - Err("expected a bool literal for `dynamic_storage_allocator` ink! config argument"), + Err("expected a bool literal for `dynamic_storage_allocator` ink! configuration argument"), ) } @@ -229,7 +229,7 @@ mod tests { assert_try_from( syn::parse_quote! { compile_as_dependency = "invalid" }, Err( - "expected a bool literal for `compile_as_dependency` ink! config argument" + "expected a bool literal for `compile_as_dependency` ink! configuration argument" ) ) } @@ -254,7 +254,7 @@ mod tests { fn env_invalid_value_fails() { assert_try_from( syn::parse_quote! { env = "invalid" }, - Err("expected a path for `env` ink! config argument"), + Err("expected a path for `env` ink! configuration argument"), ); } @@ -262,7 +262,7 @@ mod tests { fn unknown_arg_fails() { assert_try_from( syn::parse_quote! { unknown = argument }, - Err("encountered unknown or unsupported ink! config argument"), + Err("encountered unknown or unsupported ink! configuration argument"), ); } diff --git a/crates/lang/ir/src/ir/item/mod.rs b/crates/lang/ir/src/ir/item/mod.rs index c553cf1afa3..5034a362f27 100644 --- a/crates/lang/ir/src/ir/item/mod.rs +++ b/crates/lang/ir/src/ir/item/mod.rs @@ -91,7 +91,7 @@ impl TryFrom for Item { return Ok(Self::Rust(item_impl.into())) } // At this point we know that there must be at least one ink! - // attribute on either the impl block itself or one of its items. + // attribute on either the `impl` block itself or one of its items. >::try_from(item_impl) .map(Into::into) .map(Self::Ink) diff --git a/crates/lang/ir/src/ir/item/storage.rs b/crates/lang/ir/src/ir/item/storage.rs index 19653804d6d..90a7da1b550 100644 --- a/crates/lang/ir/src/ir/item/storage.rs +++ b/crates/lang/ir/src/ir/item/storage.rs @@ -120,7 +120,7 @@ impl Storage { &self.ast.ident } - /// Returns an iter yielding all fields of the storage struct. + /// Returns an iterator yielding all fields of the storage struct. pub fn fields(&self) -> syn::punctuated::Iter { self.ast.fields.iter() } diff --git a/crates/lang/ir/src/ir/item_impl/callable.rs b/crates/lang/ir/src/ir/item_impl/callable.rs index ddaf0b0dbac..bd7d88522d2 100644 --- a/crates/lang/ir/src/ir/item_impl/callable.rs +++ b/crates/lang/ir/src/ir/item_impl/callable.rs @@ -69,7 +69,7 @@ impl<'a, C> CallableWithSelector<'a, C> where C: Callable, { - /// Creates a new wrapper around the given callable and parent impl block. + /// Creates a new wrapper around the given callable and parent `impl` block. pub(super) fn new(item_impl: &'a ir::ItemImpl, callable: &'a C) -> Self { Self { composed_selector: compose_selector(item_impl, callable), @@ -80,7 +80,7 @@ where } impl<'a, C> CallableWithSelector<'a, C> { - /// Returns the composed selector of the ink! callable the the impl block. + /// Returns the composed selector of the ink! callable the the `impl` block. pub fn composed_selector(&self) -> ir::Selector { self.composed_selector } @@ -184,13 +184,13 @@ pub trait Callable { /// Given /// - the callable's identifier `i` /// - the optionally set callable's selector `s` -/// - the impl blocks trait path in case it implements a trait, `P` -/// - the impl blocks optional user provided namespace `S` +/// - the `impl` blocks trait path in case it implements a trait, `P` +/// - 16 kB blocks optional user provided namespace `S` /// /// Then the selector is composed in the following way: /// /// - If `s` is given we simply return `s`. -/// - Otherwise if `T` is not `None` (trait impl block) we concatenate +/// - Otherwise if `T` is not `None` (trait `impl` block) we concatenate /// `S`, `T` and `i` with `::` as separator if `T` refers to a full-path. /// If `T` refers to a relative path or is just an identifier we only take /// its last segment `p` (e.g. the trait's identifier) into consideration @@ -293,7 +293,7 @@ pub trait Callable { /// wherever possible; OR import the trait and use only its identifier with /// an additional namespace if required to disambiguate selectors. /// - Try not to intermix the above recommendations. -/// - Avoid directly setting the selector of an ink! message or constuctor. +/// - Avoid directly setting the selector of an ink! message or constructor. /// Only do this if nothing else helps and you need a very specific selector, /// e.g. in case of backwards compatibility. /// - Do not use the namespace unless required to disambiguate. @@ -353,11 +353,11 @@ where /// In case any of the common externally callable invariants are not met: /// - This is `true` if the externally callable is: /// - generic -/// - const (compile-time evaluatable) -/// - async (async WebAssembly smart contract calling is not allowed) -/// - unsafe (caller provided assertions not yet stable) +/// - `const` (compile-time evaluable) +/// - `async` (asynchronous WebAssembly smart contract calling is not allowed) +/// - `unsafe` (caller provided assertions not yet stable) /// - Furthermore this is `true` if the externally callable is defined for a -/// non default ABI (e.g. `extern "C"`) or doesn't have valid visibility. +/// non default ABI (e.g. `extern "C"`) or does not have valid visibility. pub(super) fn ensure_callable_invariants( method_item: &syn::ImplItemMethod, kind: CallableKind, diff --git a/crates/lang/ir/src/ir/item_impl/impl_item.rs b/crates/lang/ir/src/ir/item_impl/impl_item.rs index dd551414891..7452a74df23 100644 --- a/crates/lang/ir/src/ir/item_impl/impl_item.rs +++ b/crates/lang/ir/src/ir/item_impl/impl_item.rs @@ -33,7 +33,7 @@ use syn::spanned::Spanned as _; /// /// # Note /// -/// Based on [`syn::ImplItem`] with special variants for ink! impl items. +/// Based on [`syn::ImplItem`] with special variants for ink! `impl` items. #[derive(Debug, PartialEq, Eq)] #[allow(clippy::large_enum_variant)] pub enum ImplItem { @@ -87,7 +87,7 @@ impl TryFrom for ImplItem { } } other_item => { - // This is an error if the impl item contains any unexpected + // This is an error if the `impl` item contains any unexpected // ink! attributes. Otherwise it is a normal Rust item. if ir::contains_ink_attributes(other_item.attrs()) { let (ink_attrs, _) = @@ -108,7 +108,7 @@ impl TryFrom for ImplItem { } impl ImplItem { - /// Returns `true` if the impl block item is an ink! message. + /// Returns `true` if the `impl` block item is an ink! message. pub fn is_message(&self) -> bool { self.filter_map_message().is_some() } @@ -123,7 +123,7 @@ impl ImplItem { } } - /// Returns `true` if the impl block item is an ink! message. + /// Returns `true` if the `impl` block item is an ink! message. pub fn is_constructor(&self) -> bool { self.filter_map_constructor().is_some() } @@ -138,7 +138,7 @@ impl ImplItem { } } - /// Returns `true` if the impl block item is a non ink! specific item. + /// Returns `true` if the `impl` block item is a non ink! specific item. pub fn is_other_item(&self) -> bool { self.filter_map_other_item().is_some() } diff --git a/crates/lang/ir/src/ir/item_impl/mod.rs b/crates/lang/ir/src/ir/item_impl/mod.rs index cba73e999b0..b3d16cd09ed 100644 --- a/crates/lang/ir/src/ir/item_impl/mod.rs +++ b/crates/lang/ir/src/ir/item_impl/mod.rs @@ -121,7 +121,7 @@ impl ItemImpl { /// /// This is the case if: /// - /// - The ink! implementation block has been annotatated as in: + /// - The ink! implementation block has been annotated as in: /// /// ``` /// # use core::convert::TryFrom; @@ -218,7 +218,7 @@ impl TryFrom for ItemImpl { if !Self::is_ink_impl_block(&item_impl)? { return Err(format_err_spanned!( item_impl, - "missing ink! annotations on the impl block or on any of its items" + "missing ink! annotations on 16 kB block or on any of its items" )) } if let Some(defaultness) = item_impl.defaultness { @@ -247,7 +247,7 @@ impl TryFrom for ItemImpl { let is_trait_impl = item_impl.trait_.is_some(); for impl_item in &impl_items { /// Ensures that visibility of ink! messages and constructors is - /// valid in dependency of the containing ink! impl block. + /// valid in dependency of the containing ink! `impl` block. /// /// # Note /// @@ -366,7 +366,7 @@ impl ItemImpl { IterConstructors::new(self) } - /// Returns a slice over the shared references of the items of the impl. + /// Returns a slice over the shared references of the items of the `impl`. pub fn items(&self) -> &[ir::ImplItem] { &self.items } diff --git a/crates/lang/ir/src/ir/trait_def.rs b/crates/lang/ir/src/ir/trait_def.rs index 1d081ea8283..fa1c2cf7a4a 100644 --- a/crates/lang/ir/src/ir/trait_def.rs +++ b/crates/lang/ir/src/ir/trait_def.rs @@ -343,7 +343,7 @@ impl InkTrait { if !item_trait.supertraits.is_empty() { return Err(format_err_spanned!( item_trait.supertraits, - "ink! trait definitions with supertraits are not supported, yet" + "ink! trait definitions with super-traits are not supported, yet" )) } Ok(()) @@ -635,7 +635,7 @@ mod tests { #[test] fn trait_def_with_supertraits_is_denied() { assert_ink_trait_eq_err!( - error: "ink! trait definitions with supertraits are not supported, yet", + error: "ink! trait definitions with super-traits are not supported, yet", pub trait MyTrait: SuperTrait {} ); } diff --git a/crates/lang/ir/src/lib.rs b/crates/lang/ir/src/lib.rs index e051fb76f15..274d92d8658 100644 --- a/crates/lang/ir/src/lib.rs +++ b/crates/lang/ir/src/lib.rs @@ -23,7 +23,7 @@ //! //! The ink! IR tries to stay close to the original Rust syntactic structure. //! All ink! definitions of an ink! smart contract are always defined within -//! a so-called Rust inline modlue (`mod my_module { ... items ... }`). +//! a so-called Rust inline module (`mod my_module { ... items ... }`). //! Therefore all ink! definition are found and accessed using the //! [`ItemMod`](`crate::ir::ItemMod`) data structure. diff --git a/crates/lang/macro/src/lib.rs b/crates/lang/macro/src/lib.rs index 82e491fcb66..9455616d7ac 100644 --- a/crates/lang/macro/src/lib.rs +++ b/crates/lang/macro/src/lib.rs @@ -37,7 +37,7 @@ use proc_macro::TokenStream; /// /// ink! smart contracts can compile in several different modes. /// There are two main compilation models using either -/// - on-chain mode: `no_std` + WebAssembly as target +/// - on-chain mode: `no_std` and WebAssembly as target /// - off-chain mode: `std` /// /// We generally use the on-chain mode for actual smart contract deployment @@ -59,7 +59,7 @@ use proc_macro::TokenStream; /// - `false`: Do NOT use the dynamic storage allocator provided by ink!. /// /// This feature is generally only needed for smart contracts that try to model -/// their data in a way that contains storage entites within other storage +/// their data in a way that contains storage entities within other storage /// entities. /// /// Contract writers should try to write smart contracts that do not depend on the @@ -189,7 +189,7 @@ use proc_macro::TokenStream; /// /// **Default value:** `DefaultEnvironment` defined in `ink_env` crate. /// -/// ## Anaylsis +/// ## Analysis /// /// The `#[ink::contract]` macro fully analyses its input smart contract /// against invalid arguments and structure. @@ -379,7 +379,7 @@ use proc_macro::TokenStream; /// /// ## Interacting with the Contract Executor /// -/// The `ink_env` crate provides facitilies to interact with the contract executor that +/// The `ink_env` crate provides facilities to interact with the contract executor that /// connects ink! smart contracts with the outer world. /// /// For example it is possible to query the current call's caller via: @@ -649,9 +649,9 @@ pub fn test(attr: TokenStream, item: TokenStream) -> TokenStream { /// The methods are defined as associated trait methods without implementation. /// /// Chain extension methods must not have a `self` receiver such as `&self` or `&mut self` -/// and must have inputs and output that implement SCALE codec. Their return value follows -/// specific rules that can be altered using the `handle_status` and `returns_result` attributes -/// which are described in more detail below. +/// and must have inputs and output that implement the SCALE encoding and decoding. +/// Their return value follows specific rules that can be altered using the `handle_status` +/// and `returns_result` attributes which are described in more detail below. /// /// # Usage /// @@ -726,7 +726,7 @@ pub fn test(attr: TokenStream, item: TokenStream) -> TokenStream { /// Note that if a chain extension method is attributed with `returns_result = false` /// and with `handle_status = true` it will still return a value of type `Result`. /// -/// ## Usage: `handle_status` + `returns_result` +/// ## Usage: `handle_status` and `returns_result` /// /// Use both `handle_status = false` and `returns_result = false` for the same chain extension method /// if a call to it may never fail and never returns a `Result` type. @@ -738,10 +738,10 @@ pub fn test(attr: TokenStream, item: TokenStream) -> TokenStream { /// /// | `handle_status` | `returns_result` | Effects | /// |:---------------:|:----------------:|:--------| -/// |`true` |`true` | The chain extension method is required to return a value of type `Result` where `E: From`. A call will always check if the returned status code indicates success and only then will load and decode the value in the output buffer. | -/// |`true` |`false`| The chain extension method may return any non-`Result` type. A call will always check if the returned status code indicates success and only then will load and decode the value in the output buffer. The actual return type of the chain extension method is still `Result` when the chain extension method was defined to return a value of type `T`. | -/// |`false`|`true` | The chain extension method is required to return a value of type `Result`. A call will always assume that the returned status code indicates success and therefore always load and decode the output buffer directly. | -/// |`false`|`false`| The chain extension method may return any non-`Result` type. A call will always assume that the returned status code indicates success and therefore always load and decode the output buffer directly. | +/// | `true` | `true` | The chain extension method is required to return a value of type `Result` where `E: From`. A call will always check if the returned status code indicates success and only then will load and decode the value in the output buffer. | +/// | `true` | `false` | The chain extension method may return any non-`Result` type. A call will always check if the returned status code indicates success and only then will load and decode the value in the output buffer. The actual return type of the chain extension method is still `Result` when the chain extension method was defined to return a value of type `T`. | +/// | `false` | `true` | The chain extension method is required to return a value of type `Result`. A call will always assume that the returned status code indicates success and therefore always load and decode the output buffer directly. | +/// | `false` | `false` | The chain extension method may return any non-`Result` type. A call will always assume that the returned status code indicates success and therefore always load and decode the output buffer directly. | /// /// # Error Code /// diff --git a/crates/lang/macro/tests/ui/fail/H-01-invalid-dyn-alloc.stderr b/crates/lang/macro/tests/ui/fail/H-01-invalid-dyn-alloc.stderr index 3a73b0bb82e..1875fce7be0 100644 --- a/crates/lang/macro/tests/ui/fail/H-01-invalid-dyn-alloc.stderr +++ b/crates/lang/macro/tests/ui/fail/H-01-invalid-dyn-alloc.stderr @@ -1,4 +1,4 @@ -error: expected a bool literal for `dynamic_storage_allocator` ink! config argument +error: expected a bool literal for `dynamic_storage_allocator` ink! configuration argument --> $DIR/H-01-invalid-dyn-alloc.rs:3:17 | 3 | #[ink::contract(dynamic_storage_allocator = "foo")] diff --git a/crates/lang/macro/tests/ui/fail/H-02-invalid-as-dependency.stderr b/crates/lang/macro/tests/ui/fail/H-02-invalid-as-dependency.stderr index a48e25d2435..9ea0cdc5b21 100644 --- a/crates/lang/macro/tests/ui/fail/H-02-invalid-as-dependency.stderr +++ b/crates/lang/macro/tests/ui/fail/H-02-invalid-as-dependency.stderr @@ -1,4 +1,4 @@ -error: expected a bool literal for `compile_as_dependency` ink! config argument +error: expected a bool literal for `compile_as_dependency` ink! configuration argument --> $DIR/H-02-invalid-as-dependency.rs:3:17 | 3 | #[ink::contract(compile_as_dependency = "yes")] diff --git a/crates/lang/macro/tests/ui/fail/S-02-multiple-storage-structs.rs b/crates/lang/macro/tests/ui/fail/S-02-multiple-storage-structs.rs index 78b59d1adf2..8bb6b0ea8c5 100644 --- a/crates/lang/macro/tests/ui/fail/S-02-multiple-storage-structs.rs +++ b/crates/lang/macro/tests/ui/fail/S-02-multiple-storage-structs.rs @@ -5,7 +5,7 @@ mod multiple_storage_structs { #[ink(storage)] pub struct FirstStorageStruct {} - // ink! currently doesn't allow for multiple #[ink(storage)] structs + // ink! currently does not allow for multiple #[ink(storage)] structs #[ink(storage)] pub struct SecondStorageStruct {} diff --git a/crates/lang/macro/tests/ui/fail/S-04-non-storage-ink-impls.rs b/crates/lang/macro/tests/ui/fail/S-04-non-storage-ink-impls.rs index 2b1bdb45014..b3439f06de8 100644 --- a/crates/lang/macro/tests/ui/fail/S-04-non-storage-ink-impls.rs +++ b/crates/lang/macro/tests/ui/fail/S-04-non-storage-ink-impls.rs @@ -2,13 +2,13 @@ use ink_lang as ink; #[ink::contract] mod non_storage_ink_impls { - // This test ensures that ink! impl blocks are always + // This test ensures that ink! `impl` blocks are always // implemented on the only storage struct definition. #[ink(storage)] pub struct StorageStruct {} - // This ink! impl block is okay. + // This ink! `impl` block is okay. impl StorageStruct { #[ink(constructor)] pub fn constructor1() -> Self { @@ -19,10 +19,10 @@ mod non_storage_ink_impls { pub fn message1(&self) {} } - // Missing the #[ink(storage)] attribute on purpose. + // Missing the `#[ink(storage)]` attribute on purpose. pub struct NonStorageStruct {} - // This ink! impl block is invalid in that it implements + // This ink! `impl` block is invalid in that it implements // the messages and constructors for a non-existing ink! // storage struct. We expect a failure here. impl NonStorageStruct { diff --git a/crates/lang/src/env_access.rs b/crates/lang/src/env_access.rs index c59c6b72ce6..cff3ae743bb 100644 --- a/crates/lang/src/env_access.rs +++ b/crates/lang/src/env_access.rs @@ -195,11 +195,11 @@ where /// /// # Parameters /// - /// - `at_refcount`: The refcount assumed for the returned `custom_refcount_*` fields. + /// - `at_refcount`: The `refcount` assumed for the returned `custom_refcount_*` fields. /// If `None` is supplied the `custom_refcount_*` fields will also be `None`. /// /// The `current_*` fields of `RentStatus` do **not** consider changes to the code's - /// refcount made during the currently running call. + /// `refcount` made during the currently running call. /// /// # Note /// diff --git a/crates/storage/src/collections/binary_heap/tests.rs b/crates/storage/src/collections/binary_heap/tests.rs index 47e48cde7d4..d60a74f2aca 100644 --- a/crates/storage/src/collections/binary_heap/tests.rs +++ b/crates/storage/src/collections/binary_heap/tests.rs @@ -446,7 +446,7 @@ fn push_largest_value_complexity_big_o_log_n() -> ink_env::Result<()> { const CONST_READS: usize = 5; // 1 elements.len + 1 cell which was pushed to - // vec.len doesn't get larger because no cell is added + // vec.len does not get larger because no cell is added const CONST_WRITES: usize = 2; for (n, log_n) in &[(2, 1), (4, 2), (8, 3), (16, 4), (32, 5), (64, 6)] { @@ -472,7 +472,7 @@ fn push_smallest_value_complexity_big_o_1() -> ink_env::Result<()> { const EXPECTED_READS: usize = 6; // binary heap len + one cell - // vec.len doesn't get larger because no cell is added + // vec.len does not get larger because no cell is added const EXPECTED_WRITES: usize = 2; for n in &[2, 4, 8, 16, 32, 64] { diff --git a/crates/storage/src/collections/bitstash/mod.rs b/crates/storage/src/collections/bitstash/mod.rs index ec6033534f9..53cde67b054 100644 --- a/crates/storage/src/collections/bitstash/mod.rs +++ b/crates/storage/src/collections/bitstash/mod.rs @@ -126,7 +126,7 @@ impl BitStash { .set(); index as u32 + first_zero as u32 } else { - // We found a free storage slot but it isn't within the valid + // We found a free storage slot but it is not within the valid // bounds of the free list but points to its end. So we simply // append another 1 bit (`true`) to the free list and return // a new index pointing to it. No need to push to the counts diff --git a/crates/storage/src/lazy/lazy_cell.rs b/crates/storage/src/lazy/lazy_cell.rs index 7fd912a2c7f..6a2301a3102 100644 --- a/crates/storage/src/lazy/lazy_cell.rs +++ b/crates/storage/src/lazy/lazy_cell.rs @@ -37,7 +37,7 @@ use ink_primitives::Key; /// /// # Note /// -/// Use this if the storage field doesn't need to be loaded in some or most cases. +/// Use this if the storage field does not need to be loaded in some or most cases. pub struct LazyCell where T: SpreadLayout, diff --git a/crates/storage/src/lazy/mod.rs b/crates/storage/src/lazy/mod.rs index f3dcf5d13e6..46ce97862e2 100644 --- a/crates/storage/src/lazy/mod.rs +++ b/crates/storage/src/lazy/mod.rs @@ -59,7 +59,7 @@ use ink_primitives::Key; /// /// # Note /// -/// Use this if the storage field doesn't need to be loaded in some or most cases. +/// Use this if the storage field does not need to be loaded in some or most cases. #[derive(Debug)] pub struct Lazy where diff --git a/crates/storage/src/traits/optspec.rs b/crates/storage/src/traits/optspec.rs index 5736dfde424..3e28a9d86ce 100644 --- a/crates/storage/src/traits/optspec.rs +++ b/crates/storage/src/traits/optspec.rs @@ -45,7 +45,7 @@ where Some(value) => { // Handle the Option as if it was a T. // - // Sadly this doesn't not work well with `Option>`. + // Sadly this does not not work well with `Option>`. // For this we'd need specialization in Rust or similar. super::push_spread_root(value, root_key) } @@ -123,7 +123,7 @@ where Some(value) => { // Handle the Option as if it was a T. // - // Sadly this doesn't not work well with `Option>`. + // Sadly this does not work well with `Option>`. // For this we'd need specialization in Rust or similar. super::push_packed_root(value, root_key) } diff --git a/examples/delegator/lib.rs b/examples/delegator/lib.rs index 5977932e009..ead0c377263 100644 --- a/examples/delegator/lib.rs +++ b/examples/delegator/lib.rs @@ -29,9 +29,9 @@ mod delegator { }; use subber::Subber; - /// Specifies the state of the delegator. + /// Specifies the state of the `delegator` contract. /// - /// In `Adder` state the delegator will delegate to the `Adder` contract + /// In `Adder` state the `delegator` contract will delegate to the `Adder` contract /// and in `Subber` state will delegate to the `Subber` contract. /// /// The initial state is `Adder`. @@ -58,11 +58,11 @@ mod delegator { /// Delegates calls to an `adder` or `subber` contract to mutate /// a value in an `accumulator` contract. /// - /// In order to deploy the delegator smart contract we first + /// In order to deploy the `delegator` smart contract we first /// have to manually put the code of the `accumulator`, `adder` /// and `subber` smart contracts, receive their code hashes from /// the signalled events and put their code hash into our - /// delegator smart contract. + /// `delegator` smart contract. #[ink(storage)] pub struct Delegator { /// Says which of `adder` or `subber` is currently in use. @@ -76,7 +76,7 @@ mod delegator { } impl Delegator { - /// Instantiate a delegator with the given sub-contract codes. + /// Instantiate a `delegator` contract with the given sub-contract codes. #[ink(constructor)] pub fn new( init_value: i32, @@ -128,7 +128,7 @@ mod delegator { } } - /// Switches the delegator. + /// Switches the `delegator` contract. #[ink(message)] pub fn switch(&mut self) { match self.which { diff --git a/examples/dns/lib.rs b/examples/dns/lib.rs index 8409f2cf08c..d3e6618a14a 100644 --- a/examples/dns/lib.rs +++ b/examples/dns/lib.rs @@ -58,8 +58,8 @@ mod dns { new_owner: AccountId, } - /// Domain name service contract inspired by ChainX's - /// [blog post](https://medium.com/@chainx_org/secure-and-decentralized-polkadot-domain-name-system-e06c35c2a48d). + /// Domain name service contract inspired by + /// [this blog post](https://medium.com/@chainx_org/secure-and-decentralized-polkadot-domain-name-system-e06c35c2a48d). /// /// # Note /// diff --git a/examples/multisig_plain/lib.rs b/examples/multisig_plain/lib.rs index 22612b1e47f..08c28f89086 100755 --- a/examples/multisig_plain/lib.rs +++ b/examples/multisig_plain/lib.rs @@ -40,7 +40,7 @@ //! //! ## Interface //! -//! The interface is modelled after the popular gnosis multisig wallet. However, there +//! The interface is modelled after the popular Gnosis multisig wallet. However, there //! are subtle variations from the interface. For example the `confirm_transaction` //! will never trigger the execution of a `Transaction` even if the threshold is reached. //! A call of `execute_transaction` is always required. This can be called by anyone. @@ -107,7 +107,7 @@ mod multisig_plain { /// A wrapper that allows us to encode a blob of bytes. /// - /// We use this to pass the set of not typed (bytes) parameters to the `CallBuilder`. + /// We use this to pass the set of untyped (bytes) parameters to the `CallBuilder`. struct CallInput<'a>(&'a [u8]); impl<'a> scale::Encode for CallInput<'a> {