Skip to content

Commit 397a8ec

Browse files
committed
fix: reintroduce TopN state functions for keeper.go
1 parent dddb413 commit 397a8ec

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

x/ccv/provider/keeper/keeper.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -837,10 +837,10 @@ func (k Keeper) SetMinimumPowerInTopN(
837837
) {
838838
store := ctx.KVStore(k.storeKey)
839839

840-
powerBytes := make([]byte, 8)
841-
binary.BigEndian.PutUint64(powerBytes, uint64(power))
840+
buf := make([]byte, 8)
841+
binary.BigEndian.PutUint64(buf, uint64(power))
842842

843-
store.Set(types.MinimumPowerInTopNKey(chainID), powerBytes)
843+
store.Set(types.MinimumPowerInTopNKey(chainID), buf)
844844
}
845845

846846
// GetMinimumPowerInTopN returns the minimum power required for a validator to be in the top N
@@ -850,12 +850,11 @@ func (k Keeper) GetMinimumPowerInTopN(
850850
chainID string,
851851
) (int64, bool) {
852852
store := ctx.KVStore(k.storeKey)
853-
bz := store.Get(types.MinimumPowerInTopNKey(chainID))
854-
if bz == nil {
853+
buf := store.Get(types.MinimumPowerInTopNKey(chainID))
854+
if buf == nil {
855855
return 0, false
856856
}
857-
858-
return int64(binary.BigEndian.Uint64(bz)), true
857+
return int64(binary.BigEndian.Uint64(buf)), true
859858
}
860859

861860
// DeleteMinimumPowerInTopN removes the minimum power required for a validator to be in the top N

0 commit comments

Comments
 (0)