From dca3b88cd005c334f2801b360833b99402ee33a7 Mon Sep 17 00:00:00 2001 From: crStiv Date: Fri, 25 Jul 2025 21:14:05 +0300 Subject: [PATCH] fix: typos (#25000) --- x/protocolpool/keeper/msg_server_test.go | 2 +- x/slashing/README.md | 8 ++++---- x/slashing/keeper/keeper.go | 6 +++--- x/slashing/keeper/signing_info.go | 2 +- x/slashing/module.go | 2 +- x/slashing/types/expected_keepers.go | 2 +- x/staking/client/cli/tx.go | 4 ++-- x/staking/keeper/msg_server_test.go | 2 +- x/staking/keeper/validator.go | 4 ++-- x/staking/keeper/validator_test.go | 2 +- 10 files changed, 17 insertions(+), 17 deletions(-) diff --git a/x/protocolpool/keeper/msg_server_test.go b/x/protocolpool/keeper/msg_server_test.go index 4627b3adeb..de6684f127 100644 --- a/x/protocolpool/keeper/msg_server_test.go +++ b/x/protocolpool/keeper/msg_server_test.go @@ -271,7 +271,7 @@ func (suite *KeeperTestSuite) TestCreateContinuousFund() { expErrMsg: "total funds percentage exceeds 100", }, { - name: "address is bocked", + name: "address is blocked", msg: &types.MsgCreateContinuousFund{ Authority: validAuthority, Recipient: validRecipient.String(), diff --git a/x/slashing/README.md b/x/slashing/README.md index 60848fb4c1..5bf95b80fb 100644 --- a/x/slashing/README.md +++ b/x/slashing/README.md @@ -62,7 +62,7 @@ In order to mitigate the impact of initially likely categories of non-malicious protocol faults, the Cosmos Hub implements for each validator a _tombstone_ cap, which only allows a validator to be slashed once for a double sign fault. For example, if you misconfigure your HSM and double-sign a bunch of -old blocks, you'll only be punished for the first double-sign (and then immediately tombstombed). This will still be quite expensive and desirable to avoid, but tombstone caps +old blocks, you'll only be punished for the first double-sign (and then immediately tombstoned). This will still be quite expensive and desirable to avoid, but tombstone caps somewhat blunt the economic impact of unintentional misconfiguration. Liveness faults do not have caps, as they can't stack upon each other. Liveness bugs are "detected" as soon as the infraction occurs, and the validators are immediately put in jail, so it is not possible for them to commit multiple liveness faults without unjailing in between. @@ -226,7 +226,7 @@ greater than `minHeight` and the validator's `MissedBlocksCounter` is greater th for `DowntimeJailDuration`, and have the following values reset: `MissedBlocksBitArray`, `MissedBlocksCounter`, and `IndexOffset`. -**Note**: Liveness slashes do **NOT** lead to a tombstombing. +**Note**: Liveness slashes do **NOT** lead to a tombstoning. ```go height := block.Height @@ -234,7 +234,7 @@ height := block.Height for vote in block.LastCommitInfo.Votes { signInfo := GetValidatorSigningInfo(vote.Validator.Address) - // This is a relative index, so we counts blocks the validator SHOULD have + // This is a relative index, so we count blocks the validator SHOULD have // signed. We use the 0-value default signing info if not present, except for // start height. index := signInfo.IndexOffset % SignedBlocksWindow() @@ -331,7 +331,7 @@ onValidatorBonded(address sdk.ValAddress) IndexOffset : 0, JailedUntil : time.Unix(0, 0), Tombstone : false, - MissedBloskCounter : 0 + MissedBlockCounter : 0 } else { signingInfo.StartHeight = CurrentHeight } diff --git a/x/slashing/keeper/keeper.go b/x/slashing/keeper/keeper.go index 8d67747941..74422a00e8 100644 --- a/x/slashing/keeper/keeper.go +++ b/x/slashing/keeper/keeper.go @@ -60,7 +60,7 @@ func (k Keeper) AddPubkey(ctx context.Context, pubkey cryptotypes.PubKey) error return store.Set(key, bz) } -// GetPubkey returns the pubkey from the adddress-pubkey relation +// GetPubkey returns the pubkey from the address-pubkey relation func (k Keeper) GetPubkey(ctx context.Context, a cryptotypes.Address) (cryptotypes.PubKey, error) { store := k.storeService.OpenKVStore(ctx) bz, err := store.Get(types.AddrPubkeyRelationKey(a)) @@ -75,13 +75,13 @@ func (k Keeper) GetPubkey(ctx context.Context, a cryptotypes.Address) (cryptotyp } // Slash attempts to slash a validator. The slash is delegated to the staking -// module to make the necessary validator changes. It specifies no intraction reason. +// module to make the necessary validator changes. It specifies no infraction reason. func (k Keeper) Slash(ctx context.Context, consAddr sdk.ConsAddress, fraction sdkmath.LegacyDec, power, distributionHeight int64) error { return k.SlashWithInfractionReason(ctx, consAddr, fraction, power, distributionHeight, stakingtypes.Infraction_INFRACTION_UNSPECIFIED) } // SlashWithInfractionReason attempts to slash a validator. The slash is delegated to the staking -// module to make the necessary validator changes. It specifies an intraction reason. +// module to make the necessary validator changes. It specifies an infraction reason. func (k Keeper) SlashWithInfractionReason(ctx context.Context, consAddr sdk.ConsAddress, fraction sdkmath.LegacyDec, power, distributionHeight int64, infraction stakingtypes.Infraction) error { coinsBurned, err := k.sk.SlashWithInfractionReason(ctx, consAddr, distributionHeight, power, fraction, infraction) if err != nil { diff --git a/x/slashing/keeper/signing_info.go b/x/slashing/keeper/signing_info.go index f4e1fe94f3..4b4cf13e40 100644 --- a/x/slashing/keeper/signing_info.go +++ b/x/slashing/keeper/signing_info.go @@ -13,7 +13,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/slashing/types" ) -// GetValidatorSigningInfo retruns the ValidatorSigningInfo for a specific validator +// GetValidatorSigningInfo returns the ValidatorSigningInfo for a specific validator // ConsAddress. If not found it returns ErrNoSigningInfoFound, but other errors // may be returned if there is an error reading from the store. func (k Keeper) GetValidatorSigningInfo(ctx context.Context, address sdk.ConsAddress) (types.ValidatorSigningInfo, error) { diff --git a/x/slashing/module.go b/x/slashing/module.go index 67e4863141..67f7fe5e2e 100644 --- a/x/slashing/module.go +++ b/x/slashing/module.go @@ -77,7 +77,7 @@ func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncod return types.ValidateGenesis(data) } -// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the slashig module. +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the slashing module. func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *gwruntime.ServeMux) { if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil { panic(err) diff --git a/x/slashing/types/expected_keepers.go b/x/slashing/types/expected_keepers.go index 584ed8493d..d38d82e540 100644 --- a/x/slashing/types/expected_keepers.go +++ b/x/slashing/types/expected_keepers.go @@ -25,7 +25,7 @@ type BankKeeper interface { SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins } -// ParamSubspace defines the expected Subspace interfacace +// ParamSubspace defines the expected Subspace interface type ParamSubspace interface { HasKeyTable() bool WithKeyTable(table paramtypes.KeyTable) paramtypes.Subspace diff --git a/x/staking/client/cli/tx.go b/x/staking/client/cli/tx.go index e724940548..fecc99925c 100644 --- a/x/staking/client/cli/tx.go +++ b/x/staking/client/cli/tx.go @@ -569,8 +569,8 @@ func PrepareConfigForTxCreateValidator(flagSet *flag.FlagSet, moniker, nodeID, c // BuildCreateValidatorMsg makes a new MsgCreateValidator. func BuildCreateValidatorMsg(clientCtx client.Context, config TxCreateValidatorConfig, txBldr tx.Factory, generateOnly bool, valCodec address.Codec) (tx.Factory, sdk.Msg, error) { - amounstStr := config.Amount - amount, err := sdk.ParseCoinNormalized(amounstStr) + amountStr := config.Amount + amount, err := sdk.ParseCoinNormalized(amountStr) if err != nil { return txBldr, nil, err } diff --git a/x/staking/keeper/msg_server_test.go b/x/staking/keeper/msg_server_test.go index e28852280f..7abdd3d459 100644 --- a/x/staking/keeper/msg_server_test.go +++ b/x/staking/keeper/msg_server_test.go @@ -342,7 +342,7 @@ func (s *KeeperTestSuite) TestMsgEditValidator() { expErrMsg: "validator does not exist", }, { - name: "change commmission rate in <24hrs", + name: "change commission rate in <24hrs", ctx: ctx, input: &stakingtypes.MsgEditValidator{ Description: stakingtypes.Description{ diff --git a/x/staking/keeper/validator.go b/x/staking/keeper/validator.go index 1afa7a709c..f534159bbc 100644 --- a/x/staking/keeper/validator.go +++ b/x/staking/keeper/validator.go @@ -78,7 +78,7 @@ func (k Keeper) SetValidator(ctx context.Context, validator types.Validator) err return store.Set(types.GetValidatorKey(str), bz) } -// SetValidatorByConsAddr sets a validator by conesensus address +// SetValidatorByConsAddr sets a validator by consensus address func (k Keeper) SetValidatorByConsAddr(ctx context.Context, validator types.Validator) error { consPk, err := validator.GetConsAddr() if err != nil { @@ -543,7 +543,7 @@ func (k Keeper) UnbondAllMatureValidators(ctx context.Context) error { blockTime := sdkCtx.BlockTime() blockHeight := sdkCtx.BlockHeight() - // unbondingValIterator will contains all validator addresses indexed under + // unbondingValIterator will contain all validator addresses indexed under // the ValidatorQueueKey prefix. Note, the entire index key is composed as // ValidatorQueueKey | timeBzLen (8-byte big endian) | timeBz | heightBz (8-byte big endian), // so it may be possible that certain validator addresses that are iterated diff --git a/x/staking/keeper/validator_test.go b/x/staking/keeper/validator_test.go index a9aab66941..688d5f52f0 100644 --- a/x/staking/keeper/validator_test.go +++ b/x/staking/keeper/validator_test.go @@ -31,7 +31,7 @@ func (s *KeeperTestSuite) TestValidator() { valAddr := sdk.ValAddress(valPubKey.Address().Bytes()) valTokens := keeper.TokensFromConsensusPower(ctx, 10) - // test how the validator is set from a purely unbonbed pool + // test how the validator is set from a purely unbonded pool validator := testutil.NewValidator(s.T(), valAddr, valPubKey) validator, _ = validator.AddTokensFromDel(valTokens) require.Equal(stakingtypes.Unbonded, validator.Status)