Documentation ¶
Overview ¶
nolint
Index ¶
- Constants
- Variables
- func AddressFromLastValidatorPowerKey(key []byte) []byte
- func CreateTestAddr() sdk.AccAddress
- func GetDelegationKey(delAddr sdk.AccAddress, valAddr sdk.ValAddress) []byte
- func GetDelegationKeyByValIndexKey(valAddr sdk.ValAddress, delAddr sdk.AccAddress) []byte
- func GetDelegationsKey(delAddr sdk.AccAddress) []byte
- func GetDelegationsKeyByVal(valAddr sdk.ValAddress) []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 GetREDsByDelToValDstIndexKey(delAddr sdk.AccAddress, valDstAddr sdk.ValAddress) []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 GetSimplifiedDelegationsKey(height int64, valAddr sdk.ValAddress) []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 GetValidatorBySideConsAddrKey(sideConsAddr []byte) []byte
- func GetValidatorHeightKey(height int64) []byte
- func GetValidatorKey(operatorAddr sdk.ValAddress) []byte
- func GetValidatorQueueTimeKey(timestamp time.Time) []byte
- func GetValidatorsByPowerIndexKey(validator types.Validator) []byte
- func MakeTestCodec() *codec.Codec
- func MigratePowerRankKey(ctx sdk.Context, keeper Keeper)
- func MigrateValidators(ctx sdk.Context, k Keeper)
- func MigrateWhiteLabelOracleRelayer(ctx sdk.Context, k Keeper)
- func NewPubKey(pk string) (res crypto.PubKey)
- func ParamTypeTable() params.TypeTable
- func TestAddr(addr string, bech string) sdk.AccAddress
- func TestingUpdateValidator(keeper Keeper, ctx sdk.Context, validator types.Validator) types.Validator
- func ValEq(t *testing.T, exp, got types.Validator) (*testing.T, bool, string, types.Validator, types.Validator)
- func ValidatorByPowerIndexExists(ctx sdk.Context, keeper Keeper, power []byte) bool
- type Keeper
- func CreateTestInput(t *testing.T, isCheckTx bool, initCoins int64) (sdk.Context, auth.AccountKeeper, Keeper)
- func CreateTestInputWithGov(t *testing.T, isCheckTx bool, initCoins int64) (sdk.Context, auth.AccountKeeper, Keeper, gov.Keeper, *codec.Codec)
- func NewKeeper(cdc *codec.Codec, key, rewardKey, tkey sdk.StoreKey, ck bank.Keeper, ...) Keeper
- func (k Keeper) AddPendingABCIValidatorUpdate(ctx sdk.Context, validatorUpdate []abci.ValidatorUpdate)
- func (k Keeper) AddValidatorTokensAndShares(ctx sdk.Context, validator types.Validator, tokensToAdd int64) (valOut types.Validator, addedShares sdk.Dec)
- func (k Keeper) AllocateSlashAmtToValidators(ctx sdk.Context, slashedConsAddr []byte, amount sdk.Dec) (bool, map[string]int64, error)
- func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx sdk.Context) (newVals []types.Validator, updates []abci.ValidatorUpdate)
- func (k Keeper) BaseProposerRewardRatio(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) BeginRedelegation(ctx sdk.Context, delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress, ...) (types.Redelegation, sdk.Error)
- func (k Keeper) BeginUnbonding(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, ...) (types.UnbondingDelegation, sdk.Error)
- func (k Keeper) BondDenom(ctx sdk.Context) (res string)
- func (k Keeper) BondedRatio(ctx sdk.Context) sdk.Dec
- func (k Keeper) BonusProposerRewardRatio(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) CheckIsValidOracleRelayer(ctx sdk.Context, validatorAddress sdk.ValAddress) bool
- func (k Keeper) CheckIsValidOracleRelayerV0(ctx sdk.Context, validatorAddress sdk.ValAddress) bool
- func (k Keeper) CheckIsValidOracleRelayerV1(ctx sdk.Context, validatorAddress sdk.ValAddress) bool
- func (k Keeper) Codespace() sdk.CodespaceType
- func (k Keeper) CompleteRedelegation(ctx sdk.Context, delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress) sdk.Error
- func (k Keeper) CompleteUnbonding(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (types.UnbondingDelegation, sdk.Events, sdk.Error)
- func (k Keeper) Delegate(ctx sdk.Context, delAddr sdk.AccAddress, bondAmt sdk.Coin, ...) (newShares sdk.Dec, err sdk.Error)
- func (k Keeper) Delegation(ctx sdk.Context, addrDel sdk.AccAddress, addrVal sdk.ValAddress) sdk.Delegation
- func (k Keeper) DeleteLastValidatorPower(ctx sdk.Context, operator sdk.ValAddress)
- func (k Keeper) DeleteValidatorByPowerIndex(ctx sdk.Context, validator types.Validator)
- func (k Keeper) DequeueAllMatureRedelegationQueue(ctx sdk.Context, currTime time.Time) (matureRedelegations []types.DVVTriplet)
- func (k Keeper) DequeueAllMatureUnbondingQueue(ctx sdk.Context, currTime time.Time) (matureUnbonds []types.DVPair)
- func (k Keeper) Distribute(ctx sdk.Context, sideChainId string)
- func (k Keeper) DistributeInBlock(ctx sdk.Context, sideChainId string) sdk.Events
- func (k Keeper) DistributeInBreathBlock(ctx sdk.Context, sideChainId string) sdk.Events
- func (k *Keeper) ExecuteAckPackage(ctx sdk.Context, payload []byte) sdk.ExecuteResult
- func (k *Keeper) ExecuteFailAckPackage(ctx sdk.Context, payload []byte) sdk.ExecuteResult
- func (k *Keeper) ExecuteSynPackage(ctx sdk.Context, payload []byte, _ int64) sdk.ExecuteResult
- func (k Keeper) ExistHeightValidators(ctx sdk.Context) bool
- func (k Keeper) ExistValidatorsWithHeight(ctx sdk.Context, height int64) bool
- func (k Keeper) FeeFromAxcToBcRatio(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) GetAllDelegations(ctx sdk.Context) (delegations []types.Delegation)
- func (k Keeper) GetAllDelegatorDelegations(ctx sdk.Context, delegator sdk.AccAddress) (delegations []types.Delegation)
- func (k Keeper) GetAllMatureValidatorQueue(ctx sdk.Context, currTime time.Time) (matureValsAddrs []sdk.ValAddress)
- func (k Keeper) GetAllRedelegations(ctx sdk.Context, delegator sdk.AccAddress) (redelegations []types.Redelegation)
- func (k Keeper) GetAllUnJailValidatorsCount(ctx sdk.Context) (count int64)
- func (k Keeper) GetAllUnbondingDelegations(ctx sdk.Context, delegator sdk.AccAddress) (unbondingDelegations []types.UnbondingDelegation)
- func (k Keeper) GetAllValidators(ctx sdk.Context) (validators []types.Validator)
- func (k Keeper) GetAllValidatorsCount(ctx sdk.Context) (count int64)
- func (k Keeper) GetBondedValidatorsByPower(ctx sdk.Context) []types.Validator
- func (k Keeper) GetDelegation(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (delegation types.Delegation, found bool)
- func (k Keeper) GetDelegatorDelegations(ctx sdk.Context, delegator sdk.AccAddress, maxRetrieve uint16) (delegations []types.Delegation)
- func (k Keeper) GetDelegatorValidator(ctx sdk.Context, delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress) (validator types.Validator, err sdk.Error)
- func (k Keeper) GetDelegatorValidators(ctx sdk.Context, delegatorAddr sdk.AccAddress, maxRetrieve uint16) (validators []types.Validator)
- func (k Keeper) GetEarliestValidatorsWithHeight(ctx sdk.Context) ([]types.Validator, bool)
- func (k Keeper) GetHeightValidatorsByIndex(ctx sdk.Context, indexCountBackwards int) ([]types.Validator, int64, bool)
- func (k Keeper) GetIntraTxCounter(ctx sdk.Context) int16
- func (k Keeper) GetLastTotalPower(ctx sdk.Context) (power int64)
- func (k Keeper) GetLastValidatorPower(ctx sdk.Context, operator sdk.ValAddress) (power int64)
- func (k Keeper) GetLastValidators(ctx sdk.Context) (validators []types.Validator)
- func (k Keeper) GetOracleRelayersPower(ctx sdk.Context) map[string]int64
- func (k Keeper) GetOracleRelayersPowerV0(ctx sdk.Context) map[string]int64
- func (k Keeper) GetOracleRelayersPowerV1(ctx sdk.Context) map[string]int64
- func (k Keeper) GetParams(ctx sdk.Context) (res types.Params)
- func (k Keeper) GetPool(ctx sdk.Context) (pool types.Pool)
- func (k Keeper) GetPrevProposerDistributionAddr(ctx sdk.Context) sdk.AccAddress
- func (k Keeper) GetRedelegation(ctx sdk.Context, delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress) (red types.Redelegation, found bool)
- func (k Keeper) GetRedelegationQueueTimeSlice(ctx sdk.Context, timestamp time.Time) (dvvTriplets []types.DVVTriplet)
- func (k Keeper) GetRedelegations(ctx sdk.Context, delegator sdk.AccAddress, maxRetrieve uint16) (redelegations []types.Redelegation)
- func (k Keeper) GetRedelegationsFromValidator(ctx sdk.Context, valAddr sdk.ValAddress) (reds []types.Redelegation)
- func (k Keeper) GetSimplifiedDelegations(ctx sdk.Context, height int64, validator sdk.ValAddress) (simDels []types.SimplifiedDelegation, found bool)
- func (k Keeper) GetSimplifiedDelegationsByValidator(ctx sdk.Context, validator sdk.ValAddress) (simDelegations []types.SimplifiedDelegation)
- func (k Keeper) GetSortedBondedValidators(ctx sdk.Context) []types.Validator
- func (k Keeper) GetTopValidatorsByPower(ctx sdk.Context, maxRetrieve int) []types.Validator
- func (k Keeper) GetUnbondingDelegation(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (ubd types.UnbondingDelegation, found bool)
- func (k Keeper) GetUnbondingDelegations(ctx sdk.Context, delegator sdk.AccAddress, maxRetrieve uint16) (unbondingDelegations []types.UnbondingDelegation)
- func (k Keeper) GetUnbondingDelegationsFromValidator(ctx sdk.Context, valAddr sdk.ValAddress) (ubds []types.UnbondingDelegation)
- func (k Keeper) GetUnbondingQueueTimeSlice(ctx sdk.Context, timestamp time.Time) (dvPairs []types.DVPair)
- func (k Keeper) GetValidator(ctx sdk.Context, addr sdk.ValAddress) (validator types.Validator, found bool)
- func (k Keeper) GetValidatorByConsAddr(ctx sdk.Context, consAddr sdk.ConsAddress) (validator types.Validator, found bool)
- func (k Keeper) GetValidatorBySideConsAddr(ctx sdk.Context, sideConsAddr []byte) (validator types.Validator, found bool)
- func (k Keeper) GetValidatorQueueTimeSlice(ctx sdk.Context, timestamp time.Time) (valAddrs []sdk.ValAddress)
- func (k Keeper) GetValidatorSet() sdk.ValidatorSet
- func (k Keeper) GetValidators(ctx sdk.Context, maxRetrieve uint16) (validators []types.Validator)
- func (k Keeper) GetValidatorsByHeight(ctx sdk.Context, height int64) (validators []types.Validator, found bool)
- func (k Keeper) GetWhiteLabelOracleRelayer(ctx sdk.Context) (oracleRelayers []types.OracleRelayer)
- func (k Keeper) HasReceivingRedelegation(ctx sdk.Context, delAddr sdk.AccAddress, valDstAddr sdk.ValAddress) bool
- func (k Keeper) InflateSupply(ctx sdk.Context, newTokens sdk.Dec)
- func (k Keeper) InsertRedelegationQueue(ctx sdk.Context, red types.Redelegation)
- func (k Keeper) InsertUnbondingQueue(ctx sdk.Context, ubd types.UnbondingDelegation)
- func (k Keeper) InsertValidatorQueue(ctx sdk.Context, val types.Validator)
- func (k Keeper) IsSelfDelegator(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (bool, sdk.Error)
- func (k Keeper) IterateDelegations(ctx sdk.Context, delAddr sdk.AccAddress, ...)
- func (k Keeper) IterateDelegationsToValidator(ctx sdk.Context, valAddr sdk.ValAddress, ...)
- func (k Keeper) IterateUnbondingDelegations(ctx sdk.Context, ...)
- func (k Keeper) IterateValidators(ctx sdk.Context, fn func(index int64, validator sdk.Validator) (stop bool))
- func (k Keeper) IterateValidatorsBonded(ctx sdk.Context, fn func(index int64, validator sdk.Validator) (stop bool))
- func (k Keeper) Jail(ctx sdk.Context, consAddr sdk.ConsAddress)
- func (k Keeper) JailSideChain(ctx sdk.Context, consAddr []byte)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MaxStakeSnapshots(ctx sdk.Context) (res uint16)
- func (k Keeper) MaxValidators(ctx sdk.Context) (res uint16)
- func (k Keeper) MinDelegationChange(ctx sdk.Context) (res int64)
- func (k Keeper) MinSelfDelegation(ctx sdk.Context) (res int64)
- func (k Keeper) OnDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
- func (k Keeper) OnDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
- func (k Keeper) OnDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
- func (k Keeper) OnSelfDelDropBelowMin(ctx sdk.Context, operator sdk.ValAddress)
- func (k Keeper) OnSideChainValidatorBeginUnbonding(ctx sdk.Context, sideConsAddr []byte, operator sdk.ValAddress)
- func (k Keeper) OnSideChainValidatorBonded(ctx sdk.Context, sideConsAddr []byte, operator sdk.ValAddress)
- func (k Keeper) OnValidatorBeginUnbonding(ctx sdk.Context, address sdk.ConsAddress, operator sdk.ValAddress)
- func (k Keeper) OnValidatorBonded(ctx sdk.Context, address sdk.ConsAddress, operator sdk.ValAddress)
- func (k Keeper) OnValidatorCreated(ctx sdk.Context, address sdk.ValAddress)
- func (k Keeper) OnValidatorModified(ctx sdk.Context, address sdk.ValAddress)
- func (k Keeper) OnValidatorRemoved(ctx sdk.Context, address sdk.ValAddress)
- func (k Keeper) PopPendingABCIValidatorUpdate(ctx sdk.Context) (validatorUpdate []abci.ValidatorUpdate)
- func (k Keeper) RedelegationQueueIterator(ctx sdk.Context, endTime time.Time) sdk.Iterator
- func (k Keeper) RemoveDelegation(ctx sdk.Context, delegation types.Delegation)
- func (k Keeper) RemoveDelegationByVal(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
- func (k Keeper) RemoveRedelegation(ctx sdk.Context, red types.Redelegation)
- func (k Keeper) RemoveSimplifiedDelegations(ctx sdk.Context, height int64, validator sdk.ValAddress)
- func (k Keeper) RemoveUnbondingDelegation(ctx sdk.Context, ubd types.UnbondingDelegation)
- func (k Keeper) RemoveValidator(ctx sdk.Context, address sdk.ValAddress)
- func (k Keeper) RemoveValidatorTokens(ctx sdk.Context, validator types.Validator, tokensToRemove sdk.Dec) types.Validator
- func (k Keeper) RemoveValidatorTokensAndShares(ctx sdk.Context, validator types.Validator, sharesToRemove sdk.Dec) (valOut types.Validator, removedTokens sdk.Dec)
- func (k Keeper) RemoveValidatorsByHeight(ctx sdk.Context, height int64)
- func (k Keeper) RewardDistributionBatchSize(ctx sdk.Context) (res int64)
- func (k Keeper) SaveValidatorSetToIbc(ctx sdk.Context, sideChainId string, ibcPackage types.IbcValidatorSetPackage) (seq uint64, sdkErr sdk.Error)
- func (k Keeper) SetDelegation(ctx sdk.Context, delegation types.Delegation)
- func (k Keeper) SetDelegationByVal(ctx sdk.Context, delegation types.Delegation)
- func (k Keeper) SetIntraTxCounter(ctx sdk.Context, counter int16)
- func (k Keeper) SetLastTotalPower(ctx sdk.Context, power int64)
- func (k Keeper) SetLastValidatorPower(ctx sdk.Context, operator sdk.ValAddress, power int64)
- func (k Keeper) SetNewValidatorByPowerIndex(ctx sdk.Context, validator types.Validator)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k *Keeper) SetPbsbServer(server *pubsub.Server)
- func (k Keeper) SetPool(ctx sdk.Context, pool types.Pool)
- func (k Keeper) SetPrevProposerDistributionAddr(ctx sdk.Context, addr sdk.AccAddress)
- func (k Keeper) SetRedelegation(ctx sdk.Context, red types.Redelegation)
- func (k Keeper) SetRedelegationQueueTimeSlice(ctx sdk.Context, timestamp time.Time, keys []types.DVVTriplet)
- func (k Keeper) SetSimplifiedDelegations(ctx sdk.Context, height int64, validator sdk.ValAddress, ...)
- func (k Keeper) SetUnbondingDelegation(ctx sdk.Context, ubd types.UnbondingDelegation)
- func (k Keeper) SetUnbondingQueueTimeSlice(ctx sdk.Context, timestamp time.Time, keys []types.DVPair)
- func (k Keeper) SetValidator(ctx sdk.Context, validator types.Validator)
- func (k Keeper) SetValidatorByConsAddr(ctx sdk.Context, validator types.Validator)
- func (k Keeper) SetValidatorByPowerIndex(ctx sdk.Context, validator types.Validator)
- func (k Keeper) SetValidatorQueueTimeSlice(ctx sdk.Context, timestamp time.Time, keys []sdk.ValAddress)
- func (k Keeper) SetValidatorsByHeight(ctx sdk.Context, height int64, validators []types.Validator)
- func (k Keeper) SetWhiteLabelOracleRelayer(ctx sdk.Context, oracleRelayers []types.OracleRelayer)
- func (k *Keeper) SetupForSideChain(scKeeper *sidechain.Keeper, ibcKeeper *ibc.Keeper)
- func (k Keeper) Slash(ctx sdk.Context, consAddr sdk.ConsAddress, infractionHeight int64, power int64, ...)
- func (k Keeper) SlashSideChain(ctx sdk.Context, sideChainId string, sideConsAddr []byte, slashAmount sdk.Dec) (sdk.Validator, sdk.Dec, error)
- func (k *Keeper) SubscribeBCParamChange(hub pTypes.BCParamChangePublisher)
- func (k *Keeper) SubscribeParamChange(hub pTypes.ParamChangePublisher)
- func (k Keeper) SyncDelegationByValDel(ctx sdk.Context, valAddr sdk.ValAddress, delAddr sdk.AccAddress)
- func (k Keeper) TotalPower(ctx sdk.Context) sdk.Dec
- func (k Keeper) UnbondAllMatureValidatorQueue(ctx sdk.Context)
- func (k Keeper) UnbondingQueueIterator(ctx sdk.Context, endTime time.Time) sdk.Iterator
- func (k Keeper) UnbondingTime(ctx sdk.Context) (res time.Duration)
- func (k Keeper) Unjail(ctx sdk.Context, consAddr sdk.ConsAddress)
- func (k Keeper) UnjailSideChain(ctx sdk.Context, consAddr []byte)
- func (k Keeper) UpdateAndElectValidators(ctx sdk.Context) (newVals []types.Validator, updates []abci.ValidatorUpdate)
- func (k Keeper) UpdateSideValidatorConsAddr(ctx sdk.Context, validator types.Validator, newConsAddr []byte)
- func (k Keeper) UpdateValidatorCommission(ctx sdk.Context, validator types.Validator, newRate sdk.Dec) (types.Commission, sdk.Error)
- func (k Keeper) UpdateValidatorPubKey(ctx sdk.Context, validator types.Validator, pubkey crypto.PubKey)
- func (k Keeper) ValidateUnbondAmount(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, amt int64) (shares sdk.Dec, err sdk.Error)
- func (k Keeper) Validator(ctx sdk.Context, address sdk.ValAddress) sdk.Validator
- func (k Keeper) ValidatorByConsAddr(ctx sdk.Context, addr sdk.ConsAddress) sdk.Validator
- func (k Keeper) ValidatorBySideChainConsAddr(ctx sdk.Context, sideChainConsAddr []byte) sdk.Validator
- func (k Keeper) ValidatorQueueIterator(ctx sdk.Context, endTime time.Time) sdk.Iterator
- func (k Keeper) WithHooks(sh sdk.StakingHooks) Keeper
Constants ¶
const ChannelId = sdk.ChannelID(8)
const ChannelName = "stake"
const (
DefaultParamspace = "stake"
)
Default parameter namespace
Variables ¶
var ( // Keys for store prefixes // TODO DEPRECATED: delete in next release and reorder keys // ParamKey = []byte{0x00} // key for parameters relating to staking PoolKey = []byte{0x01} // key for the staking pools IntraTxCounterKey = []byte{0x02} // key for intra-block tx index WhiteLabelOracleRelayerKey = []byte{0x03} // key for white label oracle relayer PendingValidatorUpdateKey = []byte{0x04} // key for pending validator update PrevProposerDistributionAddrKey = []byte{0x05} // key for previous proposer distribution address // Last* values are const 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 ValidatorsByHeightKey = []byte{0x24} // prefix for each key to a validator index, by height 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 DelegationKeyByVal = []byte{0x37} // prefix for each key for a delegation, by validator operator and delegator SimplifiedDelegationsKey = []byte{0x38} // prefix for each key for an simplifiedDelegations, by height and 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 SideChainStorePrefixByIdKey = []byte{0x51} // prefix for each key to a side chain store prefix, by side chain id // Keys for reward store prefix RewardBatchKey = []byte{0x01} // key for batch of rewards RewardValDistAddrKey = []byte{0x02} // key for rewards' validator <-> distribution address mapping )
nolint
var ( FeeCollectorAddr = sdk.AccAddress(crypto.AddressHash([]byte("FeeCollector"))) DelegationAccAddr = sdk.AccAddress(crypto.AddressHash([]byte("AximchainStakeDelegation"))) FeeForAllBcValsAccAddr = sdk.AccAddress(crypto.AddressHash([]byte("AximchainStakeFeeForAllBcVals"))) )
var ( Addrs = createTestAddrs(500) PKs = createTestPubKeys(500) )
dummy addresses used for testing
Functions ¶
func AddressFromLastValidatorPowerKey ¶
Get the validator operator address from LastValidatorPowerKey
func CreateTestAddr ¶
func CreateTestAddr() sdk.AccAddress
func GetDelegationKey ¶
func GetDelegationKey(delAddr sdk.AccAddress, valAddr sdk.ValAddress) []byte
gets the key for delegator bond with validator VALUE: stake/types.Delegation
func GetDelegationKeyByValIndexKey ¶
func GetDelegationKeyByValIndexKey(valAddr sdk.ValAddress, delAddr sdk.AccAddress) []byte
gets the key for validator bond with delegator
func GetDelegationsKey ¶
func GetDelegationsKey(delAddr sdk.AccAddress) []byte
gets the prefix for a delegator for all validators
func GetDelegationsKeyByVal ¶
func GetDelegationsKeyByVal(valAddr sdk.ValAddress) []byte
gets the prefix for a validator for all delegator
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
gets the key for a redelegation VALUE: stake/types.RedelegationKey
func GetREDKeyFromValDstIndexKey ¶
GetREDKeyFromValDstIndexKey rearranges the ValDstIndexKey to get the REDKey
func GetREDKeyFromValSrcIndexKey ¶
GetREDKeyFromValSrcIndexKey rearranges the ValSrcIndexKey to get the REDKey
func GetREDsByDelToValDstIndexKey ¶
func GetREDsByDelToValDstIndexKey(delAddr sdk.AccAddress, valDstAddr sdk.ValAddress) []byte
gets the prefix keyspace for all redelegations redelegating towards a destination validator from a particular delegator
func GetREDsFromValSrcIndexKey ¶
func GetREDsFromValSrcIndexKey(valSrcAddr sdk.ValAddress) []byte
gets the prefix keyspace for all redelegations redelegating away from a source validator
func GetREDsKey ¶
func GetREDsKey(delAddr sdk.AccAddress) []byte
gets the prefix keyspace for redelegations from a delegator
func GetREDsToValDstIndexKey ¶
func GetREDsToValDstIndexKey(valDstAddr sdk.ValAddress) []byte
gets the prefix keyspace for all redelegations redelegating towards a destination validator
func GetRedelegationTimeKey ¶
gets the prefix for all unbonding delegations from a delegator
func GetSimplifiedDelegationsKey ¶
func GetSimplifiedDelegationsKey(height int64, valAddr sdk.ValAddress) []byte
gets the prefix for an array of simplified delegation for particular validator and height VALUE: []stake/types.SimplifiedDelegation
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: stake/types.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 GetValidatorBySideConsAddrKey ¶
gets the key for the validator with sideConsAddr VALUE: validator operator address ([]byte) NOTE: here we reuse the `ValidatorsByConsAddrKey` as side chain validator does not need a main chain pubkey(consAddr).
func GetValidatorHeightKey ¶
func GetValidatorKey ¶
func GetValidatorKey(operatorAddr sdk.ValAddress) []byte
gets the key for the validator with address VALUE: stake/types.Validator
func GetValidatorQueueTimeKey ¶
gets the prefix for all unbonding delegations from a delegator
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)
func MigratePowerRankKey ¶
func MigrateValidators ¶
func TestAddr ¶
func TestAddr(addr string, bech string) sdk.AccAddress
for incode address generation
func TestingUpdateValidator ¶
func TestingUpdateValidator(keeper Keeper, ctx sdk.Context, validator types.Validator) types.Validator
update validator for testing
Types ¶
type Keeper ¶
type Keeper struct { BankKeeper bank.Keeper AddrPool *sdk.Pool ScKeeper *sidechain.Keeper DestChainId sdk.ChainID DestChainName string PbsbServer *pubsub.Server // contains filtered or unexported fields }
keeper of the stake store
func CreateTestInput ¶
func CreateTestInput(t *testing.T, isCheckTx bool, initCoins int64) (sdk.Context, auth.AccountKeeper, Keeper)
hodgepodge of all sorts of input required for testing
func CreateTestInputWithGov ¶
func CreateTestInputWithGov(t *testing.T, isCheckTx bool, initCoins int64) (sdk.Context, auth.AccountKeeper, Keeper, gov.Keeper, *codec.Codec)
hodgepodge of all sorts of input required for testing
func (Keeper) AddPendingABCIValidatorUpdate ¶
func (k Keeper) AddPendingABCIValidatorUpdate(ctx sdk.Context, validatorUpdate []abci.ValidatorUpdate)
func (Keeper) AddValidatorTokensAndShares ¶
func (k Keeper) AddValidatorTokensAndShares(ctx sdk.Context, validator types.Validator, tokensToAdd int64) (valOut types.Validator, addedShares sdk.Dec)
Update the tokens of an existing validator, update the validators power index key
func (Keeper) AllocateSlashAmtToValidators ¶
func (k Keeper) AllocateSlashAmtToValidators(ctx sdk.Context, slashedConsAddr []byte, amount sdk.Dec) (bool, map[string]int64, error)
return this map for storing data of validators amount receiving detail. the receiving address as map key, and amount as map value
func (Keeper) ApplyAndReturnValidatorSetUpdates ¶
func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx sdk.Context) (newVals []types.Validator, updates []abci.ValidatorUpdate)
Apply and return accumulated updates to the bonded validator set. Also, * Updates the active valset as keyed by LastValidatorPowerKey. * Updates the total power as keyed by LastTotalPowerKey. * Updates validator status' according to updated powers. * Updates the fee pool bonded vs loose tokens. * Updates relevant indices. It gets called once after genesis, another time maybe after genesis transactions, then once at every EndBlock.
CONTRACT: Only validators with non-zero power or zero-power that were bonded at the previous block height or were removed from the validator set entirely are returned to Tendermint. CONTRACT: When handle the side chain validators, `updates` is not collected
func (Keeper) BaseProposerRewardRatio ¶
func (Keeper) BeginRedelegation ¶
func (k Keeper) BeginRedelegation(ctx sdk.Context, delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress, sharesAmount sdk.Dec) (types.Redelegation, sdk.Error)
complete unbonding an unbonding record
func (Keeper) BeginUnbonding ¶
func (k Keeper) BeginUnbonding(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, sharesAmount sdk.Dec) (types.UnbondingDelegation, sdk.Error)
begin unbonding an unbonding record
func (Keeper) BondedRatio ¶
total power from the bond
func (Keeper) BonusProposerRewardRatio ¶
func (Keeper) CheckIsValidOracleRelayer ¶
func (Keeper) CheckIsValidOracleRelayerV0 ¶
func (Keeper) CheckIsValidOracleRelayerV1 ¶
func (Keeper) CompleteRedelegation ¶
func (k Keeper) CompleteRedelegation(ctx sdk.Context, delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress) sdk.Error
complete unbonding an ongoing redelegation
func (Keeper) CompleteUnbonding ¶
func (k Keeper) CompleteUnbonding(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (types.UnbondingDelegation, sdk.Events, sdk.Error)
complete unbonding an unbonding record CONTRACT: Expects unbonding passed in has finished the unbonding period
func (Keeper) Delegate ¶
func (k Keeper) Delegate(ctx sdk.Context, delAddr sdk.AccAddress, bondAmt sdk.Coin, validator types.Validator, subtractAccount bool) (newShares sdk.Dec, err sdk.Error)
Perform a delegation, set/update everything necessary within the store.
func (Keeper) Delegation ¶
func (k Keeper) Delegation(ctx sdk.Context, addrDel sdk.AccAddress, addrVal sdk.ValAddress) sdk.Delegation
get the delegation for a particular set of delegator and validator addresses
func (Keeper) DeleteLastValidatorPower ¶
func (k Keeper) DeleteLastValidatorPower(ctx sdk.Context, operator sdk.ValAddress)
Delete the last validator power.
func (Keeper) DeleteValidatorByPowerIndex ¶
validator index
func (Keeper) DequeueAllMatureRedelegationQueue ¶
func (k Keeper) DequeueAllMatureRedelegationQueue(ctx sdk.Context, currTime time.Time) (matureRedelegations []types.DVVTriplet)
Returns a concatenated list of all the timeslices before currTime, and deletes the timeslices from the queue
func (Keeper) DequeueAllMatureUnbondingQueue ¶
func (k Keeper) DequeueAllMatureUnbondingQueue(ctx sdk.Context, currTime time.Time) (matureUnbonds []types.DVPair)
Returns a concatenated list of all the timeslices before currTime, and deletes the timeslices from the queue
func (Keeper) DistributeInBlock ¶
DistributeInBlock will 1) actually distribute rewards to delegators, using reward store, 2) clear reward store if needed
func (Keeper) DistributeInBreathBlock ¶
DistributeInBreathBlock will 1) calculate rewards as Distribute does, 2) transfer commissions to all validators, and 3) save delegator's rewards to reward store for later distribution.
func (*Keeper) ExecuteAckPackage ¶
func (*Keeper) ExecuteFailAckPackage ¶
func (*Keeper) ExecuteSynPackage ¶
cross chain app implement
func (Keeper) ExistValidatorsWithHeight ¶
func (Keeper) FeeFromAxcToBcRatio ¶
func (Keeper) GetAllDelegations ¶
func (k Keeper) GetAllDelegations(ctx sdk.Context) (delegations []types.Delegation)
return all delegations used during genesis dump
func (Keeper) GetAllDelegatorDelegations ¶
func (k Keeper) GetAllDelegatorDelegations(ctx sdk.Context, delegator sdk.AccAddress) ( delegations []types.Delegation)
return all delegations for a delegator
func (Keeper) GetAllMatureValidatorQueue ¶
func (k Keeper) GetAllMatureValidatorQueue(ctx sdk.Context, currTime time.Time) (matureValsAddrs []sdk.ValAddress)
Returns a concatenated list of all the timeslices before currTime, and deletes the timeslices from the queue
func (Keeper) GetAllRedelegations ¶
func (k Keeper) GetAllRedelegations(ctx sdk.Context, delegator sdk.AccAddress) (redelegations []types.Redelegation)
return all redelegations for a delegator
func (Keeper) GetAllUnJailValidatorsCount ¶
func (Keeper) GetAllUnbondingDelegations ¶
func (k Keeper) GetAllUnbondingDelegations(ctx sdk.Context, delegator sdk.AccAddress) ( unbondingDelegations []types.UnbondingDelegation)
return all unbonding-delegations for a delegator
func (Keeper) GetAllValidators ¶
get the set of all validators with no limits, used during genesis dump
func (Keeper) GetAllValidatorsCount ¶
func (Keeper) GetBondedValidatorsByPower ¶
get the current group of bonded validators sorted by power-rank
func (Keeper) GetDelegation ¶
func (k Keeper) GetDelegation(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) ( delegation types.Delegation, found bool)
return a specific delegation
func (Keeper) GetDelegatorDelegations ¶
func (k Keeper) GetDelegatorDelegations(ctx sdk.Context, delegator sdk.AccAddress, maxRetrieve uint16) (delegations []types.Delegation)
return a given amount of all the delegations from a delegator
func (Keeper) GetDelegatorValidator ¶
func (k Keeper) GetDelegatorValidator(ctx sdk.Context, delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress) (validator types.Validator, err sdk.Error)
return a validator that a delegator is bonded to
func (Keeper) GetDelegatorValidators ¶
func (k Keeper) GetDelegatorValidators(ctx sdk.Context, delegatorAddr sdk.AccAddress, maxRetrieve uint16) (validators []types.Validator)
Return all validators that a delegator is bonded to. If maxRetrieve is supplied, the respective amount will be returned.
func (Keeper) GetEarliestValidatorsWithHeight ¶
func (Keeper) GetHeightValidatorsByIndex ¶
func (Keeper) GetIntraTxCounter ¶
get the current in-block validator operation counter
func (Keeper) GetLastTotalPower ¶
Load the last total validator power.
func (Keeper) GetLastValidatorPower ¶
Load the last validator power. Returns zero if the operator was not a validator last block.
func (Keeper) GetLastValidators ¶
get the group of the bonded validators
func (Keeper) GetOracleRelayersPower ¶
func (Keeper) GetOracleRelayersPowerV0 ¶
get current validators and their vote power as oracle relayers and vote power in oracle module
func (Keeper) GetOracleRelayersPowerV1 ¶
func (Keeper) GetPrevProposerDistributionAddr ¶
func (k Keeper) GetPrevProposerDistributionAddr(ctx sdk.Context) sdk.AccAddress
func (Keeper) GetRedelegation ¶
func (k Keeper) GetRedelegation(ctx sdk.Context, delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress) (red types.Redelegation, found bool)
return a redelegation
func (Keeper) GetRedelegationQueueTimeSlice ¶
func (k Keeper) GetRedelegationQueueTimeSlice(ctx sdk.Context, timestamp time.Time) (dvvTriplets []types.DVVTriplet)
Gets a specific redelegation queue timeslice. A timeslice is a slice of DVVTriplets corresponding to redelegations that expire at a certain time.
func (Keeper) GetRedelegations ¶
func (k Keeper) GetRedelegations(ctx sdk.Context, delegator sdk.AccAddress, maxRetrieve uint16) (redelegations []types.Redelegation)
return a given amount of all the delegator redelegations
func (Keeper) GetRedelegationsFromValidator ¶
func (k Keeper) GetRedelegationsFromValidator(ctx sdk.Context, valAddr sdk.ValAddress) (reds []types.Redelegation)
return all redelegations from a particular validator
func (Keeper) GetSimplifiedDelegations ¶
func (k Keeper) GetSimplifiedDelegations(ctx sdk.Context, height int64, validator sdk.ValAddress) (simDels []types.SimplifiedDelegation, found bool)
func (Keeper) GetSimplifiedDelegationsByValidator ¶
func (k Keeper) GetSimplifiedDelegationsByValidator(ctx sdk.Context, validator sdk.ValAddress) (simDelegations []types.SimplifiedDelegation)
return all delegations simplified from a validator
func (Keeper) GetSortedBondedValidators ¶
func (Keeper) GetTopValidatorsByPower ¶
func (Keeper) GetUnbondingDelegation ¶
func (k Keeper) GetUnbondingDelegation(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (ubd types.UnbondingDelegation, found bool)
return a unbonding delegation
func (Keeper) GetUnbondingDelegations ¶
func (k Keeper) GetUnbondingDelegations(ctx sdk.Context, delegator sdk.AccAddress, maxRetrieve uint16) (unbondingDelegations []types.UnbondingDelegation)
return a given amount of all the delegator unbonding-delegations
func (Keeper) GetUnbondingDelegationsFromValidator ¶
func (k Keeper) GetUnbondingDelegationsFromValidator(ctx sdk.Context, valAddr sdk.ValAddress) (ubds []types.UnbondingDelegation)
return all unbonding delegations from a particular validator
func (Keeper) GetUnbondingQueueTimeSlice ¶
func (k Keeper) GetUnbondingQueueTimeSlice(ctx sdk.Context, timestamp time.Time) (dvPairs []types.DVPair)
gets a specific unbonding queue timeslice. A timeslice is a slice of DVPairs corresponding to unbonding delegations that expire at a certain time.
func (Keeper) GetValidator ¶
func (k Keeper) GetValidator(ctx sdk.Context, addr sdk.ValAddress) (validator types.Validator, found bool)
get a single validator
func (Keeper) GetValidatorByConsAddr ¶
func (k Keeper) GetValidatorByConsAddr(ctx sdk.Context, consAddr sdk.ConsAddress) (validator types.Validator, found bool)
get a single validator by consensus address
func (Keeper) GetValidatorBySideConsAddr ¶
func (Keeper) GetValidatorQueueTimeSlice ¶
func (k Keeper) GetValidatorQueueTimeSlice(ctx sdk.Context, timestamp time.Time) (valAddrs []sdk.ValAddress)
gets a specific validator queue timeslice. A timeslice is a slice of ValAddresses corresponding to unbonding validators that expire at a certain time.
func (Keeper) GetValidatorSet ¶
func (k Keeper) GetValidatorSet() sdk.ValidatorSet
Returns self as it is both a validatorset and delegationset
func (Keeper) GetValidators ¶
return a given amount of all the validators
func (Keeper) GetValidatorsByHeight ¶
func (Keeper) GetWhiteLabelOracleRelayer ¶
func (k Keeper) GetWhiteLabelOracleRelayer(ctx sdk.Context) (oracleRelayers []types.OracleRelayer)
func (Keeper) HasReceivingRedelegation ¶
func (k Keeper) HasReceivingRedelegation(ctx sdk.Context, delAddr sdk.AccAddress, valDstAddr sdk.ValAddress) bool
check if validator is receiving a redelegation
func (Keeper) InflateSupply ¶
when minting new tokens
func (Keeper) InsertRedelegationQueue ¶
func (k Keeper) InsertRedelegationQueue(ctx sdk.Context, red types.Redelegation)
Insert an redelegation delegation to the appropriate timeslice in the redelegation queue
func (Keeper) InsertUnbondingQueue ¶
func (k Keeper) InsertUnbondingQueue(ctx sdk.Context, ubd types.UnbondingDelegation)
Insert an unbonding delegation to the appropriate timeslice in the unbonding queue
func (Keeper) InsertValidatorQueue ¶
Insert an validator address to the appropriate timeslice in the validator queue
func (Keeper) IsSelfDelegator ¶
func (k Keeper) IsSelfDelegator(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (bool, sdk.Error)
func (Keeper) IterateDelegations ¶
func (k Keeper) IterateDelegations(ctx sdk.Context, delAddr sdk.AccAddress, fn func(index int64, del sdk.Delegation) (stop bool))
iterate through all of the delegations from a delegator
func (Keeper) IterateDelegationsToValidator ¶
func (k Keeper) IterateDelegationsToValidator(ctx sdk.Context, valAddr sdk.ValAddress, fn func(del sdk.Delegation) (stop bool))
iterate through all of the delegations to a validator
func (Keeper) IterateUnbondingDelegations ¶
func (k Keeper) IterateUnbondingDelegations(ctx sdk.Context, fn func(index int64, ubd types.UnbondingDelegation) (stop bool))
iterate through all of the unbonding delegations
func (Keeper) IterateValidators ¶
func (k Keeper) IterateValidators(ctx sdk.Context, fn func(index int64, validator sdk.Validator) (stop bool))
iterate through the active validator set and perform the provided function
func (Keeper) IterateValidatorsBonded ¶
func (k Keeper) IterateValidatorsBonded(ctx sdk.Context, fn func(index int64, validator sdk.Validator) (stop bool))
iterate through the active validator set and perform the provided function
func (Keeper) Jail ¶
func (k Keeper) Jail(ctx sdk.Context, consAddr sdk.ConsAddress)
jail a validator
func (Keeper) JailSideChain ¶
jail a validator
func (Keeper) MaxValidators ¶
MaxValidators - Maximum number of validators
func (Keeper) MinDelegationChange ¶
func (Keeper) OnDelegationCreated ¶
func (k Keeper) OnDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
func (Keeper) OnDelegationRemoved ¶
func (k Keeper) OnDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
func (Keeper) OnDelegationSharesModified ¶
func (k Keeper) OnDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
func (Keeper) OnSelfDelDropBelowMin ¶
func (k Keeper) OnSelfDelDropBelowMin(ctx sdk.Context, operator sdk.ValAddress)
func (Keeper) OnSideChainValidatorBeginUnbonding ¶
func (Keeper) OnSideChainValidatorBonded ¶
func (Keeper) OnValidatorBeginUnbonding ¶
func (k Keeper) OnValidatorBeginUnbonding(ctx sdk.Context, address sdk.ConsAddress, operator sdk.ValAddress)
func (Keeper) OnValidatorBonded ¶
func (k Keeper) OnValidatorBonded(ctx sdk.Context, address sdk.ConsAddress, operator sdk.ValAddress)
func (Keeper) OnValidatorCreated ¶
func (k Keeper) OnValidatorCreated(ctx sdk.Context, address sdk.ValAddress)
Expose the hooks if present
func (Keeper) OnValidatorModified ¶
func (k Keeper) OnValidatorModified(ctx sdk.Context, address sdk.ValAddress)
func (Keeper) OnValidatorRemoved ¶
func (k Keeper) OnValidatorRemoved(ctx sdk.Context, address sdk.ValAddress)
func (Keeper) PopPendingABCIValidatorUpdate ¶
func (k Keeper) PopPendingABCIValidatorUpdate(ctx sdk.Context) (validatorUpdate []abci.ValidatorUpdate)
func (Keeper) RedelegationQueueIterator ¶
Returns all the redelegation queue timeslices from time 0 until endTime
func (Keeper) RemoveDelegation ¶
func (k Keeper) RemoveDelegation(ctx sdk.Context, delegation types.Delegation)
remove a delegation from store
func (Keeper) RemoveDelegationByVal ¶
func (k Keeper) RemoveDelegationByVal(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
remove a delegation stored within key grouped in order of validator and delegator
func (Keeper) RemoveRedelegation ¶
func (k Keeper) RemoveRedelegation(ctx sdk.Context, red types.Redelegation)
remove a redelegation object and associated index
func (Keeper) RemoveSimplifiedDelegations ¶
func (Keeper) RemoveUnbondingDelegation ¶
func (k Keeper) RemoveUnbondingDelegation(ctx sdk.Context, ubd types.UnbondingDelegation)
remove the unbonding delegation object and associated index
func (Keeper) RemoveValidator ¶
func (k Keeper) RemoveValidator(ctx sdk.Context, address sdk.ValAddress)
remove the validator record and associated indexes except for the bonded validator index which is only handled in ApplyAndReturnTendermintUpdates
func (Keeper) RemoveValidatorTokens ¶
func (k Keeper) RemoveValidatorTokens(ctx sdk.Context, validator types.Validator, tokensToRemove sdk.Dec) types.Validator
Update the tokens of an existing validator, update the validators power index key
func (Keeper) RemoveValidatorTokensAndShares ¶
func (k Keeper) RemoveValidatorTokensAndShares(ctx sdk.Context, validator types.Validator, sharesToRemove sdk.Dec) (valOut types.Validator, removedTokens sdk.Dec)
Update the tokens of an existing validator, update the validators power index key
func (Keeper) RemoveValidatorsByHeight ¶
remove the validators stored with key of height
func (Keeper) RewardDistributionBatchSize ¶
func (Keeper) SaveValidatorSetToIbc ¶
func (Keeper) SetDelegation ¶
func (k Keeper) SetDelegation(ctx sdk.Context, delegation types.Delegation)
set the delegation
func (Keeper) SetDelegationByVal ¶
func (k Keeper) SetDelegationByVal(ctx sdk.Context, delegation types.Delegation)
set the delegation indexed by validator operator and delegator
func (Keeper) SetIntraTxCounter ¶
set the current in-block validator operation counter
func (Keeper) SetLastTotalPower ¶
Set the last total validator power.
func (Keeper) SetLastValidatorPower ¶
Set the last validator power.
func (Keeper) SetNewValidatorByPowerIndex ¶
validator index
func (*Keeper) SetPbsbServer ¶
func (Keeper) SetPrevProposerDistributionAddr ¶
func (k Keeper) SetPrevProposerDistributionAddr(ctx sdk.Context, addr sdk.AccAddress)
func (Keeper) SetRedelegation ¶
func (k Keeper) SetRedelegation(ctx sdk.Context, red types.Redelegation)
set a redelegation and associated index
func (Keeper) SetRedelegationQueueTimeSlice ¶
func (k Keeper) SetRedelegationQueueTimeSlice(ctx sdk.Context, timestamp time.Time, keys []types.DVVTriplet)
Sets a specific redelegation queue timeslice.
func (Keeper) SetSimplifiedDelegations ¶
func (k Keeper) SetSimplifiedDelegations(ctx sdk.Context, height int64, validator sdk.ValAddress, simDels []types.SimplifiedDelegation)
func (Keeper) SetUnbondingDelegation ¶
func (k Keeper) SetUnbondingDelegation(ctx sdk.Context, ubd types.UnbondingDelegation)
set the unbonding delegation and associated index
func (Keeper) SetUnbondingQueueTimeSlice ¶
func (k Keeper) SetUnbondingQueueTimeSlice(ctx sdk.Context, timestamp time.Time, keys []types.DVPair)
Sets a specific unbonding queue timeslice.
func (Keeper) SetValidator ¶
set the main record holding validator details
func (Keeper) SetValidatorByConsAddr ¶
validator index
func (Keeper) SetValidatorByPowerIndex ¶
validator index
func (Keeper) SetValidatorQueueTimeSlice ¶
func (k Keeper) SetValidatorQueueTimeSlice(ctx sdk.Context, timestamp time.Time, keys []sdk.ValAddress)
Sets a specific validator queue timeslice.
func (Keeper) SetValidatorsByHeight ¶
func (Keeper) SetWhiteLabelOracleRelayer ¶
func (k Keeper) SetWhiteLabelOracleRelayer(ctx sdk.Context, oracleRelayers []types.OracleRelayer)
func (*Keeper) SetupForSideChain ¶
func (Keeper) Slash ¶
func (k Keeper) Slash(ctx sdk.Context, consAddr sdk.ConsAddress, infractionHeight int64, power int64, slashFactor sdk.Dec)
Slash a validator for an infraction committed at a known height Find the contributing stake at that height and burn the specified slashFactor of it, updating unbonding delegation & redelegations appropriately
CONTRACT:
slashFactor is non-negative
CONTRACT:
Infraction committed equal to or less than an unbonding period in the past, so all unbonding delegations and redelegations from that height are stored
CONTRACT:
Slash will not slash unbonded validators (for the above reason)
CONTRACT:
Infraction committed at the current height or at a past height, not at a height in the future
func (Keeper) SlashSideChain ¶
func (*Keeper) SubscribeBCParamChange ¶
func (k *Keeper) SubscribeBCParamChange(hub pTypes.BCParamChangePublisher)
func (*Keeper) SubscribeParamChange ¶
func (k *Keeper) SubscribeParamChange(hub pTypes.ParamChangePublisher)
func (Keeper) SyncDelegationByValDel ¶
func (k Keeper) SyncDelegationByValDel(ctx sdk.Context, valAddr sdk.ValAddress, delAddr sdk.AccAddress)
func (Keeper) TotalPower ¶
total power from the bond (not last, but current)
func (Keeper) UnbondAllMatureValidatorQueue ¶
Unbonds all the unbonding validators that have finished their unbonding period
func (Keeper) UnbondingQueueIterator ¶
Returns all the unbonding queue timeslices from time 0 until endTime
func (Keeper) UnbondingTime ¶
UnbondingTime
func (Keeper) Unjail ¶
func (k Keeper) Unjail(ctx sdk.Context, consAddr sdk.ConsAddress)
unjail a validator
func (Keeper) UnjailSideChain ¶
unjail a validator
func (Keeper) UpdateAndElectValidators ¶
func (k Keeper) UpdateAndElectValidators(ctx sdk.Context) (newVals []types.Validator, updates []abci.ValidatorUpdate)
update staked tokens snapshots of all validators elect topN validators according to the accumulated staked tokens over snapshotNum
func (Keeper) UpdateSideValidatorConsAddr ¶
func (Keeper) UpdateValidatorCommission ¶
func (k Keeper) UpdateValidatorCommission(ctx sdk.Context, validator types.Validator, newRate sdk.Dec) (types.Commission, sdk.Error)
UpdateValidatorCommission attempts to update a validator's commission rate. An error is returned if the new commission rate is invalid.
func (Keeper) UpdateValidatorPubKey ¶
func (Keeper) ValidateUnbondAmount ¶
func (Keeper) ValidatorByConsAddr ¶
get the sdk.validator for a particular pubkey
func (Keeper) ValidatorBySideChainConsAddr ¶
func (k Keeper) ValidatorBySideChainConsAddr(ctx sdk.Context, sideChainConsAddr []byte) sdk.Validator
get the sdk.validator for a particular consensus address
func (Keeper) ValidatorQueueIterator ¶
Returns all the validator queue timeslices from time 0 until endTime