Skip to content

Commit ec6bc9b

Browse files
docs: fix comments that don't match code (cosmos#25785)
2 parents 690773e + 8a694f0 commit ec6bc9b

File tree

8 files changed

+15
-14
lines changed

8 files changed

+15
-14
lines changed

codec/proto_codec.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ func (pc *ProtoCodec) MarshalInterfaceJSON(x gogoproto.Message) ([]byte, error)
278278
// Example:
279279
//
280280
// var x MyInterface // must implement proto.Message
281-
// err := cdc.UnmarshalInterfaceJSON(&x, bz)
281+
// err := cdc.UnmarshalInterfaceJSON(bz, &x)
282282
func (pc *ProtoCodec) UnmarshalInterfaceJSON(bz []byte, iface any) error {
283283
any := &types.Any{}
284284
err := pc.UnmarshalJSON(bz, any)

proto/cosmos/staking/v1beta1/query.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ message QueryValidatorsResponse {
148148
cosmos.base.query.v1beta1.PageResponse pagination = 2;
149149
}
150150

151-
// QueryValidatorRequest is response type for the Query/Validator RPC method
151+
// QueryValidatorRequest is request type for the Query/Validator RPC method
152152
message QueryValidatorRequest {
153153
// validator_addr defines the validator address to query for.
154154
string validator_addr = 1 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"];

store/cachekv/store.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ func findStartIndex(strL []string, startQ string) int {
223223
midStr := strL[mid]
224224
if midStr == startQ {
225225
// Handle condition where there might be multiple values equal to startQ.
226-
// We are looking for the very first value < midStL, that i+1 will be the first
226+
// We are looking for the very first value < midStr, that i+1 will be the first
227227
// element >= midStr.
228228
for i := mid - 1; i >= 0; i-- {
229229
if strL[i] != midStr {
@@ -234,7 +234,7 @@ func findStartIndex(strL []string, startQ string) int {
234234
}
235235
if midStr < startQ {
236236
left = mid + 1
237-
} else { // midStrL > startQ
237+
} else { // midStr > startQ
238238
right = mid - 1
239239
}
240240
}
@@ -256,8 +256,8 @@ func findEndIndex(strL []string, endQ string) int {
256256
mid = (left + right) >> 1
257257
midStr := strL[mid]
258258
if midStr == endQ {
259-
// Handle condition where there might be multiple values equal to startQ.
260-
// We are looking for the very first value < midStL, that i+1 will be the first
259+
// Handle condition where there might be multiple values equal to endQ.
260+
// We are looking for the very first value < midStr, that i+1 will be the first
261261
// element >= midStr.
262262
for i := mid - 1; i >= 0; i-- {
263263
if strL[i] < midStr {
@@ -268,7 +268,7 @@ func findEndIndex(strL []string, endQ string) int {
268268
}
269269
if midStr < endQ {
270270
left = mid + 1
271-
} else { // midStrL > startQ
271+
} else { // midStr > endQ
272272
right = mid - 1
273273
}
274274
}

types/result.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func NewResponseResultTx(res *coretypes.ResultTx, anyTx *codectypes.Any, timesta
8282
}
8383
}
8484

85-
// NewResponseResultBlock returns a BlockResponse given a ResultBlock from CometBFT
85+
// NewResponseResultBlock returns a cmtproto.Block given a ResultBlock from CometBFT
8686
func NewResponseResultBlock(res *coretypes.ResultBlock, timestamp string) *cmtproto.Block {
8787
if res == nil {
8888
return nil

x/gov/keeper/keeper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func NewKeeper(
125125
return k
126126
}
127127

128-
// Hooks gets the hooks for governance *Keeper {
128+
// Hooks gets the hooks for governance.
129129
func (k *Keeper) Hooks() types.GovHooks {
130130
if k.hooks == nil {
131131
// return a no-op implementation if no hooks are set

x/slashing/keeper/signing_info.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func (k Keeper) IterateValidatorSigningInfos(ctx context.Context,
7676
}
7777

7878
// JailUntil attempts to set a validator's JailedUntil attribute in its signing
79-
// info. It will panic if the signing info does not exist for the validator.
79+
// info. It returns an error if the signing info does not exist for the validator.
8080
func (k Keeper) JailUntil(ctx context.Context, consAddr sdk.ConsAddress, jailTime time.Time) error {
8181
signInfo, err := k.GetValidatorSigningInfo(ctx, consAddr)
8282
if err != nil {
@@ -87,8 +87,8 @@ func (k Keeper) JailUntil(ctx context.Context, consAddr sdk.ConsAddress, jailTim
8787
return k.SetValidatorSigningInfo(ctx, consAddr, signInfo)
8888
}
8989

90-
// Tombstone attempts to tombstone a validator. It will panic if signing info for
91-
// the given validator does not exist.
90+
// Tombstone attempts to tombstone a validator. It returns an error if signing info for
91+
// the given validator does not exist or if the validator is already tombstoned.
9292
func (k Keeper) Tombstone(ctx context.Context, consAddr sdk.ConsAddress) error {
9393
signInfo, err := k.GetValidatorSigningInfo(ctx, consAddr)
9494
if err != nil {

x/staking/keeper/keeper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func (k Keeper) Logger(ctx context.Context) log.Logger {
8080
return sdkCtx.Logger().With("module", "x/"+types.ModuleName)
8181
}
8282

83-
// Hooks gets the hooks for staking *Keeper {
83+
// Hooks gets the hooks for staking.
8484
func (k *Keeper) Hooks() types.StakingHooks {
8585
if k.hooks == nil {
8686
// return a no-op implementation if no hooks are set

x/upgrade/keeper/keeper.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,11 @@ type Keeper struct {
5050

5151
// NewKeeper constructs an upgrade Keeper which requires the following arguments:
5252
// skipUpgradeHeights - map of heights to skip an upgrade
53-
// storeKey - a store key with which to access upgrade's store
53+
// storeService - a store service with which to access upgrade's store
5454
// cdc - the app-wide binary codec
5555
// homePath - root directory of the application's config
5656
// vs - the interface implemented by baseapp which allows setting baseapp's protocol version field
57+
// authority - the address capable of executing upgrade proposals
5758
func NewKeeper(skipUpgradeHeights map[int64]bool, storeService corestore.KVStoreService, cdc codec.BinaryCodec, homePath string, vs xp.ProtocolVersionSetter, authority string) *Keeper {
5859
k := &Keeper{
5960
homePath: homePath,

0 commit comments

Comments
 (0)