Fix typos in pallet-contracts (#13629)

* Fix typos in pallet-contracts
This commit is contained in:
PG Herveou
2023-03-17 16:31:51 +01:00
committed by GitHub
parent 5378c64c39
commit f5773795e9
14 changed files with 37 additions and 37 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ use sp_runtime::traits::{Hash, TrailingZeroInput};
pub trait AddressGenerator<T: Config> {
/// The address of a contract based on the given instantiate parameters.
///
/// Changing the formular for an already deployed chain is fine as long as no collisons
/// Changing the formular for an already deployed chain is fine as long as no collisions
/// with the old formular. Changes only affect existing contracts.
fn contract_address(
deploying_address: &T::AccountId,
@@ -39,7 +39,7 @@ use wasm_instrument::{
},
};
/// The location where to put the genrated code.
/// The location where to put the generated code.
pub enum Location {
/// Generate all code into the `call` exported function.
Call,
@@ -355,7 +355,7 @@ benchmarks! {
}: _(origin, callee, value, Weight::MAX, None, data)
verify {
let deposit = T::Currency::free_balance(&deposit_account);
// value and value transfered via call should be removed from the caller
// value and value transferred via call should be removed from the caller
assert_eq!(
T::Currency::free_balance(&instance.caller),
caller_funding::<T>() - instance.value - value - deposit - Pallet::<T>::min_balance(),
@@ -2224,7 +2224,7 @@ benchmarks! {
// the same amount of time. We follow that `t.load` and `drop` both have the weight
// of this benchmark / 2. We need to make this assumption because there is no way
// to measure them on their own using a valid wasm module. We need their individual
// values to derive the weight of individual instructions (by substraction) from
// values to derive the weight of individual instructions (by subtraction) from
// benchmarks that include those for parameter pushing and return type dropping.
// We call the weight of `t.load` and `drop`: `w_param`.
// The weight that would result from the respective benchmark we call: `w_bench`.
@@ -3003,9 +3003,9 @@ benchmarks! {
sbox.invoke();
}
// This is no benchmark. It merely exist to have an easy way to pretty print the curently
// This is no benchmark. It merely exist to have an easy way to pretty print the currently
// configured `Schedule` during benchmark development.
// It can be outputed using the following command:
// It can be outputted using the following command:
// cargo run --manifest-path=bin/node/cli/Cargo.toml \
// --features runtime-benchmarks -- benchmark pallet --extra --dev --execution=native \
// -p pallet_contracts -e print_schedule --no-median-slopes --no-min-squares
@@ -138,7 +138,7 @@ pub trait ChainExtension<C: Config> {
///
/// # Note
///
/// Currently, we support tuples of up to ten registred chain extensions. If more chain extensions
/// Currently, we support tuples of up to ten registered chain extensions. If more chain extensions
/// are needed consider opening an issue.
pub trait RegisteredChainExtension<C: Config>: ChainExtension<C> {
/// The extensions globally unique identifier.
+5 -5
View File
@@ -84,14 +84,14 @@ where
pub enum ErrorOrigin {
/// Caller error origin.
///
/// The error happened in the current exeuction context rather than in the one
/// The error happened in the current execution context rather than in the one
/// of the contract that is called into.
Caller,
/// The error happened during execution of the called contract.
Callee,
}
/// Error returned by contract exection.
/// Error returned by contract execution.
#[cfg_attr(test, derive(Debug, PartialEq))]
pub struct ExecError {
/// The reason why the execution failed.
@@ -2455,7 +2455,7 @@ mod tests {
#[test]
fn in_memory_changes_not_discarded() {
// Call stack: BOB -> CHARLIE (trap) -> BOB' (success)
// This tests verfies some edge case of the contract info cache:
// This tests verifies some edge case of the contract info cache:
// We change some value in our contract info before calling into a contract
// that calls into ourself. This triggers a case where BOBs contract info
// is written to storage and invalidated by the successful execution of BOB'.
@@ -3405,7 +3405,7 @@ mod tests {
let code_hash = MockLoader::insert(Call, move |ctx, _| {
// It is set to one when this contract was instantiated by `place_contract`
assert_eq!(ctx.ext.nonce(), 1);
// Should not change without any instantation in-between
// Should not change without any instantiation in-between
assert_eq!(ctx.ext.nonce(), 1);
// Should not change with a failed instantiation
assert_err!(
@@ -3416,7 +3416,7 @@ mod tests {
}
);
assert_eq!(ctx.ext.nonce(), 1);
// Successful instantation increments
// Successful instantiation increments
ctx.ext.instantiate(Weight::zero(), success_code, 0, vec![], &[]).unwrap();
assert_eq!(ctx.ext.nonce(), 2);
exec_success()
+3 -3
View File
@@ -403,7 +403,7 @@ pub mod pallet {
T::MaxCodeLen::get(),
);
// Debug buffer should at least be large enough to accomodate a simple error message
// Debug buffer should at least be large enough to accommodate a simple error message
const MIN_DEBUG_BUF_SIZE: u32 = 256;
assert!(
T::MaxDebugBufferLen::get() > MIN_DEBUG_BUF_SIZE,
@@ -891,7 +891,7 @@ pub mod pallet {
/// The contract's code was found to be invalid during validation or instrumentation.
///
/// The most likely cause of this is that an API was used which is not supported by the
/// node. This hapens if an older node is used with a new version of ink!. Try updating
/// node. This happens if an older node is used with a new version of ink!. Try updating
/// your node to the newest available version.
///
/// A more detailed error can be found on the node console if debug messages are enabled
@@ -987,7 +987,7 @@ struct InternalOutput<T: Config, O> {
result: Result<O, ExecError>,
}
/// Helper trait to wrap contract execution entry points into a signle function
/// Helper trait to wrap contract execution entry points into a single function
/// [`Invokable::run_guarded`].
trait Invokable<T: Config> {
/// What is returned as a result of a successful invocation.
@@ -513,7 +513,7 @@ impl<T: Config> Ext<T> for ReservingExt {
// we make sure to leave at least the ed in the free balance.
//
// The sender always has enough balance because we track it in the `ContractInfo` and
// never send more back than we have. Noone has access to the deposit account. Hence no
// never send more back than we have. No one has access to the deposit account. Hence no
// other interaction with this account takes place.
Deposit::Refund(amount) => {
if terminated {
+2 -2
View File
@@ -186,7 +186,7 @@ impl<T: Config> PrefabWasmModule<T> {
code_cache::try_remove::<T>(origin, code_hash)
}
/// Returns whether there is a deposit to be payed for this module.
/// Returns whether there is a deposit to be paid for this module.
///
/// Returns `0` if the module is already in storage and hence no deposit will
/// be charged when storing it.
@@ -689,7 +689,7 @@ mod tests {
executable.execute(ext.borrow_mut(), entry_point, input_data)
}
/// Execute the suppplied code.
/// Execute the supplied code.
fn execute<E: BorrowMut<MockExt>>(wat: &str, input_data: Vec<u8>, ext: E) -> ExecResult {
execute_internal(wat, input_data, ext, &ExportedFunction::Call, true, false)
}
@@ -50,7 +50,7 @@ pub enum TryInstantiate {
Instantiate,
/// Skip the instantiation during preparation.
///
/// This makes sense when the preparation takes place as part of an instantation. Then
/// This makes sense when the preparation takes place as part of an instantiation. Then
/// this instantiation would fail the whole transaction and an extra check is not
/// necessary.
Skip,
@@ -376,7 +376,7 @@ fn get_memory_limits<T: Config>(
},
}
} else {
// If none memory imported then just crate an empty placeholder.
// If none memory imported then just create an empty placeholder.
// Any access to it will lead to out of bounds trap.
Ok((0, 0))
}
@@ -412,7 +412,7 @@ where
extended_const: false,
component_model: false,
// This is not our only defense: We check for float types later in the preparation
// process. Additionally, all instructions explictily need to have weights assigned
// process. Additionally, all instructions explicitly need to have weights assigned
// or the deployment will fail. We have none assigned for float instructions.
deterministic_only: matches!(determinism, Determinism::Deterministic),
mutable_global: false,
@@ -1336,7 +1336,7 @@ pub mod env {
///
/// # Parameters
///
/// - `flags`: See `crate::wasm::runtime::CallFlags` for a documenation of the supported flags.
/// - `flags`: See `crate::wasm::runtime::CallFlags` for a documentation of the supported flags.
/// - `callee_ptr`: a pointer to the address of the callee contract. Should be decodable as an
/// `T::AccountId`. Traps otherwise.
/// - `gas`: how much gas to devote to the execution.
@@ -2038,7 +2038,7 @@ pub mod env {
/// # Note
///
/// The state rent functionality was removed. This is stub only exists for
/// backwards compatiblity
/// backwards compatibility
#[prefixed_alias]
#[deprecated]
fn restore_to(
@@ -2062,7 +2062,7 @@ pub mod env {
/// # Note
///
/// The state rent functionality was removed. This is stub only exists for
/// backwards compatiblity
/// backwards compatibility
#[version(1)]
#[prefixed_alias]
#[deprecated]
@@ -2084,7 +2084,7 @@ pub mod env {
/// # Note
///
/// The state rent functionality was removed. This is stub only exists for
/// backwards compatiblity.
/// backwards compatibility.
#[prefixed_alias]
#[deprecated]
fn set_rent_allowance(
@@ -2102,7 +2102,7 @@ pub mod env {
/// # Note
///
/// The state rent functionality was removed. This is stub only exists for
/// backwards compatiblity.
/// backwards compatibility.
#[version(1)]
#[prefixed_alias]
#[deprecated]
@@ -2116,7 +2116,7 @@ pub mod env {
/// # Note
///
/// The state rent functionality was removed. This is stub only exists for
/// backwards compatiblity.
/// backwards compatibility.
#[prefixed_alias]
#[deprecated]
fn rent_allowance(ctx: _, memory: _, out_ptr: u32, out_len_ptr: u32) -> Result<(), TrapReason> {
@@ -2409,7 +2409,7 @@ pub mod env {
///
/// # Return Value
///
/// Returns `ReturnCode::Success` when the dispatchable was succesfully executed and
/// Returns `ReturnCode::Success` when the dispatchable was successfully executed and
/// returned `Ok`. When the dispatchable was exeuted but returned an error
/// `ReturnCode::CallRuntimeFailed` is returned. The full error is not
/// provided because it is not guaranteed to be stable.
@@ -2603,7 +2603,7 @@ pub mod env {
/// Returns a nonce that is unique per contract instantiation.
///
/// The nonce is incremented for each succesful contract instantiation. This is a
/// The nonce is incremented for each successful contract instantiation. This is a
/// sensible default salt for contract instantiations.
#[unstable]
fn instantiation_nonce(ctx: _, _memory: _) -> Result<u64, TrapReason> {