func GetValidatorQueueTimeKey(timestamp time.Time) []byte {
	bz := sdk.FormatTimeBytes(timestamp)
	return append(ValidatorQueueKey, bz...)
}
gets the prefix for all unbonding delegations from a delegator
package types
import (
	"encoding/binary"
	"time"
	"github.com/Dipper-Labs/Dipper-Protocol/app/protocol"
	sdk "github.com/Dipper-Labs/Dipper-Protocol/types"
)
const (
	ModuleName   = protocol.StakingModuleName
	StoreKey     = ModuleName
	TStoreKey    = protocol.StakingTStoreKey
	QuerierRoute = ModuleName
	RouterKey    = ModuleName
)
var (
	LastValidatorPowerKey = []byte{0x11}  
	LastTotalPowerKey     = []byte{0x12}  
	ValidatorsKey             = []byte{0x21}  
	ValidatorsByConsAddrKey   = []byte{0x22}  
	ValidatorsByPowerIndexKey = []byte{0x23}  
	DelegationKey                    = []byte{0x31}  
	UnbondingDelegationKey           = []byte{0x32}  
	UnbondingDelegationByValIndexKey = []byte{0x33}  
	RedelegationKey                  = []byte{0x34}  
	RedelegationByValSrcIndexKey     = []byte{0x35}  
	RedelegationByValDstIndexKey     = []byte{0x36}  
	UnbondingQueueKey    = []byte{0x41}  
	RedelegationQueueKey = []byte{0x42}  
	ValidatorQueueKey    = []byte{0x43}  
)
func GetValidatorKey(operatorAddr sdk.ValAddress) []byte {
	return append(ValidatorsKey, operatorAddr.Bytes()...)
}
func GetValidatorByConsAddrKey(addr sdk.ConsAddress) []byte {
	return append(ValidatorsByConsAddrKey, addr.Bytes()...)
}
func AddressFromLastValidatorPowerKey(key []byte) []byte {
	return key[1:]  
}
func GetValidatorsByPowerIndexKey(validator Validator) []byte {
	return getValidatorPowerRank(validator)
}
func GetLastValidatorPowerKey(operator sdk.ValAddress) []byte {
	return append(LastValidatorPowerKey, operator...)
}
func getValidatorPowerRank(validator Validator) []byte {
	consensusPower := sdk.TokensToConsensusPower(validator.Tokens)
	consensusPowerBytes := make([]byte, 8)
	binary.BigEndian.PutUint64(consensusPowerBytes, uint64(consensusPower))
	powerBytes := consensusPowerBytes
	powerBytesLen := len(powerBytes)  
	key := make([]byte, 1+powerBytesLen+sdk.AddrLen)
	key[0] = ValidatorsByPowerIndexKey[0]
	copy(key[1:powerBytesLen+1], powerBytes)
	operAddrInvr := sdk.CopyBytes(validator.OperatorAddress)
	for i, b := range operAddrInvr {
		operAddrInvr[i] = ^b
	}
	copy(key[powerBytesLen+1:], operAddrInvr)
	return key
}
func ParseValidatorPowerRankKey(key []byte) (operAddr []byte) {
	powerBytesLen := 8
	if len(key) != 1+powerBytesLen+sdk.AddrLen {
		panic("Invalid validator power rank key length")
	}
	operAddr = sdk.CopyBytes(key[powerBytesLen+1:])
	for i, b := range operAddr {
		operAddr[i] = ^b
	}
	return operAddr
}