From 64348183e7173faecd14c8f1cfee237d39bf90d4 Mon Sep 17 00:00:00 2001 From: crStiv Date: Fri, 25 Jul 2025 00:22:04 +0300 Subject: [PATCH] fix: multiple typos of different importance (#24987) Co-authored-by: User Co-authored-by: Alex | Interchain Labs --- x/staking/README.md | 4 ++-- x/staking/autocli.go | 2 +- x/staking/migrations/v3/json.go | 2 +- x/staking/migrations/v5/keys.go | 2 +- x/staking/simulation/genesis_test.go | 2 +- x/staking/simulation/msg_factory.go | 2 +- x/staking/simulation/operations.go | 2 +- x/staking/simulation/operations_test.go | 2 +- x/staking/testutil/helpers.go | 4 ++-- x/staking/types/genesis.go | 2 +- x/staking/types/validator.go | 2 +- x/tx/decode/unknown.go | 2 +- x/tx/signing/handler_map.go | 2 +- x/tx/signing/textual/internal/cbor/cbor.go | 2 +- x/upgrade/README.md | 2 +- 15 files changed, 17 insertions(+), 17 deletions(-) diff --git a/x/staking/README.md b/x/staking/README.md index 5da8e117e8..afed4beef1 100644 --- a/x/staking/README.md +++ b/x/staking/README.md @@ -468,7 +468,7 @@ When a Validator is slashed, the following occurs: redelegation began from the validator are slashed by the `slashFactor` percentage of the initialBalance. * Each amount slashed from redelegations and unbonding delegations is subtracted from the total slash amount. -* The `remaingSlashAmount` is then slashed from the validator's tokens in the `BondedPool` or +* The `remainingSlashAmount` is then slashed from the validator's tokens in the `BondedPool` or `NonBondedPool` depending on the validator's status. This reduces the total supply of tokens. In the case of a slash due to any infraction that requires evidence to submitted (for example double-sign), the slash @@ -2312,7 +2312,7 @@ A user can query the `staking` module using REST endpoints. #### DelegatorDelegations -The `DelegtaorDelegations` REST endpoint queries all delegations of a given delegator address. +The `DelegatorDelegations` REST endpoint queries all delegations of a given delegator address. ```bash /cosmos/staking/v1beta1/delegations/{delegatorAddr} diff --git a/x/staking/autocli.go b/x/staking/autocli.go index 886dcf181c..67cef2c1e8 100644 --- a/x/staking/autocli.go +++ b/x/staking/autocli.go @@ -43,7 +43,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { { RpcMethod: "ValidatorUnbondingDelegations", Use: "unbonding-delegations-from [validator-addr]", - Short: "Query all unbonding delegatations from a validator", + Short: "Query all unbonding delegations from a validator", Long: "Query delegations that are unbonding _from_ a validator.", Example: fmt.Sprintf("$ %s query staking unbonding-delegations-from [val-addr]", version.AppName), PositionalArgs: []*autocliv1.PositionalArgDescriptor{ diff --git a/x/staking/migrations/v3/json.go b/x/staking/migrations/v3/json.go index 2246266082..6c3fef9225 100644 --- a/x/staking/migrations/v3/json.go +++ b/x/staking/migrations/v3/json.go @@ -2,7 +2,7 @@ package v3 import "github.com/cosmos/cosmos-sdk/x/staking/types" -// MigrateJSON accepts exported v0.43 x/stakinng genesis state and migrates it to +// MigrateJSON accepts exported v0.43 x/staking genesis state and migrates it to // v0.46 x/staking genesis state. The migration includes: // // - Add MinCommissionRate param. diff --git a/x/staking/migrations/v5/keys.go b/x/staking/migrations/v5/keys.go index 5c11c8735c..653aeb6256 100644 --- a/x/staking/migrations/v5/keys.go +++ b/x/staking/migrations/v5/keys.go @@ -20,7 +20,7 @@ var ( DelegationByValIndexKey = []byte{0x71} // key for delegations by a validator ) -// ParseDelegationKey parses given key and returns delagator, validator address bytes +// ParseDelegationKey parses given key and returns delegator, validator address bytes func ParseDelegationKey(bz []byte) (sdk.AccAddress, sdk.ValAddress, error) { prefixLength := len(DelegationKey) if prefix := bz[:prefixLength]; !bytes.Equal(prefix, DelegationKey) { diff --git a/x/staking/simulation/genesis_test.go b/x/staking/simulation/genesis_test.go index 1b3f5c10f2..e90fcf9339 100644 --- a/x/staking/simulation/genesis_test.go +++ b/x/staking/simulation/genesis_test.go @@ -91,7 +91,7 @@ func TestRandomizedGenState1(t *testing.T) { Rand: r, }, "invalid memory address or nil pointer dereference"}, { - // panic => reason: numBonded != len(Accnounts) + // panic => reason: numBonded != len(Accounts) module.SimulationState{ AppParams: make(simtypes.AppParams), Cdc: cdc, diff --git a/x/staking/simulation/msg_factory.go b/x/staking/simulation/msg_factory.go index c0344b66bb..6e43200f40 100644 --- a/x/staking/simulation/msg_factory.go +++ b/x/staking/simulation/msg_factory.go @@ -107,7 +107,7 @@ func MsgUndelegateFactory(k *keeper.Keeper) simsx.SimMsgFactoryFn[*types.MsgUnde delegator := testData.GetAccount(reporter, delAddr) if hasMaxUD := must(k.HasMaxUnbondingDelegationEntries(ctx, delegator.Address, valAddr)); hasMaxUD { - reporter.Skipf("max unbodings") + reporter.Skipf("max unbondings") return nil, nil } diff --git a/x/staking/simulation/operations.go b/x/staking/simulation/operations.go index fefda50283..ba59d56e12 100644 --- a/x/staking/simulation/operations.go +++ b/x/staking/simulation/operations.go @@ -622,7 +622,7 @@ func SimulateMsgBeginRedelegate( } if hasRecRedel { - return simtypes.NoOpMsg(types.ModuleName, msgType, "receveing redelegation is not allowed"), nil, nil // skip + return simtypes.NoOpMsg(types.ModuleName, msgType, "receiving redelegation is not allowed"), nil, nil // skip } // get random destination validator diff --git a/x/staking/simulation/operations_test.go b/x/staking/simulation/operations_test.go index 674a60b5dd..42f433e0ad 100644 --- a/x/staking/simulation/operations_test.go +++ b/x/staking/simulation/operations_test.go @@ -401,7 +401,7 @@ func (s *SimTestSuite) setupValidatorRewards(ctx sdk.Context, valAddress sdk.Val decCoins := sdk.DecCoins{sdk.NewDecCoinFromDec(sdk.DefaultBondDenom, math.LegacyOneDec())} historicalRewards := distrtypes.NewValidatorHistoricalRewards(decCoins, 2) s.Require().NoError(s.distrKeeper.SetValidatorHistoricalRewards(ctx, valAddress, 2, historicalRewards)) - // setup current revards + // setup current rewards currentRewards := distrtypes.NewValidatorCurrentRewards(decCoins, 3) s.Require().NoError(s.distrKeeper.SetValidatorCurrentRewards(ctx, valAddress, currentRewards)) } diff --git a/x/staking/testutil/helpers.go b/x/staking/testutil/helpers.go index 83b85f847c..95ead10bbf 100644 --- a/x/staking/testutil/helpers.go +++ b/x/staking/testutil/helpers.go @@ -108,12 +108,12 @@ func (sh *Helper) Undelegate(delegator sdk.AccAddress, val sdk.ValAddress, amoun } } -// CheckValidator asserts that a validor exists and has a given status (if status!="") +// CheckValidator asserts that a validator exists and has a given status (if status!="") // and if has a right jailed flag. func (sh *Helper) CheckValidator(addr sdk.ValAddress, status stakingtypes.BondStatus, jailed bool) stakingtypes.Validator { v, err := sh.k.GetValidator(sh.Ctx, addr) require.NoError(sh.t, err) - require.Equal(sh.t, jailed, v.Jailed, "wrong Jalied status") + require.Equal(sh.t, jailed, v.Jailed, "wrong Jailed status") if status >= 0 { require.Equal(sh.t, status, v.Status) } diff --git a/x/staking/types/genesis.go b/x/staking/types/genesis.go index a3355a1d29..e144661afe 100644 --- a/x/staking/types/genesis.go +++ b/x/staking/types/genesis.go @@ -7,7 +7,7 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" ) -// NewGenesisState creates a new GenesisState instanc e +// NewGenesisState creates a new GenesisState instance func NewGenesisState(params Params, validators []Validator, delegations []Delegation) *GenesisState { return &GenesisState{ Params: params, diff --git a/x/staking/types/validator.go b/x/staking/types/validator.go index c2fbebec34..b4db52ba04 100644 --- a/x/staking/types/validator.go +++ b/x/staking/types/validator.go @@ -420,7 +420,7 @@ func (v Validator) RemoveTokens(tokens math.Int) Validator { } // RemoveDelShares removes delegator shares from a validator. -// NOTE: because token fractions are left in the valiadator, +// NOTE: because token fractions are left in the validator, // // the exchange rate of future shares of this validator can increase. func (v Validator) RemoveDelShares(delShares math.LegacyDec) (Validator, math.Int) { diff --git a/x/tx/decode/unknown.go b/x/tx/decode/unknown.go index 3a30ef8987..6d7b9616b2 100644 --- a/x/tx/decode/unknown.go +++ b/x/tx/decode/unknown.go @@ -98,7 +98,7 @@ func doRejectUnknownFields( } // if a message descriptor is a placeholder resolve it using the injected resolver. // this can happen when a descriptor has been registered in the - // "google.golang.org/protobuf" resgistry but not in "github.com/cosmos/gogoproto". + // "google.golang.org/protobuf" registry but not in "github.com/cosmos/gogoproto". // fixes: https://github.com/cosmos/cosmos-sdk/issues/22574 if fieldMessage.IsPlaceholder() { gogoDesc, err := resolver.FindDescriptorByName(fieldMessage.FullName()) diff --git a/x/tx/signing/handler_map.go b/x/tx/signing/handler_map.go index 98238a51d0..6ed4314ed3 100644 --- a/x/tx/signing/handler_map.go +++ b/x/tx/signing/handler_map.go @@ -53,7 +53,7 @@ func (h *HandlerMap) DefaultMode() signingv1beta1.SignMode { func (h *HandlerMap) GetSignBytes(ctx context.Context, signMode signingv1beta1.SignMode, signerData SignerData, txData TxData) ([]byte, error) { handler, ok := h.signModeHandlers[signMode] if !ok { - return nil, fmt.Errorf("unsuppored sign mode %s", signMode) + return nil, fmt.Errorf("unsupported sign mode %s", signMode) } return handler.GetSignBytes(ctx, signerData, txData) diff --git a/x/tx/signing/textual/internal/cbor/cbor.go b/x/tx/signing/textual/internal/cbor/cbor.go index 8c4c505097..1fbe753f79 100644 --- a/x/tx/signing/textual/internal/cbor/cbor.go +++ b/x/tx/signing/textual/internal/cbor/cbor.go @@ -107,7 +107,7 @@ type Array struct { elts []Cbor } -// NewArray reutnrs a CBOR array data item, +// NewArray returns a CBOR array data item, // containing the specified elements. func NewArray(elts ...Cbor) Array { return Array{elts: elts} diff --git a/x/upgrade/README.md b/x/upgrade/README.md index fe308730ce..396b8fb1df 100644 --- a/x/upgrade/README.md +++ b/x/upgrade/README.md @@ -90,7 +90,7 @@ func UpgradeStoreLoader (upgradeHeight int64, storeUpgrades *store.StoreUpgrades If there's a planned upgrade and the upgrade height is reached, the old binary writes `Plan` to the disk before panicking. This information is critical to ensure the `StoreUpgrades` happens smoothly at correct height and -expected upgrade. It eliminiates the chances for the new binary to execute `StoreUpgrades` multiple +expected upgrade. It eliminates the chances for the new binary to execute `StoreUpgrades` multiple times everytime on restart. Also if there are multiple upgrades planned on same height, the `Name` will ensure these `StoreUpgrades` takes place only in planned upgrade handler.