Skip to content

Commit

Permalink
remove comments
Browse files Browse the repository at this point in the history
  • Loading branch information
czarcas7ic committed Feb 29, 2024
1 parent 229a25f commit 33617c2
Showing 1 changed file with 0 additions and 65 deletions.
65 changes: 0 additions & 65 deletions x/slashing/keeper/signing_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,53 +55,6 @@ func (k Keeper) IterateValidatorSigningInfos(ctx sdk.Context,
}
}

// // GetValidatorMissedBlockBitArray gets the bit for the missed blocks array
// func (k Keeper) GetValidatorMissedBlockBitArray(ctx sdk.Context, address sdk.ConsAddress, index int64) bool {
// store := ctx.KVStore(k.storeKey)
// bz := store.Get(types.ValidatorMissedBlockBitArrayKey(address, index))
// var missed gogotypes.BoolValue
// if bz == nil {
// // lazy: treat empty key as not missed
// return false
// }
// k.cdc.MustUnmarshal(bz, &missed)

// return missed.Value
// }

// // IterateValidatorMissedBlockBitArray iterates over the signed blocks window
// // and performs a callback function
// func (k Keeper) IterateValidatorMissedBlockBitArray(ctx sdk.Context,
// address sdk.ConsAddress, handler func(index int64, missed bool) (stop bool),
// ) {
// store := ctx.KVStore(k.storeKey)
// index := int64(0)
// // Array may be sparse
// for ; index < k.SignedBlocksWindow(ctx); index++ {
// var missed gogotypes.BoolValue
// bz := store.Get(types.ValidatorMissedBlockBitArrayKey(address, index))
// if bz == nil {
// continue
// }

// k.cdc.MustUnmarshal(bz, &missed)
// if handler(index, missed.Value) {
// break
// }
// }
// }

// // GetValidatorMissedBlocks returns array of missed blocks for given validator Cons address
// func (k Keeper) GetValidatorMissedBlocks(ctx sdk.Context, address sdk.ConsAddress) []types.MissedBlock {
// missedBlocks := []types.MissedBlock{}
// k.IterateValidatorMissedBlockBitArray(ctx, address, func(index int64, missed bool) (stop bool) {
// missedBlocks = append(missedBlocks, types.NewMissedBlock(index, missed))
// return false
// })

// return missedBlocks
// }

// JailUntil attempts to set a validator's JailedUntil attribute in its signing
// info. It will panic if the signing info does not exist for the validator.
func (k Keeper) JailUntil(ctx sdk.Context, consAddr sdk.ConsAddress, jailTime time.Time) {
Expand Down Expand Up @@ -140,24 +93,6 @@ func (k Keeper) IsTombstoned(ctx sdk.Context, consAddr sdk.ConsAddress) bool {
return signInfo.Tombstoned
}

// // SetValidatorMissedBlockBitArray sets the bit that checks if the validator has
// // missed a block in the current window
// func (k Keeper) SetValidatorMissedBlockBitArray(ctx sdk.Context, address sdk.ConsAddress, index int64, missed bool) {
// store := ctx.KVStore(k.storeKey)
// bz := k.cdc.MustMarshal(&gogotypes.BoolValue{Value: missed})
// store.Set(types.ValidatorMissedBlockBitArrayKey(address, index), bz)
// }

// // clearValidatorMissedBlockBitArray deletes every instance of ValidatorMissedBlockBitArray in the store
// func (k Keeper) clearValidatorMissedBlockBitArray(ctx sdk.Context, address sdk.ConsAddress) {
// store := ctx.KVStore(k.storeKey)
// iter := sdk.KVStorePrefixIterator(store, types.ValidatorMissedBlockBitArrayPrefixKey(address))
// defer iter.Close()
// for ; iter.Valid(); iter.Next() {
// store.Delete(iter.Key())
// }
// }

// getMissedBlockBitmapChunk gets the bitmap chunk at the given chunk index for
// a validator's missed block signing window.
func (k Keeper) getMissedBlockBitmapChunk(ctx sdk.Context, addr sdk.ConsAddress, chunkIndex int64) []byte {
Expand Down

0 comments on commit 33617c2

Please sign in to comment.