Skip to content

Commit

Permalink
fix nits
Browse files Browse the repository at this point in the history
  • Loading branch information
sainoe committed Aug 19, 2022
1 parent d9f2e03 commit 3f4e0ce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions x/ccv/consumer/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,13 +283,13 @@ func (k Keeper) GetPacketMaturityTime(ctx sdk.Context, vscId uint64) uint64 {
return binary.BigEndian.Uint64(bz)
}

// DeletePacketMaturityTime deletes the maturity time for a given received VSC packet id
// DeletePacketMaturityTime deletes the packet maturity time for a given received VSC packet id
func (k Keeper) DeletePacketMaturityTime(ctx sdk.Context, vscId uint64) {
store := ctx.KVStore(k.storeKey)
store.Delete(types.PacketMaturityTimeKey(vscId))
}

// ClearPacketMaturityTime deletes all the maturity time in stores
// ClearPacketMaturityTime deletes all the packet maturity time in the store
func (k Keeper) ClearPacketMaturityTimes(ctx sdk.Context) {
vscIDs := []uint64{}
k.IteratePacketMaturityTime(ctx, func(vscId, _ uint64) bool {
Expand Down Expand Up @@ -343,7 +343,7 @@ func (k Keeper) GetHeightValsetUpdateID(ctx sdk.Context, height uint64) uint64 {
return binary.BigEndian.Uint64(bz)
}

// IterateHeightValsetUpdateID gets the valset update id recorded for a given block height
// IterateHeightValsetUpdateID iterates over the valset update ids recorded for a given block height
func (k Keeper) IterateHeightValsetUpdateID(ctx sdk.Context, cb func(height uint64) bool) {
store := ctx.KVStore(k.storeKey)
iterator := sdk.KVStorePrefixIterator(store, []byte{types.HeightValsetUpdateIDBytePrefix})
Expand All @@ -356,7 +356,7 @@ func (k Keeper) IterateHeightValsetUpdateID(ctx sdk.Context, cb func(height uint
}
}

// ClearHeightValsetUpdateIDs clears the valset update ids in stores
// ClearHeightValsetUpdateIDs clears the valset update ids in the store
func (k Keeper) ClearHeightValsetUpdateIDs(ctx sdk.Context) {
k.IterateHeightValsetUpdateID(ctx, func(height uint64) bool {
k.DeleteHeightValsetUpdateID(ctx, height)
Expand All @@ -383,7 +383,7 @@ func (k Keeper) SetOutstandingDowntime(ctx sdk.Context, address sdk.ConsAddress)
store.Set(types.OutstandingDowntimeKey(address), []byte{})
}

// DeleteOutstandingDowntime deletes the outstanding downtime flags for the given validator address
// DeleteOutstandingDowntime deletes the outstanding downtime flag for the given validator consensus address
func (k Keeper) DeleteOutstandingDowntime(ctx sdk.Context, consAddress string) {
consAddr, err := sdk.ConsAddressFromBech32(consAddress)
if err != nil {
Expand All @@ -407,7 +407,7 @@ func (k Keeper) IterateOutstandingDowntime(ctx sdk.Context, cb func(consAddress
}
}

// ClearOutstandingDowntime clears the outstanding downtime flags in stores
// ClearOutstandingDowntime clears the outstanding downtime flags in the store
func (k Keeper) ClearOutstandingDowntimes(ctx sdk.Context) {
addrs := []sdk.ConsAddress{}
k.IterateOutstandingDowntime(ctx, func(addr sdk.ConsAddress) bool {
Expand Down
2 changes: 1 addition & 1 deletion x/ccv/consumer/keeper/validators.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ func (k Keeper) TrackHistoricalInfo(ctx sdk.Context) {
k.SetHistoricalInfo(ctx, ctx.BlockHeight(), &historicalEntry)
}

// IterateHistoricalInfo iterates over the historical info in a descending block height order
// IterateHistoricalInfo iterates over the historical info for each block height in a ascendingorder
func (k Keeper) IterateHistoricalInfo(ctx sdk.Context, cb func(height uint64) bool) {
store := ctx.KVStore(k.storeKey)
iterator := sdk.KVStorePrefixIterator(store, []byte{types.HistoricalInfoBytePrefix})
Expand Down

0 comments on commit 3f4e0ce

Please sign in to comment.