Documentation ¶
Index ¶
- Constants
- Variables
- func AddressFromLastValidatorPowerKey(key []byte) []byte
- func GetDelegationKey(delAddr sdk.AccAddress, valAddr sdk.ValAddress) []byte
- func GetDelegationsKey(delAddr sdk.AccAddress) []byte
- func GetHistoricalInfoKey(height int64) []byte
- func GetLastValidatorPowerKey(operator sdk.ValAddress) []byte
- func GetREDByValDstIndexKey(delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress) []byte
- func GetREDByValSrcIndexKey(delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress) []byte
- func GetREDKey(delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress) []byte
- func GetREDKeyFromValDstIndexKey(indexKey []byte) []byte
- func GetREDKeyFromValSrcIndexKey(indexKey []byte) []byte
- func GetREDsFromValSrcIndexKey(valSrcAddr sdk.ValAddress) []byte
- func GetREDsKey(delAddr sdk.AccAddress) []byte
- func GetREDsToValDstIndexKey(valDstAddr sdk.ValAddress) []byte
- func GetRedelegationTimeKey(timestamp time.Time) []byte
- func GetUBDByValIndexKey(delAddr sdk.AccAddress, valAddr sdk.ValAddress) []byte
- func GetUBDKey(delAddr sdk.AccAddress, valAddr sdk.ValAddress) []byte
- func GetUBDKeyFromValIndexKey(indexKey []byte) []byte
- func GetUBDsByValIndexKey(valAddr sdk.ValAddress) []byte
- func GetUBDsKey(delAddr sdk.AccAddress) []byte
- func GetUnbondingDelegationTimeKey(timestamp time.Time) []byte
- func GetValidatorByConsAddrKey(addr sdk.ConsAddress) []byte
- func GetValidatorKey(operatorAddr sdk.ValAddress) []byte
- func GetValidatorQueueKey(timestamp time.Time, height int64) []byte
- func GetValidatorsByPowerIndexKey(validator types.Validator) []byte
- func ParseValidatorQueueKey(bz []byte) (time.Time, int64, error)
Constants ¶
const ( // DefaultUnbondingTime reflects three weeks in seconds as the default // unbonding time. // TODO: Justify our choice of default here. DefaultUnbondingTime time.Duration = time.Hour * 24 * 7 * 3 // Default maximum number of bonded validators DefaultMaxValidators uint32 = 100 // Default maximum entries in a UBD/RED pair DefaultMaxEntries uint32 = 7 // DefaultHistorical entries is 10000. Apps that don't use IBC can ignore this // value by not adding the staking module to the application module manager's // SetOrderBeginBlockers. DefaultHistoricalEntries uint32 = 10000 )
Staking params default values
Variables ¶
var ( // Keys for store prefixes // Last* values are constant during a block. LastValidatorPowerKey = []byte{0x11} // prefix for each key to a validator index, for bonded validators LastTotalPowerKey = []byte{0x12} // prefix for the total power ValidatorsKey = []byte{0x21} // prefix for each key to a validator ValidatorsByConsAddrKey = []byte{0x22} // prefix for each key to a validator index, by pubkey ValidatorsByPowerIndexKey = []byte{0x23} // prefix for each key to a validator index, sorted by power DelegationKey = []byte{0x31} // key for a delegation UnbondingDelegationKey = []byte{0x32} // key for an unbonding-delegation UnbondingDelegationByValIndexKey = []byte{0x33} // prefix for each key for an unbonding-delegation, by validator operator RedelegationKey = []byte{0x34} // key for a redelegation RedelegationByValSrcIndexKey = []byte{0x35} // prefix for each key for an redelegation, by source validator operator RedelegationByValDstIndexKey = []byte{0x36} // prefix for each key for an redelegation, by destination validator operator UnbondingQueueKey = []byte{0x41} // prefix for the timestamps in unbonding queue RedelegationQueueKey = []byte{0x42} // prefix for the timestamps in redelegations queue ValidatorQueueKey = []byte{0x43} // prefix for the timestamps in validator queue HistoricalInfoKey = []byte{0x50} // prefix for the historical info )
Functions ¶
func AddressFromLastValidatorPowerKey ¶
Get the validator operator address from LastValidatorPowerKey
func GetDelegationKey ¶
func GetDelegationKey(delAddr sdk.AccAddress, valAddr sdk.ValAddress) []byte
gets the key for delegator bond with validator VALUE: staking/Delegation
func GetDelegationsKey ¶
func GetDelegationsKey(delAddr sdk.AccAddress) []byte
gets the prefix for a delegator for all validators
func GetHistoricalInfoKey ¶
GetHistoricalInfoKey returns a key prefix for indexing HistoricalInfo objects.
func GetLastValidatorPowerKey ¶
func GetLastValidatorPowerKey(operator sdk.ValAddress) []byte
get the bonded validator index key for an operator address
func GetREDByValDstIndexKey ¶
func GetREDByValDstIndexKey(delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress) []byte
gets the index-key for a redelegation, stored by destination-validator-index VALUE: none (key rearrangement used)
func GetREDByValSrcIndexKey ¶
func GetREDByValSrcIndexKey(delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress) []byte
gets the index-key for a redelegation, stored by source-validator-index VALUE: none (key rearrangement used)
func GetREDKey ¶
func GetREDKey(delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress) []byte
GetREDKey returns a key prefix for indexing a redelegation from a delegator and source validator to a destination validator.
func GetREDKeyFromValDstIndexKey ¶
GetREDKeyFromValDstIndexKey rearranges the ValDstIndexKey to get the REDKey
func GetREDKeyFromValSrcIndexKey ¶
GetREDKeyFromValSrcIndexKey rearranges the ValSrcIndexKey to get the REDKey
func GetREDsFromValSrcIndexKey ¶
func GetREDsFromValSrcIndexKey(valSrcAddr sdk.ValAddress) []byte
GetREDsFromValSrcIndexKey returns a key prefix for indexing a redelegation to a source validator.
func GetREDsKey ¶
func GetREDsKey(delAddr sdk.AccAddress) []byte
GetREDsKey returns a key prefix for indexing a redelegation from a delegator address.
func GetREDsToValDstIndexKey ¶
func GetREDsToValDstIndexKey(valDstAddr sdk.ValAddress) []byte
func GetRedelegationTimeKey ¶
GetRedelegationTimeKey returns a key prefix for indexing an unbonding redelegation based on a completion time.
func GetUBDByValIndexKey ¶
func GetUBDByValIndexKey(delAddr sdk.AccAddress, valAddr sdk.ValAddress) []byte
gets the index-key for an unbonding delegation, stored by validator-index VALUE: none (key rearrangement used)
func GetUBDKey ¶
func GetUBDKey(delAddr sdk.AccAddress, valAddr sdk.ValAddress) []byte
gets the key for an unbonding delegation by delegator and validator addr VALUE: staking/UnbondingDelegation
func GetUBDKeyFromValIndexKey ¶
rearranges the ValIndexKey to get the UBDKey
func GetUBDsByValIndexKey ¶
func GetUBDsByValIndexKey(valAddr sdk.ValAddress) []byte
gets the prefix keyspace for the indexes of unbonding delegations for a validator
func GetUBDsKey ¶
func GetUBDsKey(delAddr sdk.AccAddress) []byte
gets the prefix for all unbonding delegations from a delegator
func GetUnbondingDelegationTimeKey ¶
gets the prefix for all unbonding delegations from a delegator
func GetValidatorByConsAddrKey ¶
func GetValidatorByConsAddrKey(addr sdk.ConsAddress) []byte
gets the key for the validator with pubkey VALUE: validator operator address ([]byte)
func GetValidatorKey ¶
func GetValidatorKey(operatorAddr sdk.ValAddress) []byte
gets the key for the validator with address VALUE: staking/Validator
func GetValidatorQueueKey ¶
GetValidatorQueueKey returns the prefix key used for getting a set of unbonding validators whose unbonding completion occurs at the given time and height.
func GetValidatorsByPowerIndexKey ¶
get the validator by power index. Power index is the key used in the power-store, and represents the relative power ranking of the validator. VALUE: validator operator address ([]byte)
Types ¶
This section is empty.