From ec4ee1cb1991e62d8d12715a4f58ce4cc66abc5f Mon Sep 17 00:00:00 2001 From: dmytroheknt <155268677+dmytroheknt@users.noreply.github.com> Date: Mon, 4 Aug 2025 17:35:53 +0200 Subject: [PATCH] chore: polishing docs and comments: typo fixes for clarity (#25081) Co-authored-by: Alex | Interchain Labs --- docs/spec/store/README.md | 2 +- errors/doc.go | 2 +- errors/errors.go | 2 +- internal/testutil/cmd_test.go | 2 +- math/CHANGELOG.md | 2 +- runtime/app.go | 2 +- runtime/events.go | 2 +- server/util.go | 2 +- server/util_test.go | 2 +- store/cachekv/store_bench_test.go | 2 +- store/rootmulti/store.go | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/spec/store/README.md b/docs/spec/store/README.md index e5a26bf4f0..3bf8b0e349 100644 --- a/docs/spec/store/README.md +++ b/docs/spec/store/README.md @@ -103,7 +103,7 @@ responsibility of the caller to ensure that concurrent access to the store is not performed. The main issue with concurrent use is when data is written at the same time as -it's being iterated over. Doing so will cause a irrecoverable fatal error because +it's being iterated over. Doing so will cause an irrecoverable fatal error because of concurrent reads and writes to an internal map. Although it's not recommended, you can iterate through values while writing to diff --git a/errors/doc.go b/errors/doc.go index ed6b9a69bf..a10c61acc1 100644 --- a/errors/doc.go +++ b/errors/doc.go @@ -7,7 +7,7 @@ details. This package provides a broad range of errors declared that fits all common cases. If an error is very specific for an extension it can be registered outside -of the errors package. If it will be needed my many extensions, please consider +of the errors package. If it will be needed by many extensions, please consider registering it in the errors package. To create a new error instance use Register function. You must provide a unique, non zero error code and a short description, for example: diff --git a/errors/errors.go b/errors/errors.go index 447269e572..5e20b2e936 100644 --- a/errors/errors.go +++ b/errors/errors.go @@ -186,7 +186,7 @@ func isNilErr(err error) bool { // it will be labeled as internal error. // // If err is nil, this returns nil, avoiding the need for an if statement when -// wrapping a error returned at the end of a function +// wrapping an error returned at the end of a function func Wrap(err error, description string) error { if err == nil { return nil diff --git a/internal/testutil/cmd_test.go b/internal/testutil/cmd_test.go index 4151360b9a..b800de9ee1 100644 --- a/internal/testutil/cmd_test.go +++ b/internal/testutil/cmd_test.go @@ -86,7 +86,7 @@ func TestSetArgsWithWrappedMethod(t *testing.T) { f := cmd.Flags() f.BoolP("a", "a", false, "check built-in pflag.Value") f.IntSlice("b", []int{1, 2}, "check built-in pflag.SliceValue with default value") - f.IntSliceP("c", "c", nil, "check built pflag.SliceValue with nil default value") + f.IntSliceP("c", "c", nil, "check built-in pflag.SliceValue with nil default value") f.Var(&mockFlagWithCommaD, "d", "check custom implementation of pflag.SliceValue with splitting by comma and default value") f.VarP(&mockFlagWithCommaE, "e", "e", "check custom implementation of pflag.SliceValue with splitting by comma and nil default value") f.Var(&mockFlagWithSemicolonF, "f", "check custom implementation of pflag.SliceValue with splitting by semicolon and default value") diff --git a/math/CHANGELOG.md b/math/CHANGELOG.md index ade5d843fc..f6ca40c387 100644 --- a/math/CHANGELOG.md +++ b/math/CHANGELOG.md @@ -140,7 +140,7 @@ Ref: https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.j ### Bug Fixes -* [#15506](https://github.com/cosmos/cosmos-sdk/issues/16605) Dec marshal shouldn't have side effects +* [#15506](https://github.com/cosmos/cosmos-sdk/pull/15506) Dec marshal shouldn't have side effects ## [math/v1.0.0-rc.0](https://github.com/cosmos/cosmos-sdk/releases/tag/math/v1.0.0-rc.0) - 2023-03-13 diff --git a/runtime/app.go b/runtime/app.go index 1f3ea9b7fa..91c5c2f4a7 100644 --- a/runtime/app.go +++ b/runtime/app.go @@ -92,7 +92,7 @@ func (a *App) RegisterModules(modules ...module.AppModule) error { // RegisterStores registers the provided store keys. // This method should only be used for registering extra stores -// wiich is necessary for modules that not registered using the app config. +// which is necessary for modules that not registered using the app config. // To be used in combination of RegisterModules. func (a *App) RegisterStores(keys ...storetypes.StoreKey) error { a.storeKeys = append(a.storeKeys, keys...) diff --git a/runtime/events.go b/runtime/events.go index aa5efdea0e..5e8f63ac23 100644 --- a/runtime/events.go +++ b/runtime/events.go @@ -32,7 +32,7 @@ func NewEventManager(ctx context.Context) event.Manager { return &Events{sdkCtx.EventManager()} } -// Emit emits an typed event that is defined in the protobuf file. +// Emit emits a typed event that is defined in the protobuf file. // In the future these events will be added to consensus. func (e Events) Emit(_ context.Context, event protoiface.MessageV1) error { return e.EmitTypedEvent(event) diff --git a/server/util.go b/server/util.go index ef64d63b55..b3100dd63b 100644 --- a/server/util.go +++ b/server/util.go @@ -71,7 +71,7 @@ func bindFlags(basename string, cmd *cobra.Command, v *viper.Viper) (err error) cmd.Flags().VisitAll(func(f *pflag.Flag) { // Environment variables can't have dashes in them, so bind them to their equivalent - // keys with underscores, e.g. --favorite-color to STING_FAVORITE_COLOR + // keys with underscores, e.g. --favorite-color to STRING_FAVORITE_COLOR err = v.BindEnv(f.Name, fmt.Sprintf("%s_%s", basename, strings.ToUpper(strings.ReplaceAll(f.Name, "-", "_")))) if err != nil { panic(err) diff --git a/server/util_test.go b/server/util_test.go index b778e9eb83..8ecfda08fb 100644 --- a/server/util_test.go +++ b/server/util_test.go @@ -401,7 +401,7 @@ func TestInterceptConfigsPreRunHandlerPrecedenceConfigDefault(t *testing.T) { } } -// Ensure that if interceptConfigs encounters any error other than non-existen errors +// Ensure that if interceptConfigs encounters any error other than non-existent errors // that we correctly return the offending error, for example a permission error. // See https://github.com/cosmos/cosmos-sdk/issues/7578 func TestInterceptConfigsWithBadPermissions(t *testing.T) { diff --git a/store/cachekv/store_bench_test.go b/store/cachekv/store_bench_test.go index 8f15855e09..539d2c78be 100644 --- a/store/cachekv/store_bench_test.go +++ b/store/cachekv/store_bench_test.go @@ -21,7 +21,7 @@ func benchmarkBlankParentIteratorNext(b *testing.B, keysize int) { // Use a singleton for value, to not waste time computing it value := randSlice(defaultValueSizeBz) // Use simple values for keys, pick a random start, - // and take next b.N keys sequentially after.] + // and take next b.N keys sequentially after. startKey := randSlice(32) // Add 1 to avoid issues when b.N = 1 diff --git a/store/rootmulti/store.go b/store/rootmulti/store.go index 3b2c9e7540..3f4e5af06c 100644 --- a/store/rootmulti/store.go +++ b/store/rootmulti/store.go @@ -628,7 +628,7 @@ func (rs *Store) CacheMultiStoreWithVersion(version int64) (types.CacheMultiStor return nil, err } - // If the store donesn't exist at this version, create a dummy one to prevent + // If the store doesn't exist at this version, create a dummy one to prevent // nil pointer panic in newer query APIs. cacheStore = dbadapter.Store{DB: dbm.NewMemDB()} }