From a9845a65a346de329b896b531c39340951dc722e Mon Sep 17 00:00:00 2001 From: Christoph Otter Date: Thu, 19 Dec 2024 18:19:47 +0100 Subject: [PATCH] Fix typos --- builders/README.md | 2 +- docs/COMPILER_VERSIONS.md | 2 +- docs/MIGRATING.md | 4 ++-- internal/api/bindings.h | 4 ++-- internal/api/memory_test.go | 2 +- internal/api/mocks.go | 10 +++++----- lib.go | 2 +- lib_libwasmvm.go | 6 +++--- libwasmvm/bindings.h | 4 ++-- libwasmvm/src/examples/wasmvmstatic.rs | 2 +- libwasmvm/src/iterator.rs | 2 +- libwasmvm/src/memory.rs | 2 +- libwasmvm/src/vtables.rs | 2 +- types/ibc.go | 2 +- types/queries.go | 2 +- types/types.go | 2 +- 16 files changed, 25 insertions(+), 25 deletions(-) diff --git a/builders/README.md b/builders/README.md index e8d331e42..f85e5e2ac 100644 --- a/builders/README.md +++ b/builders/README.md @@ -149,7 +149,7 @@ See those DockerHub repos for all available versions of the builder images. ## Usage -Create the Docker images, capable of cross-compling Linux and MacOS dynamic +Create the Docker images, capable of cross-compiling Linux and MacOS dynamic libs. As the builder images are all x86_64, it can be slow and memory intense to do this on a different architecture: diff --git a/docs/COMPILER_VERSIONS.md b/docs/COMPILER_VERSIONS.md index f7db5eb5c..55f9c2159 100644 --- a/docs/COMPILER_VERSIONS.md +++ b/docs/COMPILER_VERSIONS.md @@ -54,7 +54,7 @@ supported by cosmwasm-std/cosmwasm-vm. ## Tooling Rust compiler -This Rust version is not related to our codebase directy. It's sufficiently +This Rust version is not related to our codebase directly. It's sufficiently modern to install and execute tools like `cargo-audit`. ## Versions in use diff --git a/docs/MIGRATING.md b/docs/MIGRATING.md index 9ebfe4b7e..1378fe5e2 100644 --- a/docs/MIGRATING.md +++ b/docs/MIGRATING.md @@ -64,8 +64,8 @@ where the old name was deprecated. | `SubcallResponse` | `SubMsgResponse` | Contracts do not "call" each other but send messages around | | `HumanizeAddress` | `HumanizeAddressFunc` | Follow [best practice for naming function types][ft] | | `CanonicalizeAddress` | `CanonicalizeAddressFunc` | Follow [best practice for naming function types][ft] | -| `GoAPI.HumanAddress` | `GoAPI.HumanizeAddress` | Perfer verbs for converters | -| `GoAPI.CanonicalAddress` | `GoAPI.CanonicalizeAddress` | Perfer verbs for converters | +| `GoAPI.HumanAddress` | `GoAPI.HumanizeAddress` | Prefer verbs for converters | +| `GoAPI.CanonicalAddress` | `GoAPI.CanonicalizeAddress` | Prefer verbs for converters | | `CosmosMsg.Stargate` | `CosmosMsg.Any` | The message has nothing to do with Stargate | | `StargateMsg` | `AnyMsg` | The message has nothing to do with Stargate | | `QueryResponse` | `QueryResult` | Brings consistency with the naming of the other results | diff --git a/internal/api/bindings.h b/internal/api/bindings.h index 152c8c027..c8ea8bf6e 100644 --- a/internal/api/bindings.h +++ b/internal/api/bindings.h @@ -163,7 +163,7 @@ typedef struct ByteSliceView { * ``` * * - * If you want to mutate data, you need to comsume the vector and create a new one: + * If you want to mutate data, you need to consume the vector and create a new one: * * ```rust * # use wasmvm::{UnmanagedVector}; @@ -308,7 +308,7 @@ typedef struct GoIter { struct gas_meter_t *gas_meter; /** * A reference which identifies the iterator and allows finding and accessing the - * actual iterator instance in Go. Once fully initalized, this is immutable. + * actual iterator instance in Go. Once fully initialized, this is immutable. */ struct IteratorReference reference; struct IteratorVtable vtable; diff --git a/internal/api/memory_test.go b/internal/api/memory_test.go index e1dcbfaac..397faf50c 100644 --- a/internal/api/memory_test.go +++ b/internal/api/memory_test.go @@ -50,7 +50,7 @@ func TestCreateAndDestroyUnmanagedVector(t *testing.T) { var original []byte unmanaged := newUnmanagedVector(original) require.Equal(t, cbool(true), unmanaged.is_none) - // We must not make assumtions on the other fields in this case + // We must not make assumptions on the other fields in this case copy := copyAndDestroyUnmanagedVector(unmanaged) require.Nil(t, copy) } diff --git a/internal/api/mocks.go b/internal/api/mocks.go index 2a0fb28e6..ac8500dd8 100644 --- a/internal/api/mocks.go +++ b/internal/api/mocks.go @@ -277,7 +277,7 @@ func (l *Lookup) WithGasMeter(meter MockGasMeter) *Lookup { } } -// Get wraps the underlying DB's Get method panicing on error. +// Get wraps the underlying DB's Get method panicking on error. func (l Lookup) Get(key []byte) []byte { l.meter.ConsumeGas(GetPrice, "get") v, err := l.db.Get(key) @@ -288,7 +288,7 @@ func (l Lookup) Get(key []byte) []byte { return v } -// Set wraps the underlying DB's Set method panicing on error. +// Set wraps the underlying DB's Set method panicking on error. func (l Lookup) Set(key, value []byte) { l.meter.ConsumeGas(SetPrice, "set") if err := l.db.Set(key, value); err != nil { @@ -296,7 +296,7 @@ func (l Lookup) Set(key, value []byte) { } } -// Delete wraps the underlying DB's Delete method panicing on error. +// Delete wraps the underlying DB's Delete method panicking on error. func (l Lookup) Delete(key []byte) { l.meter.ConsumeGas(RemovePrice, "remove") if err := l.db.Delete(key); err != nil { @@ -304,7 +304,7 @@ func (l Lookup) Delete(key []byte) { } } -// Iterator wraps the underlying DB's Iterator method panicing on error. +// Iterator wraps the underlying DB's Iterator method panicking on error. func (l Lookup) Iterator(start, end []byte) types.Iterator { l.meter.ConsumeGas(RangePrice, "range") iter, err := l.db.Iterator(start, end) @@ -315,7 +315,7 @@ func (l Lookup) Iterator(start, end []byte) types.Iterator { return iter } -// ReverseIterator wraps the underlying DB's ReverseIterator method panicing on error. +// ReverseIterator wraps the underlying DB's ReverseIterator method panicking on error. func (l Lookup) ReverseIterator(start, end []byte) types.Iterator { l.meter.ConsumeGas(RangePrice, "range") iter, err := l.db.ReverseIterator(start, end) diff --git a/lib.go b/lib.go index 161f36f4c..458af0740 100644 --- a/lib.go +++ b/lib.go @@ -40,7 +40,7 @@ func LibwasmvmVersion() (string, error) { // CreateChecksum performs the hashing of Wasm bytes to obtain the CosmWasm checksum. // -// Ony Wasm blobs are allowed as inputs and a magic byte check will be performed +// Only Wasm blobs are allowed as inputs and a magic byte check will be performed // to avoid accidental misusage. func CreateChecksum(wasm []byte) (Checksum, error) { if len(wasm) == 0 { diff --git a/lib_libwasmvm.go b/lib_libwasmvm.go index d07bc189f..37aee814c 100644 --- a/lib_libwasmvm.go +++ b/lib_libwasmvm.go @@ -320,11 +320,11 @@ func (vm *VM) MigrateWithInfo( return &result, gasReport.UsedInternally, nil } -// Sudo allows native Go modules to make priviledged (sudo) calls on the contract. +// Sudo allows native Go modules to make privileged (sudo) calls on the contract. // The contract can expose entry points that cannot be triggered by any transaction, but only via // native Go modules, and delegate the access control to the system. // -// These work much like Migrate (same scenario) but allows custom apps to extend the priviledged entry points +// These work much like Migrate (same scenario) but allows custom apps to extend the privileged entry points // without forking cosmwasm-vm. func (vm *VM) Sudo( checksum Checksum, @@ -354,7 +354,7 @@ func (vm *VM) Sudo( return &result, gasReport.UsedInternally, nil } -// Reply allows the native Go wasm modules to make a priviledged call to return the result +// Reply allows the native Go wasm modules to make a privileged call to return the result // of executing a SubMsg. // // These work much like Sudo (same scenario) but focuses on one specific case (and one message type) diff --git a/libwasmvm/bindings.h b/libwasmvm/bindings.h index 152c8c027..c8ea8bf6e 100644 --- a/libwasmvm/bindings.h +++ b/libwasmvm/bindings.h @@ -163,7 +163,7 @@ typedef struct ByteSliceView { * ``` * * - * If you want to mutate data, you need to comsume the vector and create a new one: + * If you want to mutate data, you need to consume the vector and create a new one: * * ```rust * # use wasmvm::{UnmanagedVector}; @@ -308,7 +308,7 @@ typedef struct GoIter { struct gas_meter_t *gas_meter; /** * A reference which identifies the iterator and allows finding and accessing the - * actual iterator instance in Go. Once fully initalized, this is immutable. + * actual iterator instance in Go. Once fully initialized, this is immutable. */ struct IteratorReference reference; struct IteratorVtable vtable; diff --git a/libwasmvm/src/examples/wasmvmstatic.rs b/libwasmvm/src/examples/wasmvmstatic.rs index cb664e2d4..441dfda88 100644 --- a/libwasmvm/src/examples/wasmvmstatic.rs +++ b/libwasmvm/src/examples/wasmvmstatic.rs @@ -1,5 +1,5 @@ // This is an entry point into the library in order to set -// crate-type = ["staticlib"] via a command line arument. +// crate-type = ["staticlib"] via a command line argument. // See `--example wasmvmstatic` pub use wasmvm::*; diff --git a/libwasmvm/src/iterator.rs b/libwasmvm/src/iterator.rs index 408d7c4e7..def6751fe 100644 --- a/libwasmvm/src/iterator.rs +++ b/libwasmvm/src/iterator.rs @@ -58,7 +58,7 @@ impl Vtable for IteratorVtable {} pub struct GoIter { pub gas_meter: *mut gas_meter_t, /// A reference which identifies the iterator and allows finding and accessing the - /// actual iterator instance in Go. Once fully initalized, this is immutable. + /// actual iterator instance in Go. Once fully initialized, this is immutable. pub reference: IteratorReference, pub vtable: IteratorVtable, } diff --git a/libwasmvm/src/memory.rs b/libwasmvm/src/memory.rs index b2e15ba64..9483ec37b 100644 --- a/libwasmvm/src/memory.rs +++ b/libwasmvm/src/memory.rs @@ -180,7 +180,7 @@ impl U8SliceView { /// ``` /// /// -/// If you want to mutate data, you need to comsume the vector and create a new one: +/// If you want to mutate data, you need to consume the vector and create a new one: /// /// ```rust /// # use wasmvm::{UnmanagedVector}; diff --git a/libwasmvm/src/vtables.rs b/libwasmvm/src/vtables.rs index 4763a6877..eca736ff3 100644 --- a/libwasmvm/src/vtables.rs +++ b/libwasmvm/src/vtables.rs @@ -6,7 +6,7 @@ /// In fact, in Go we create a single global vtable variable holding and owning the /// function the vtables in Rust point to. /// -/// The `Vtable` trait is created to find those vtables troughout the codebase. +/// The `Vtable` trait is created to find those vtables throughout the codebase. /// /// ## Nullability /// diff --git a/types/ibc.go b/types/ibc.go index 4fc69acae..0b9df4956 100644 --- a/types/ibc.go +++ b/types/ibc.go @@ -206,7 +206,7 @@ const ( // Ordering is (revision_number, timeout_height) type IBCTimeoutBlock struct { // 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"` // block height after which the packet times out. // the height within the given revision diff --git a/types/queries.go b/types/queries.go index a3fe0bcf4..42a8aa853 100644 --- a/types/queries.go +++ b/types/queries.go @@ -18,7 +18,7 @@ type queryResultImpl struct { // A custom serializer that allows us to map QueryResult instances to the Rust // enum `ContractResult` func (q QueryResult) MarshalJSON() ([]byte, error) { - // In case both Ok and Err are empty, this is interpreted and seralized + // In case both Ok and Err are empty, this is interpreted and serialized // as an Ok case with no data because errors must not be empty. if len(q.Ok) == 0 && len(q.Err) == 0 { return []byte(`{"ok":""}`), nil diff --git a/types/types.go b/types/types.go index 92eb2e99e..531fca0f2 100644 --- a/types/types.go +++ b/types/types.go @@ -210,7 +210,7 @@ func (pm *PinnedMetrics) UnmarshalMessagePack(data []byte) error { } // Array is a wrapper around a slice that ensures that we get "[]" JSON for nil values. -// When unmarshaling, we get an empty slice for "[]" and "null". +// When unmarshalling, we get an empty slice for "[]" and "null". // // This is needed for fields that are "Vec" on the Rust side because `null` values // will result in an error there.