Skip to content

Commit

Permalink
Fix spellchecking mistakes
Browse files Browse the repository at this point in the history
  • Loading branch information
cmichi committed Jun 17, 2021
1 parent fc74ba2 commit fd13c96
Show file tree
Hide file tree
Showing 46 changed files with 150 additions and 131 deletions.
23 changes: 21 additions & 2 deletions .config/cargo_spellcheck.dic
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
60
70

WebAssembly
Wasm
Wasm32
validator
ERC
fuzzer
Expand Down Expand Up @@ -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
Expand All @@ -50,3 +64,8 @@ layout/JG
endian/P
accessor/S
NFT/S
encoding/S
blockchain/S
backend/S
namespace/S
runtime/S
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)]
Expand All @@ -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)]`.
2 changes: 1 addition & 1 deletion crates/engine/src/ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(
Expand Down
8 changes: 4 additions & 4 deletions crates/env/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
///
Expand Down Expand Up @@ -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<T>(
account_id: T::AccountId,
Expand Down Expand Up @@ -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<T>(destination: T::AccountId, value: T::Balance) -> Result<()>
Expand Down
2 changes: 1 addition & 1 deletion crates/env/src/engine/experimental_off_chain/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 <Self as HashOutput>::Type) {
Expand Down
4 changes: 2 additions & 2 deletions crates/env/src/engine/experimental_off_chain/test_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(
Expand Down Expand Up @@ -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<T, F>(f: F) -> Result<()>
where
Expand Down
4 changes: 2 additions & 2 deletions crates/env/src/engine/off_chain/db/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T>(&self, subject: &[u8]) -> Result<T::Hash>
Expand Down
2 changes: 1 addition & 1 deletion crates/env/src/engine/off_chain/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions crates/env/src/engine/off_chain/test_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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: F) -> Result<()>
where
F: FnOnce(&mut ChainSpec),
Expand Down Expand Up @@ -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) {
<EnvInstance as OnInstance>::on_instance(|instance| {
Expand Down Expand Up @@ -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<T, F>(f: F) -> Result<()>
where
Expand Down
8 changes: 4 additions & 4 deletions crates/env/src/engine/off_chain/typed_encoded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ pub struct TypedEncoded<T> {
/// - 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<TypeId>,
/// 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
Expand Down Expand Up @@ -245,7 +245,7 @@ impl<M> TypedEncoded<M> {
Ok(())
}

/// Evaluates the given clousure on the given typed encoded instances.
/// Evaluates the given closure on the given typed encoded instances.
pub fn eval<T, F, R>(&self, other: &Self, f: F) -> Result<R>
where
T: scale::Decode + 'static,
Expand All @@ -257,7 +257,7 @@ impl<M> TypedEncoded<M> {
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<T, F, R>(&mut self, other: &Self, f: F) -> Result<R>
where
Expand Down
10 changes: 5 additions & 5 deletions crates/env/src/engine/on_chain/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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> {
Expand All @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions crates/env/src/engine/on_chain/ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
///
Expand Down
2 changes: 1 addition & 1 deletion crates/env/src/engine/on_chain/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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[..])
}
Expand Down
6 changes: 3 additions & 3 deletions crates/env/src/engine/on_chain/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions crates/env/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ pub struct RentParams<T: Environment> {

/// 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.
Expand Down Expand Up @@ -322,18 +322,18 @@ pub struct RentParams<T: Environment> {
///
/// # 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<T: Environment> {
/// 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<T::Balance>,

/// Rent that is paid assuming that the contract is the only user of its code.
Expand Down
6 changes: 3 additions & 3 deletions crates/lang/codegen/src/generator/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<C>(
&self,
cws: ir::CallableWithSelector<'_, C>,
Expand Down Expand Up @@ -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.
///
Expand All @@ -271,7 +271,7 @@ impl Dispatch<'_> {
/// # ;
/// ```
///
/// **Multiple (>=2) inputs:**
/// **Multiple `(>= 2)` inputs:**
/// ```
/// # use quote::quote;
/// # let __ink_binding_0 = ();
Expand Down
4 changes: 2 additions & 2 deletions crates/lang/codegen/src/generator/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,15 +374,15 @@ mod tests {
/// line
),
syn::parse_quote!(
/// commments
/// comments
),
])
.collect::<Vec<_>>(),
vec![
" multiple".to_string(),
" single".to_string(),
" line".to_string(),
" commments".to_string(),
" comments".to_string(),
],
);
assert_eq!(
Expand Down
2 changes: 1 addition & 1 deletion crates/lang/codegen/src/generator/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading

0 comments on commit fd13c96

Please sign in to comment.