Skip to content

Commit

Permalink
Correct all obvious typos
Browse files Browse the repository at this point in the history
  • Loading branch information
aumetra committed Sep 17, 2024
1 parent 004f787 commit bdd78fc
Show file tree
Hide file tree
Showing 38 changed files with 47 additions and 47 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG-pre1.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ and this project adheres to
with this change, the `backtraces` feature now requires Rust nightly.
- Rename `StdError::ParseErr::source` to `StdError::ParseErr::source_type` and
`StdError::SerializeErr::target` to `StdError::SerializeErr::target_type` to
work around speacial treatment of the field name `source` in thiserror.
work around special treatment of the field name `source` in thiserror.
- Rename `Extern` to `Deps` to unify naming.
- Simplify ownership of calling `handle`, etc. with `Deps` and `DepsMut` struct
that just contains references (`DepsMut` has `&mut Storage` otherwise the
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ and this project adheres to
- all: Bump a few dependency versions to make the codebase compile with
`-Zminimal-versions` ([#1465]).
- cosmwasm-profiler: Package was removed 🪦. It served its job showing us that
we cannot properly measure different runtimes for differet Wasm opcodes.
we cannot properly measure different runtimes for different Wasm opcodes.
- cosmwasm-schema: schema generation is now locked to produce strictly
`draft-07` schemas
- cosmwasm-schema: `QueryResponses` derive now sets the `JsonSchema` trait bound
Expand Down
4 changes: 2 additions & 2 deletions IBC.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub enum IbcMsg {
/// We cannot select the port_id, this is whatever the local chain has bound the ibctransfer
/// module to.
Transfer {
/// exisiting channel to send the tokens over
/// existing channel to send the tokens over
channel_id: String,
/// address on the remote chain to receive these tokens
to_address: String,
Expand Down Expand Up @@ -385,7 +385,7 @@ produced 3 suggestions on how to handle errors and rollbacks _inside
`submessage` and capture the error. This approach requires we use _exactly
one_ submessage. If we have multiple, we may commit #1 and rollback #2 (see
example 3 for that case). The main point is moving `messages` to
`submessages` and reformating the error in `reply`. Note that if you set the
`submessages` and reformatting the error in `reply`. Note that if you set the
`Response.data` field in `reply` it will override the acknowledgement
returned from the parent call. (See
[bottom of reply section](./SEMANTICS.md#handling-the-reply)). You can see a
Expand Down
8 changes: 4 additions & 4 deletions MIGRATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -1342,7 +1342,7 @@ arbitrary ones.

- The block time in `env.block.time` is now a `Timestamp` which stores
nanosecond precision. `env.block.time_nanos` was removed. If you need the
compnents as before, use
components as before, use
```rust
let seconds = env.block.time.nanos() / 1_000_000_000;
let nsecs = env.block.time.nanos() % 1_000_000_000;
Expand Down Expand Up @@ -1456,7 +1456,7 @@ arbitrary ones.
- Contracts now support any custom error type `E: ToString + From<StdError>`.
Previously this has been `StdError`, which you can still use. However, you can
now create a much more structured error experience for your unit tests that
handels exactly the error cases of your contract. In order to get a convenient
handles exactly the error cases of your contract. In order to get a convenient
implementation for `ToString` and `From<StdError>`, we use the crate
[thiserror](https://crates.io/crates/thiserror), which needs to be added to
the contracts dependencies in `Cargo.toml`. To create the custom error, create
Expand Down Expand Up @@ -1492,8 +1492,8 @@ arbitrary ones.
- `fn handle`: `Result<HandleResponse, MyCustomError>`,
- `fn query`: `Result<Binary, MyCustomError>`.

If one of your funtions does not use the custom error, you can continue to use
`StdError` as before. I.e. you can have `handle` returning
If one of your functions does not use the custom error, you can continue to
use `StdError` as before. I.e. you can have `handle` returning
`Result<HandleResponse, MyCustomError>` and `query` returning
`StdResult<Binary>`.

Expand Down
2 changes: 1 addition & 1 deletion contracts/burner/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! Then running `cargo integration-test` will validate we can properly call into that generated Wasm.
//!
//! You can easily convert unit tests to integration tests.
//! 1. First copy them over verbatum,
//! 1. First copy them over verbatim,
//! 2. Then change
//! let mut deps = mock_dependencies(20, &[]);
//! to
Expand Down
2 changes: 1 addition & 1 deletion contracts/crypto-verify/src/webauthn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub fn verify(
//
// - the length of the encoded bytes being correct
// - the point being an element of the curve
// - the conversion from the encoded coorinate to an affine point succeeding
// - the conversion from the encoded coordinate to an affine point succeeding
// - the affine point actually being a valid public key
// - the signature could actually exist like this for a secp256r1 ECDSA key
//
Expand Down
2 changes: 1 addition & 1 deletion contracts/empty/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! Then running `cargo integration-test` will validate we can properly call into that generated Wasm.
//!
//! You can easily convert unit tests to integration tests.
//! 1. First copy them over verbatum,
//! 1. First copy them over verbatim,
//! 2. Then change
//! let mut deps = mock_dependencies(20, &[]);
//! to
Expand Down
2 changes: 1 addition & 1 deletion contracts/ibc-callbacks/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! Then running `cargo integration-test` will validate we can properly call into that generated Wasm.
//!
//! You can easily convert unit tests to integration tests.
//! 1. First copy them over verbatum,
//! 1. First copy them over verbatim,
//! 2. Then change
//! let mut deps = mock_dependencies(20, &[]);
//! to
Expand Down
2 changes: 1 addition & 1 deletion contracts/ibc-reflect-send/src/ibc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub const IBC_APP_VERSION: &str = "ibc-reflect-v1";
pub const PACKET_LIFETIME: u64 = 60 * 60;

#[entry_point]
/// enforces ordering and versioing constraints
/// enforces ordering and versioning constraints
pub fn ibc_channel_open(
_deps: DepsMut,
_env: Env,
Expand Down
2 changes: 1 addition & 1 deletion contracts/ibc-reflect-send/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub const KEY_CONFIG: &[u8] = b"config";
/// accounts is lookup of channel_id to reflect contract
pub const PREFIX_ACCOUNTS: &[u8] = b"accounts";
/// Upper bound for ranging over accounts
const PREFIX_ACCOUNTS_UPPER_BOUND: &[u8] = b"accountt";
const PREFIX_ACCOUNTS_UPPER_BOUND: &[u8] = b"account";

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]
pub struct Config {
Expand Down
2 changes: 1 addition & 1 deletion contracts/ibc-reflect-send/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! Then running `cargo integration-test` will validate we can properly call into that generated Wasm.
//!
//! You can easily convert unit tests to integration tests.
//! 1. First copy them over verbatum,
//! 1. First copy them over verbatim,
//! 2. Then change
//! let mut deps = mock_dependencies(20, &[]);
//! to
Expand Down
4 changes: 2 additions & 2 deletions contracts/ibc-reflect/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ pub fn query_list_accounts(deps: Deps) -> StdResult<ListAccountsResponse> {
}

#[entry_point]
/// enforces ordering and versioing constraints
/// enforces ordering and versioning constraints
pub fn ibc_channel_open(
_deps: DepsMut,
_env: Env,
Expand Down Expand Up @@ -250,7 +250,7 @@ pub fn migrate(_deps: DepsMut, _env: Env, _msg: Empty) -> StdResult<Response> {
Ok(Response::default())
}

// this encode an error or error message into a proper acknowledgement to the recevier
// this encode an error or error message into a proper acknowledgement to the receiver
fn encode_ibc_error(msg: impl Into<String>) -> Binary {
// this cannot error, unwrap to keep the interface simple
to_json_binary(&AcknowledgementMsg::<()>::Error(msg.into())).unwrap()
Expand Down
2 changes: 1 addition & 1 deletion contracts/ibc-reflect/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub const KEY_CONFIG: &[u8] = b"config";
pub const KEY_PENDING_CHANNEL: &[u8] = b"pending";
pub const PREFIX_ACCOUNTS: &[u8] = b"accounts";
/// Upper bound for ranging over accounts
const PREFIX_ACCOUNTS_UPPER_BOUND: &[u8] = b"accountt";
const PREFIX_ACCOUNTS_UPPER_BOUND: &[u8] = b"account";

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
pub struct Config {
Expand Down
2 changes: 1 addition & 1 deletion contracts/ibc-reflect/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! Then running `cargo integration-test` will validate we can properly call into that generated Wasm.
//!
//! You can easily convert unit tests to integration tests.
//! 1. First copy them over verbatum,
//! 1. First copy them over verbatim,
//! 2. Then change
//! let mut deps = mock_dependencies(20, &[]);
//! to
Expand Down
2 changes: 1 addition & 1 deletion contracts/reflect/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ mod tests {
let res = reply(deps.as_mut(), mock_env(), the_reply).unwrap();
assert_eq!(0, res.messages.len());

// query for a non-existant id
// query for a non-existent id
let qres = query(
deps.as_ref(),
mock_env(),
Expand Down
2 changes: 1 addition & 1 deletion contracts/reflect/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ fn reply_and_query() {
let res: Response = reply(&mut deps, mock_env(), the_reply).unwrap();
assert_eq!(0, res.messages.len());

// query for a non-existant id
// query for a non-existent id
let qres = query(&mut deps, mock_env(), QueryMsg::SubMsgResult { id: 65432 });
assert!(qres.is_err());

Expand Down
2 changes: 1 addition & 1 deletion contracts/staking/schema/raw/instantiate.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
]
},
"min_withdrawal": {
"description": "This is the minimum amount we will pull out to reinvest, as well as a minumum that can be unbonded (to avoid needless staking tx)",
"description": "This is the minimum amount we will pull out to reinvest, as well as a minimum that can be unbonded (to avoid needless staking tx)",
"allOf": [
{
"$ref": "#/definitions/Uint128"
Expand Down
2 changes: 1 addition & 1 deletion contracts/staking/schema/raw/response_to_investment.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
]
},
"min_withdrawal": {
"description": "This is the minimum amount we will pull out to reinvest, as well as a minumum that can be unbonded (to avoid needless staking tx)",
"description": "This is the minimum amount we will pull out to reinvest, as well as a minimum that can be unbonded (to avoid needless staking tx)",
"allOf": [
{
"$ref": "#/definitions/Uint128"
Expand Down
4 changes: 2 additions & 2 deletions contracts/staking/schema/staking.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
]
},
"min_withdrawal": {
"description": "This is the minimum amount we will pull out to reinvest, as well as a minumum that can be unbonded (to avoid needless staking tx)",
"description": "This is the minimum amount we will pull out to reinvest, as well as a minimum that can be unbonded (to avoid needless staking tx)",
"allOf": [
{
"$ref": "#/definitions/Uint128"
Expand Down Expand Up @@ -322,7 +322,7 @@
]
},
"min_withdrawal": {
"description": "This is the minimum amount we will pull out to reinvest, as well as a minumum that can be unbonded (to avoid needless staking tx)",
"description": "This is the minimum amount we will pull out to reinvest, as well as a minimum that can be unbonded (to avoid needless staking tx)",
"allOf": [
{
"$ref": "#/definitions/Uint128"
Expand Down
2 changes: 1 addition & 1 deletion contracts/staking/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ pub fn unbond(deps: DepsMut, env: Env, info: MessageInfo, amount: Uint128) -> St
let sender_raw = deps.api.addr_canonicalize(info.sender.as_str())?;
let owner_raw = deps.api.addr_canonicalize(invest.owner.as_str())?;

// calculate tax and remainer to unbond
// calculate tax and remainder to unbond
let tax = amount.mul_floor(invest.exit_tax);

// deduct all from the account
Expand Down
4 changes: 2 additions & 2 deletions contracts/staking/src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub struct InstantiateMsg {
/// this is how much the owner takes as a cut when someone unbonds
/// TODO
pub exit_tax: Decimal,
/// This is the minimum amount we will pull out to reinvest, as well as a minumum
/// This is the minimum amount we will pull out to reinvest, as well as a minimum
/// that can be unbonded (to avoid needless staking tx)
pub min_withdrawal: Uint128,
}
Expand Down Expand Up @@ -99,7 +99,7 @@ pub struct InvestmentResponse {
pub exit_tax: Decimal,
/// All tokens are bonded to this validator
pub validator: String,
/// This is the minimum amount we will pull out to reinvest, as well as a minumum
/// This is the minimum amount we will pull out to reinvest, as well as a minimum
/// that can be unbonded (to avoid needless staking tx)
pub min_withdrawal: Uint128,
}
2 changes: 1 addition & 1 deletion contracts/staking/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub struct InvestmentInfo {
/// All tokens are bonded to this validator
/// addr_humanize/addr_canonicalize doesn't work for validator addrresses (e.g. cosmosvaloper1...)
pub validator: String,
/// This is the minimum amount we will pull out to reinvest, as well as a minumum
/// This is the minimum amount we will pull out to reinvest, as well as a minimum
/// that can be unbonded (to avoid needless staking tx)
pub min_withdrawal: Uint128,
}
Expand Down
2 changes: 1 addition & 1 deletion docs/simulate_riffle_shuffle.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import functools

# Create a function that executed f recusively n times, i.e. f**n
# Create a function that executed f recursively n times, i.e. f**n
def power(f, n):
functions = [f for _ in range(n)]
def compose2(f, g):
Expand Down
2 changes: 1 addition & 1 deletion packages/crypto/src/ed25519.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub fn ed25519_verify(message: &[u8], signature: &[u8], public_key: &[u8]) -> Cr
/// In the limiting case where all signatures in the batch are made with the same verification key,
/// coalesced batch verification runs twice as fast as ordinary batch verification.
///
/// Three Variants are suppported in the input for convenience:
/// Three Variants are supported in the input for convenience:
/// - Equal number of messages, signatures, and public keys: Standard, generic functionality.
/// - One message, and an equal number of signatures and public keys: Multiple digital signature
/// (multisig) verification of a single message.
Expand Down
2 changes: 1 addition & 1 deletion packages/go-gen/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ mod tests {
}

#[test]
fn accronym_replacement_works() {
fn acronym_replacement_works() {
#[cw_serde]
struct IbcStruct {
a: IbcSubStruct,
Expand Down
2 changes: 1 addition & 1 deletion packages/go-gen/tests/cosmwasm_std__IbcMsg.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,6 @@ type IBCTimeoutBlock struct {
// the height within the given revision
Height uint64 `json:"height"`
// the version that the client is currently on
// (eg. after reseting the chain this could increment 1 as height drops to 0)
// (eg. after resetting the chain this could increment 1 as height drops to 0)
Revision uint64 `json:"revision"`
}
2 changes: 1 addition & 1 deletion packages/schema-derive/src/query_responses/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub struct Context {
/// setting this flag will derive the implementation appropriately, collecting all
/// KV pairs from the nested enums rather than expecting `#[return]` annotations.
pub is_nested: bool,
/// Disable infering the `JsonSchema` trait bound for chosen type parameters.
/// Disable inferring the `JsonSchema` trait bound for chosen type parameters.
pub no_bounds_for: HashSet<Ident>,
}

Expand Down
2 changes: 1 addition & 1 deletion packages/schema/tests/idl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub struct MigrateMsg {
}

#[test]
fn unknown_fields_explicity_allowed() {
fn unknown_fields_explicitly_allowed() {
let json = serde_json::json!({
"admin": "someone",
"cap": 512,
Expand Down
2 changes: 1 addition & 1 deletion packages/std/src/query/distribution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pub struct DecCoin {
pub denom: String,
/// An amount in the base denom of the distributed token.
///
/// Some chains have choosen atto (10^-18) for their token's base denomination. If we used `Decimal` here, we could only store
/// Some chains have chosen atto (10^-18) for their token's base denomination. If we used `Decimal` here, we could only store
/// 340282366920938463463.374607431768211455atoken which is 340.28 TOKEN.
pub amount: Decimal256,
}
Expand Down
2 changes: 1 addition & 1 deletion packages/vm/examples/module_size.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
# Uses valgrind's massif tool to compute heap memory consumption of compiled modules.
# For a wasmer `Module`, it has been determined that this method underestimates the size
# of the module significanty.
# of the module significantly.
set -e

MAX_SNAPSHOTS=1000
Expand Down
4 changes: 2 additions & 2 deletions packages/vm/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ pub trait Storage {
fn get(&self, key: &[u8]) -> BackendResult<Option<Vec<u8>>>;

/// Allows iteration over a set of key/value pairs, either forwards or backwards.
/// Returns an interator ID that is unique within the Storage instance.
/// Returns an iterator ID that is unique within the Storage instance.
///
/// The bound `start` is inclusive and `end` is exclusive.
///
Expand Down Expand Up @@ -178,7 +178,7 @@ pub trait Querier {
/// types.
///
/// The gas limit describes how much [CosmWasm gas] this particular query is allowed
/// to comsume when measured separately from the rest of the contract.
/// to consume when measured separately from the rest of the contract.
/// The returned gas info (in BackendResult) can exceed the gas limit in cases
/// where the query could not be aborted exactly at the limit.
///
Expand Down
2 changes: 1 addition & 1 deletion packages/vm/src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ fn save_wasm_to_disk(dir: impl Into<PathBuf>, wasm: &[u8]) -> VmResult<Checksum>
let filepath = dir.into().join(filename).with_extension("wasm");

// write data to file
// Since the same filename (a collision resistent hash) cannot be generated from two different byte codes
// Since the same filename (a collision resistant hash) cannot be generated from two different byte codes
// (even if a malicious actor tried), it is safe to override.
let mut file = OpenOptions::new()
.write(true)
Expand Down
2 changes: 1 addition & 1 deletion packages/vm/src/errors/communication_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use thiserror::Error;
use super::region_validation_error::RegionValidationError;
use crate::memory::Region;

/// An error in the communcation between contract and host. Those happen around imports and exports.
/// An error in the communication between contract and host. Those happen around imports and exports.
#[derive(Error, Debug)]
#[non_exhaustive]
pub enum CommunicationError {
Expand Down
2 changes: 1 addition & 1 deletion packages/vm/src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ where
);

// Four parameters, "ps", "qs", "r", "s", which all represent elements on the BLS12-381 curve (where "ps" and "r" are elements of the G1 subgroup, and "qs" and "s" elements of G2).
// The "ps" and "qs" are interpreted as a continous list of points in the subgroups G1 and G2 respectively.
// The "ps" and "qs" are interpreted as a continuous list of points in the subgroups G1 and G2 respectively.
// Returns a single u32 which signifies the validity of the pairing equality.
// Returns 0 if the pairing equality exists, 1 if it doesnt, and any other code may be interpreted as a `CryptoError`.
env_imports.insert(
Expand Down
4 changes: 2 additions & 2 deletions packages/vm/src/testing/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub fn mock_backend(contract_balance: &[Coin]) -> Backend<MockApi, MockStorage,
}

/// Initializes the querier along with the mock_dependencies.
/// Sets all balances provided (yoy must explicitly set contract balance if desired)
/// Sets all balances provided (you must explicitly set contract balance if desired)
pub fn mock_backend_with_balances(
balances: &[(&str, &[Coin])],
) -> Backend<MockApi, MockStorage, MockQuerier> {
Expand All @@ -48,7 +48,7 @@ pub fn mock_backend_with_balances(

/// Zero-pads all human addresses to make them fit the canonical_length and
/// trims off zeros for the reverse operation.
/// This is not really smart, but allows us to see a difference (and consistent length for canonical adddresses).
/// This is not really smart, but allows us to see a difference (and consistent length for canonical addresses).
#[derive(Copy, Clone)]
pub struct MockApi(MockApiImpl);

Expand Down
2 changes: 1 addition & 1 deletion packages/vm/src/testing/querier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::{BackendError, BackendResult, GasInfo, Querier};
const GAS_COST_QUERY_FLAT: u64 = 100_000;
/// Gas per request byte
const GAS_COST_QUERY_REQUEST_MULTIPLIER: u64 = 0;
/// Gas per reponse byte
/// Gas per response byte
const GAS_COST_QUERY_RESPONSE_MULTIPLIER: u64 = 100;

/// MockQuerier holds an immutable table of bank balances
Expand Down
Loading

0 comments on commit bdd78fc

Please sign in to comment.