Documentation ¶
Index ¶
- Constants
- Variables
- func BeginBlocker(ctx sdk.Context, k Keeper, req abci.RequestBeginBlock)
- func DelegationsCounterInvariant(k Keeper) sdk.Invariant
- func EndBlocker(ctx sdk.Context, k Keeper, req abci.RequestEndBlock) []abci.ValidatorUpdate
- func NewDecreasingFactors() *decreasingFactors
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func NewSlashesAccumulator(k Keeper, ctx sdk.Context, slashFactor sdk.Dec, factors *decreasingFactors) *slashesAccumulator
- func RegisterInvariants(registry sdk.InvariantRegistry, k Keeper)
- func StakedCustomCoinInvariant(k Keeper) sdk.Invariant
- func TokensFromConsensusPower(power int64) sdkmath.Int
- func TokensToConsensusPower(tokens sdkmath.Int) int64
- type Keeper
- func (k *Keeper) AddAccumRewards(ctx sdk.Context, valAddr sdk.ValAddress, r sdkmath.Int) error
- func (k Keeper) AddCustomCoinStaked(ctx sdk.Context, coin sdk.Coin)
- func (k Keeper) AddMissedBlock(ctx sdk.Context, addr sdk.ConsAddress, height int64)
- func (k Keeper) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (k Keeper) AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
- func (k Keeper) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
- func (k Keeper) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) error
- func (k Keeper) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
- func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx sdk.Context) (updates []abci.ValidatorUpdate, err error)
- func (k Keeper) BaseDenom(ctx sdk.Context) (res string)
- func (k Keeper) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (k Keeper) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (k Keeper) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (k Keeper) BeforeValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress) error
- func (k Keeper) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec) error
- func (k Keeper) BeginRedelegation(ctx sdk.Context, delegator sdk.AccAddress, ...) (completionTime time.Time, err error)
- func (k Keeper) BlockValidatorUpdates(ctx sdk.Context) []abci.ValidatorUpdate
- func (k Keeper) BondedRatio(ctx sdk.Context, denom string) sdk.Dec
- func (k Keeper) BondedTotal(ctx sdk.Context, denom string) sdkmath.Int
- func (k Keeper) CalculateCustomCoinPrices(ctx sdk.Context, ccs map[string]sdkmath.Int) map[string]sdk.Dec
- func (k Keeper) CalculateRemainStake(ctx sdk.Context, source, stake types.Stake) (types.Stake, error)
- func (k Keeper) CalculateTotalPowerWithDelegationsAndPrices(ctx sdk.Context, validator sdk.ValAddress, delegations types.Delegations, ...) (sdkmath.Int, error)
- func (k Keeper) CheckDelegations(ctx sdk.Context, validator types.Validator)
- func (k Keeper) CompleteRedelegation(ctx sdk.Context, delegator sdk.AccAddress, ...) (err error)
- func (k Keeper) CompleteUnbonding(ctx sdk.Context, delegator sdk.AccAddress, validator sdk.ValAddress) (err error)
- func (k Keeper) CreateValidator(ctx sdk.Context, validator types.Validator)
- func (k Keeper) DecrementDelegationsCount(ctx sdk.Context, valAddr sdk.ValAddress)
- func (k Keeper) Delegate(ctx sdk.Context, delegator sdk.AccAddress, validator types.Validator, ...) error
- func (k Keeper) Delegation(ctx sdk.Context, delegator sdk.AccAddress, validator sdk.ValAddress, ...) types.DelegationI
- func (k Keeper) DeleteHistoricalInfo(ctx sdk.Context, height int64)
- func (k Keeper) DeleteLastValidatorPower(ctx sdk.Context, operator sdk.ValAddress)
- func (k Keeper) DeleteStartHeight(ctx sdk.Context, addr sdk.ConsAddress)
- func (k Keeper) DeleteValidatorByPowerIndex(ctx sdk.Context, validator types.Validator)
- func (k Keeper) DeleteValidatorQueue(ctx sdk.Context, val types.Validator)
- func (k Keeper) DeleteValidatorQueueTimeSlice(ctx sdk.Context, endTime time.Time, endHeight int64)
- func (k Keeper) DequeueAllMatureRedelegationQueue(ctx sdk.Context) (matureRedelegations []stakingtypes.DVVTriplet)
- func (k Keeper) DequeueAllMatureUBDQueue(ctx sdk.Context, currTime time.Time) (matureUnbonds []stakingtypes.DVPair)
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) GetAllCustomCoinsStaked(ctx sdk.Context) map[string]sdkmath.Int
- func (k Keeper) GetAllDelegations(ctx sdk.Context) (delegations []types.Delegation)
- func (k Keeper) GetAllDelegationsByValidator(ctx sdk.Context) (delegations map[string][]types.Delegation)
- func (k Keeper) GetAllDelegationsCount(ctx sdk.Context) map[string]uint32
- func (k Keeper) GetAllDelegatorDelegations(ctx sdk.Context, delegator sdk.AccAddress) []types.Delegation
- func (k Keeper) GetAllHistoricalInfo(ctx sdk.Context) []types.HistoricalInfo
- func (k Keeper) GetAllRedelegations(ctx sdk.Context, delegator sdk.AccAddress, ...) []types.Redelegation
- func (k Keeper) GetAllSDKDelegations(ctx sdk.Context) (delegations []types.Delegation)
- func (k Keeper) GetAllUndelegations(ctx sdk.Context, delegator sdk.AccAddress) []types.Undelegation
- func (k Keeper) GetAllValidators(ctx sdk.Context) (validators []types.Validator)
- func (k Keeper) GetAllValidatorsByPowerIndex(ctx sdk.Context) (types.Validators, []int64, sdkmath.Int)
- func (k Keeper) GetAllValidatorsByPowerIndexReversed(ctx sdk.Context) []types.Validator
- func (k Keeper) GetBondedPool(ctx sdk.Context) (bondedPool authtypes.ModuleAccountI)
- func (k Keeper) GetBondedValidatorsByPower(ctx sdk.Context) []types.Validator
- func (k Keeper) GetCustomCoinStaked(ctx sdk.Context, denom string) sdkmath.Int
- func (k Keeper) GetDelegation(ctx sdk.Context, delegator sdk.AccAddress, validator sdk.ValAddress, ...) (delegation types.Delegation, found bool)
- func (k Keeper) GetDelegationsCount(ctx sdk.Context, valAddr sdk.ValAddress) uint32
- func (k Keeper) GetDelegatorBonded(ctx sdk.Context, delegator sdk.AccAddress) sdkmath.Int
- func (k Keeper) GetDelegatorDelegations(ctx sdk.Context, delegator sdk.AccAddress, maxRetrieve uint16) (delegations []types.Delegation)
- func (k Keeper) GetDelegatorUnbonding(ctx sdk.Context, delegator sdk.AccAddress) sdkmath.Int
- func (k Keeper) GetDelegatorValidator(ctx sdk.Context, delegator sdk.AccAddress, validator sdk.ValAddress) (v types.Validator, err error)
- func (k Keeper) GetDelegatorValidatorDelegations(ctx sdk.Context, delegator sdk.AccAddress, validator sdk.ValAddress, ...) (delegations []types.Delegation)
- func (k Keeper) GetDelegatorValidators(ctx sdk.Context, delegator sdk.AccAddress, maxRetrieve uint32) types.Validators
- func (k Keeper) GetHistoricalInfo(ctx sdk.Context, height int64) (stakingtypes.HistoricalInfo, bool)
- func (k Keeper) GetHistoricalInfoDecimal(ctx sdk.Context, height int64) (types.HistoricalInfo, bool)
- func (k Keeper) GetLastTotalPower(ctx sdk.Context) sdkmath.Int
- 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) GetNotBondedPool(ctx sdk.Context) (notBondedPool authtypes.ModuleAccountI)
- func (k Keeper) GetParams(ctx sdk.Context) types.Params
- func (k Keeper) GetRedelegation(ctx sdk.Context, delegator sdk.AccAddress, ...) (red types.Redelegation, found bool)
- func (k Keeper) GetRedelegationQueueTimeSlice(ctx sdk.Context, timestamp time.Time) (dvvTriplets []stakingtypes.DVVTriplet)
- func (k Keeper) GetRedelegations(ctx sdk.Context, delegator sdk.AccAddress, maxRetrieve uint16) (redelegations []types.Redelegation)
- func (k Keeper) GetRedelegationsFromSrcValidator(ctx sdk.Context, validatorSrc sdk.ValAddress) (reds []types.Redelegation)
- func (k Keeper) GetStartHeight(ctx sdk.Context, addr sdk.ConsAddress) int64
- func (k Keeper) GetUBDQueueTimeSlice(ctx sdk.Context, timestamp time.Time) (dvPairs []stakingtypes.DVPair)
- func (k Keeper) GetUnbondingValidators(ctx sdk.Context, endTime time.Time, endHeight int64) []string
- func (k Keeper) GetUndelegation(ctx sdk.Context, delegator sdk.AccAddress, validator sdk.ValAddress) (ubd types.Undelegation, found bool)
- func (k Keeper) GetUndelegations(ctx sdk.Context, delegator sdk.AccAddress, maxRetrieve uint16) (undelegations []types.Undelegation)
- func (k Keeper) GetUndelegationsFromValidator(ctx sdk.Context, validator sdk.ValAddress) (ubds []types.Undelegation)
- 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 stakingtypes.Validator, found bool)
- func (k Keeper) GetValidatorByConsAddrDecimal(ctx sdk.Context, consAddr sdk.ConsAddress) (validator types.Validator, found bool)
- func (k Keeper) GetValidatorByPowerIndexKey(validator types.Validator) []byte
- func (k Keeper) GetValidatorDelegations(ctx sdk.Context, validator sdk.ValAddress) (delegations []types.Delegation)
- func (k Keeper) GetValidatorRS(ctx sdk.Context, valAddr sdk.ValAddress) (rewards types.ValidatorRS, err error)
- func (k Keeper) GetValidatorSigningInfo(ctx sdk.Context, addr sdk.ConsAddress, fromHeight, toHeight int64) types.ValidatorSigningInfo
- func (k Keeper) GetValidators(ctx sdk.Context, maxRetrieve uint32) (validators []types.Validator)
- func (k Keeper) HandleDoubleSign(ctx sdk.Context, addr crypto.Address, infractionHeight int64, ...)
- func (k Keeper) HandleValidatorSignature(ctx sdk.Context, addr cryptotypes.Address, power int64, signed bool, ...)
- func (k Keeper) HasDelegations(ctx sdk.Context, validator sdk.ValAddress) bool
- func (k Keeper) HasMaxRedelegationEntries(ctx sdk.Context, delegator sdk.AccAddress, ...) bool
- func (k Keeper) HasMaxUndelegationEntries(ctx sdk.Context, delegator sdk.AccAddress, validator sdk.ValAddress) bool
- func (k Keeper) HasReceivingRedelegation(ctx sdk.Context, delegator sdk.AccAddress, validatorDst sdk.ValAddress) bool
- func (k Keeper) HasRedelegations(ctx sdk.Context, validator sdk.ValAddress) bool
- func (k Keeper) HasUndelegations(ctx sdk.Context, validator sdk.ValAddress) bool
- func (k Keeper) HasValidatorByPowerIndex(ctx sdk.Context, validator types.Validator) bool
- func (k Keeper) HistoricalEntries(ctx sdk.Context) (res uint32)
- func (k Keeper) IncrementDelegationsCount(ctx sdk.Context, valAddr sdk.ValAddress)
- func (k Keeper) InitGenesis(ctx sdk.Context, data *types.GenesisState) (res []abci.ValidatorUpdate)
- func (k Keeper) InsertRedelegationQueue(ctx sdk.Context, red types.Redelegation, completionTime time.Time)
- func (k Keeper) InsertUBDQueue(ctx sdk.Context, ubd types.Undelegation, completionTime time.Time)
- func (k Keeper) InsertUnbondingValidatorQueue(ctx sdk.Context, val types.Validator)
- func (k Keeper) IterateAllCustomCoinStaked(ctx sdk.Context, cb func(denom string, amount sdkmath.Int) bool)
- func (k Keeper) IterateAllDelegations(ctx sdk.Context, cb func(delegation types.Delegation) (stop bool))
- func (k Keeper) IterateBondedValidatorsByPower(ctx sdk.Context, ...)
- func (k Keeper) IterateDelegations(ctx sdk.Context, delAddr sdk.AccAddress, ...)
- func (k Keeper) IterateDelegatorDelegations(ctx sdk.Context, delegator sdk.AccAddress, ...)
- func (k Keeper) IterateDelegatorRedelegations(ctx sdk.Context, delegator sdk.AccAddress, ...)
- func (k Keeper) IterateDelegatorUndelegations(ctx sdk.Context, delegator sdk.AccAddress, ...)
- func (k Keeper) IterateHistoricalInfo(ctx sdk.Context, cb func(types.HistoricalInfo) bool)
- func (k Keeper) IterateLastValidatorPowers(ctx sdk.Context, ...)
- func (k Keeper) IterateLastValidators(ctx sdk.Context, fn func(index int64, validator types.ValidatorI) (stop bool))
- func (k Keeper) IterateRedelegations(ctx sdk.Context, fn func(index int64, red types.Redelegation) (stop bool))
- func (k Keeper) IterateUndelegations(ctx sdk.Context, fn func(index int64, ubd types.Undelegation) (stop bool))
- func (k Keeper) IterateValidators(ctx sdk.Context, fn func(index int64, validator types.ValidatorI) (stop bool))
- func (k Keeper) Jail(ctx sdk.Context, consAddr sdk.ConsAddress)
- func (k Keeper) LastValidatorsIterator(ctx sdk.Context) (iterator sdk.Iterator)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MaxDelegations(ctx sdk.Context) (res uint32)
- func (k Keeper) MaxEntries(ctx sdk.Context) (res uint32)
- func (k Keeper) MaxValidators(ctx sdk.Context) (res uint32)
- func (k Keeper) MinSignedPerWindow(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) MustGetValidatorRS(ctx sdk.Context, validator *types.Validator)
- func (k Keeper) PayRewards(ctx sdk.Context) error
- func (k Keeper) PayValidators(ctx sdk.Context)
- func (k Keeper) RedelegationQueueIterator(ctx sdk.Context, endTime time.Time) sdk.Iterator
- func (k Keeper) RedelegationTime(ctx sdk.Context) (res time.Duration)
- func (k Keeper) RemoveDelegation(ctx sdk.Context, delegation types.Delegation) error
- func (k Keeper) RemoveRedelegation(ctx sdk.Context, red types.Redelegation)
- func (k Keeper) RemoveUndelegation(ctx sdk.Context, ubd types.Undelegation)
- func (k Keeper) RemoveValidator(ctx sdk.Context, address sdk.ValAddress)
- func (k Keeper) SetCustomCoinStaked(ctx sdk.Context, denom string, amount sdkmath.Int)
- func (k Keeper) SetDelegation(ctx sdk.Context, delegation types.Delegation)
- func (k Keeper) SetHistoricalInfo(ctx sdk.Context, height int64, hi *types.HistoricalInfo)
- func (k Keeper) SetLastTotalPower(ctx sdk.Context, power sdkmath.Int)
- 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) SetRedelegation(ctx sdk.Context, red types.Redelegation)
- func (k Keeper) SetRedelegationEntry(ctx sdk.Context, delegator sdk.AccAddress, validatorSrc sdk.ValAddress, ...) types.Redelegation
- func (k Keeper) SetRedelegationQueueTimeSlice(ctx sdk.Context, timestamp time.Time, keys []stakingtypes.DVVTriplet)
- func (k Keeper) SetStartHeight(ctx sdk.Context, addr sdk.ConsAddress, height int64)
- func (k Keeper) SetUBDQueueTimeSlice(ctx sdk.Context, timestamp time.Time, keys []stakingtypes.DVPair)
- func (k Keeper) SetUnbondingValidatorsQueue(ctx sdk.Context, endTime time.Time, endHeight int64, addrs []string)
- func (k Keeper) SetUndelegation(ctx sdk.Context, ubd types.Undelegation)
- func (k Keeper) SetUndelegationEntry(ctx sdk.Context, delegator sdk.AccAddress, validator sdk.ValAddress, ...) types.Undelegation
- func (k Keeper) SetValidator(ctx sdk.Context, validator types.Validator)
- func (k Keeper) SetValidatorByConsAddr(ctx sdk.Context, validator types.Validator) error
- func (k Keeper) SetValidatorByPowerIndex(ctx sdk.Context, validator types.Validator)
- func (k Keeper) SetValidatorRS(ctx sdk.Context, valAddr sdk.ValAddress, rewards types.ValidatorRS)
- func (k Keeper) SignedBlockWindow(ctx sdk.Context) (res int64)
- func (k Keeper) SignedBlocksWindow(ctx sdk.Context) (res int64)
- func (k Keeper) Slash(ctx sdk.Context, consAddr sdk.ConsAddress, infractionHeight int64, power int64, ...)
- func (k Keeper) SlashFractionDoubleSign(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) SlashFractionDowntime(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) SubCustomCoinStaked(ctx sdk.Context, coin sdk.Coin)
- func (k *Keeper) ToBaseCoin(ctx sdk.Context, c sdk.Coin) sdk.Coin
- func (k Keeper) TotalBondedTokens(_ sdk.Context) sdk.Int
- func (k Keeper) TrackHistoricalInfo(ctx sdk.Context)
- func (k Keeper) TransferStakeBetweenPools(ctx sdk.Context, statusSrc types.BondStatus, statusDst types.BondStatus, ...) error
- func (k Keeper) UBDQueueIterator(ctx sdk.Context, endTime time.Time) sdk.Iterator
- func (k Keeper) Unbond(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, ...) (err error)
- func (k Keeper) UnbondAllMatureValidators(ctx sdk.Context)
- func (k Keeper) UnbondingTime(ctx sdk.Context) (res time.Duration)
- func (k Keeper) UnbondingToUnbonded(ctx sdk.Context, validator types.Validator) types.Validator
- func (k Keeper) Undelegate(ctx sdk.Context, delegator sdk.AccAddress, valAddress sdk.ValAddress, ...) (time.Time, error)
- func (k Keeper) UndelegationTime(ctx sdk.Context) (res time.Duration)
- func (k Keeper) Unjail(ctx sdk.Context, consAddr sdk.ConsAddress)
- func (k Keeper) Validator(ctx sdk.Context, address sdk.ValAddress) types.ValidatorI
- func (k Keeper) ValidatorByConsAddr(ctx sdk.Context, addr sdk.ConsAddress) stakingtypes.ValidatorI
- func (k Keeper) ValidatorQueueIterator(ctx sdk.Context, endTime time.Time, endHeight int64) sdk.Iterator
- func (k Keeper) ValidatorsPowerStoreIterator(ctx sdk.Context) sdk.Iterator
- type Migrator
- type Querier
- func (k Querier) CustomCoinPrice(c context.Context, req *types.QueryCustomCoinPriceRequest) (*types.QueryCustomCoinPriceResponse, error)
- func (k Querier) Delegations(c context.Context, req *types.QueryDelegationsRequest) (*types.QueryDelegationsResponse, error)
- func (k Querier) DelegatorDelegations(c context.Context, req *types.QueryDelegatorDelegationsRequest) (*types.QueryDelegatorDelegationsResponse, error)
- func (k Querier) DelegatorRedelegations(c context.Context, req *types.QueryDelegatorRedelegationsRequest) (*types.QueryDelegatorRedelegationsResponse, error)
- func (k Querier) DelegatorUndelegations(c context.Context, req *types.QueryDelegatorUndelegationsRequest) (*types.QueryDelegatorUndelegationsResponse, error)
- func (k Querier) DelegatorValidator(c context.Context, req *types.QueryDelegatorValidatorRequest) (*types.QueryDelegatorValidatorResponse, error)
- func (k Querier) DelegatorValidators(c context.Context, req *types.QueryDelegatorValidatorsRequest) (*types.QueryDelegatorValidatorsResponse, error)
- func (k Querier) HistoricalInfo(c context.Context, req *types.QueryHistoricalInfoRequest) (*types.QueryHistoricalInfoResponse, error)
- func (k Querier) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Querier) Pool(c context.Context, _ *types.QueryPoolRequest) (*types.QueryPoolResponse, error)
- func (k Querier) Redelegations(c context.Context, req *types.QueryRedelegationsRequest) (*types.QueryRedelegationsResponse, error)
- func (k Querier) TotalCustomCoin(c context.Context, req *types.QueryTotalCustomCoinRequest) (*types.QueryTotalCustomCoinResponse, error)
- func (k Querier) Undelegation(c context.Context, req *types.QueryUndelegationRequest) (*types.QueryUndelegationResponse, error)
- func (k Querier) Validator(c context.Context, req *types.QueryValidatorRequest) (*types.QueryValidatorResponse, error)
- func (k Querier) ValidatorDelegations(c context.Context, req *types.QueryValidatorDelegationsRequest) (*types.QueryValidatorDelegationsResponse, error)
- func (k Querier) ValidatorRedelegations(c context.Context, req *types.QueryValidatorRedelegationsRequest) (*types.QueryValidatorRedelegationsResponse, error)
- func (k Querier) ValidatorUndelegations(c context.Context, req *types.QueryValidatorUndelegationsRequest) (*types.QueryValidatorUndelegationsResponse, error)
- func (k Querier) Validators(c context.Context, req *types.QueryValidatorsRequest) (*types.QueryValidatorsResponse, error)
Constants ¶
const DAOAddress1 = "dx18tay9ayumxjun9sexlq4t3nvt7zts5typnyjdr"
const DAOAddress2 = "dx1w54s4wq8atjmmu4snv0tt72qpvtg38megw5ngn"
const DAOAddress3 = "dx19ws36j00axpk0ytumc20l9wyv0ae26zygk2z0f"
const DevelopAddress1 = "dx1fpjhs2wlaz6dd95d0lmxj5tfrmncwg437jh0y3"
const DevelopAddress2 = "dx1lfleqkc39pt2jkyhr7m845x207kh5d9av3423z"
const DevelopAddress3 = "dx1f46tyn4wmnvuxfj9cu5yn6vn939spfzt3yhxey"
Variables ¶
var DAOCommission = sdk.NewDec(5).QuoInt64(100)
var DevelopCommission = sdk.NewDec(5).QuoInt64(100)
Functions ¶
func BeginBlocker ¶
func BeginBlocker(ctx sdk.Context, k Keeper, req abci.RequestBeginBlock)
BeginBlocker will persist the current header and validator set as a historical entry and prune the oldest entry based on the HistoricalEntries parameter
func DelegationsCounterInvariant ¶ added in v0.1.0
func EndBlocker ¶
func EndBlocker(ctx sdk.Context, k Keeper, req abci.RequestEndBlock) []abci.ValidatorUpdate
Called every block, update validator set
func NewDecreasingFactors ¶
func NewDecreasingFactors() *decreasingFactors
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the validator MsgServer interface for the provided Keeper.
func NewSlashesAccumulator ¶
func RegisterInvariants ¶ added in v0.1.0
func RegisterInvariants(registry sdk.InvariantRegistry, k Keeper)
func StakedCustomCoinInvariant ¶ added in v0.1.0
StakedCustomCoinInvariant checks that helper amounts of custom coins is equal to sum of delegation/undelegations/redelegations
func TokensFromConsensusPower ¶
TokensFromConsensusPower - convert input power to tokens
func TokensToConsensusPower ¶
TokensToConsensusPower converts input tokens to potential consensus-engine power
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper maintains the link to data storage and exposes getter/setter methods for the various parts of the state machine.
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, key storetypes.StoreKey, ps paramtypes.Subspace, ak types.AccountKeeper, bk types.BankKeeper, nk types.NFTKeeper, ck types.CoinKeeper, mk types.MultisigKeeper, ) Keeper
NewKeeper creates new Keeper instance.
func (*Keeper) AddAccumRewards ¶
func (Keeper) AddCustomCoinStaked ¶ added in v0.1.0
func (Keeper) AddMissedBlock ¶
func (Keeper) AfterDelegationModified ¶
func (k Keeper) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
AfterDelegationModified - call hook if registered
func (Keeper) AfterValidatorBeginUnbonding ¶
func (k Keeper) AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
AfterValidatorBeginUnbonding - call hook if registered
func (Keeper) AfterValidatorBonded ¶
func (k Keeper) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
AfterValidatorBonded - call hook if registered
func (Keeper) AfterValidatorCreated ¶
AfterValidatorCreated - call hook if registered
func (Keeper) AfterValidatorRemoved ¶
func (k Keeper) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
AfterValidatorRemoved - call hook if registered
func (Keeper) ApplyAndReturnValidatorSetUpdates ¶
func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx sdk.Context) (updates []abci.ValidatorUpdate, err error)
ApplyAndReturnValidatorSetUpdates applies 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 not-bonded 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.
func (Keeper) BeforeDelegationCreated ¶
func (k Keeper) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
BeforeDelegationCreated - call hook if registered
func (Keeper) BeforeDelegationRemoved ¶
func (k Keeper) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
BeforeDelegationRemoved - call hook if registered
func (Keeper) BeforeDelegationSharesModified ¶
func (k Keeper) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
BeforeDelegationSharesModified - call hook if registered
func (Keeper) BeforeValidatorModified ¶
BeforeValidatorModified - call hook if registered
func (Keeper) BeforeValidatorSlashed ¶
func (k Keeper) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec) error
BeforeValidatorSlashed - call hook if registered
func (Keeper) BeginRedelegation ¶
func (k Keeper) BeginRedelegation( ctx sdk.Context, delegator sdk.AccAddress, validatorSrc, validatorDst sdk.ValAddress, stake types.Stake, remainStake types.Stake, ) (completionTime time.Time, err error)
BeginRedelegation begins unbonding / redelegation and creates a redelegation record. stake and remainStake MUST BE calculated before by ValidateUnbondStake
func (Keeper) BlockValidatorUpdates ¶
func (k Keeper) BlockValidatorUpdates(ctx sdk.Context) []abci.ValidatorUpdate
BlockValidatorUpdates calculates the ValidatorUpdates for the current block Called in each EndBlock
func (Keeper) BondedRatio ¶
BondedRatio returns the fraction of the staking coin which are currently bonded.
func (Keeper) BondedTotal ¶
BondedTotal returns the total staking coin supply which is bonded.
func (Keeper) CalculateCustomCoinPrices ¶
func (Keeper) CalculateRemainStake ¶
func (k Keeper) CalculateRemainStake( ctx sdk.Context, source, stake types.Stake, ) (types.Stake, error)
CalculateRemainStake validates that a given stake can be substracted from source. If the stake is valid, the remain stake is returned, otherwise an error is returned.
func (Keeper) CalculateTotalPowerWithDelegationsAndPrices ¶
func (Keeper) CheckDelegations ¶
func (Keeper) CompleteRedelegation ¶
func (k Keeper) CompleteRedelegation( ctx sdk.Context, delegator sdk.AccAddress, validatorSrc, validatorDst sdk.ValAddress, ) (err error)
CompleteRedelegation completes the redelegations of all mature entries in the retrieved redelegation object and returns the total redelegation (initial) balance or an error upon failure.
func (Keeper) CompleteUnbonding ¶
func (k Keeper) CompleteUnbonding(ctx sdk.Context, delegator sdk.AccAddress, validator sdk.ValAddress) (err error)
CompleteUnbonding completes the unbonding of all mature entries in the retrieved unbonding delegation object and returns the total unbonding balance or an error upon failure.
func (Keeper) CreateValidator ¶
func (Keeper) DecrementDelegationsCount ¶ added in v0.1.0
func (k Keeper) DecrementDelegationsCount(ctx sdk.Context, valAddr sdk.ValAddress)
func (Keeper) Delegate ¶
func (k Keeper) Delegate( ctx sdk.Context, delegator sdk.AccAddress, validator types.Validator, stake types.Stake, ) error
Delegate performs a delegation, set/update everything necessary within the store. tokenSrc indicates the bond status of the incoming funds. NFT subtoken ownership MUST BE checked before
func (Keeper) Delegation ¶
func (k Keeper) Delegation(ctx sdk.Context, delegator sdk.AccAddress, validator sdk.ValAddress, denom string) types.DelegationI
Delegation get the delegation interface for a particular set of delegator and validator addresses.
func (Keeper) DeleteHistoricalInfo ¶
DeleteHistoricalInfo deletes the historical info at a given height.
func (Keeper) DeleteLastValidatorPower ¶
func (k Keeper) DeleteLastValidatorPower(ctx sdk.Context, operator sdk.ValAddress)
Delete the last validator power.
func (Keeper) DeleteStartHeight ¶
func (k Keeper) DeleteStartHeight(ctx sdk.Context, addr sdk.ConsAddress)
func (Keeper) DeleteValidatorByPowerIndex ¶
validator index
func (Keeper) DeleteValidatorQueue ¶
DeleteValidatorQueue removes a validator by address from the unbonding queue indexed by a given height and time.
func (Keeper) DeleteValidatorQueueTimeSlice ¶
DeleteValidatorQueueTimeSlice deletes all entries in the queue indexed by a given height and time.
func (Keeper) DequeueAllMatureRedelegationQueue ¶
func (k Keeper) DequeueAllMatureRedelegationQueue(ctx sdk.Context) (matureRedelegations []stakingtypes.DVVTriplet)
DequeueAllMatureRedelegationQueue returns a concatenated list of all the timeslices inclusively previous to currTime, and deletes the timeslices from the queue.
func (Keeper) DequeueAllMatureUBDQueue ¶
func (k Keeper) DequeueAllMatureUBDQueue(ctx sdk.Context, currTime time.Time) (matureUnbonds []stakingtypes.DVPair)
DequeueAllMatureUBDQueue returns a concatenated list of all the timeslices inclusively previous to currTime, and deletes the timeslices from the queue.
func (Keeper) ExportGenesis ¶
func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
ExportGenesis returns a GenesisState for a given context and keeper. The GenesisState will contain the pool, params, validators, and bonds found in the keeper.
func (Keeper) GetAllCustomCoinsStaked ¶
func (Keeper) GetAllDelegations ¶
func (k Keeper) GetAllDelegations(ctx sdk.Context) (delegations []types.Delegation)
GetAllDelegations returns all delegations (used during genesis dump).
func (Keeper) GetAllDelegationsByValidator ¶
func (k Keeper) GetAllDelegationsByValidator(ctx sdk.Context) (delegations map[string][]types.Delegation)
GetAllDelegationsByValidator returns all delegations by validator stored in the application state.
func (Keeper) GetAllDelegationsCount ¶ added in v0.1.0
func (Keeper) GetAllDelegatorDelegations ¶
func (k Keeper) GetAllDelegatorDelegations(ctx sdk.Context, delegator sdk.AccAddress) []types.Delegation
return all delegations for a delegator
func (Keeper) GetAllHistoricalInfo ¶
func (k Keeper) GetAllHistoricalInfo(ctx sdk.Context) []types.HistoricalInfo
GetAllHistoricalInfo returns all stored HistoricalInfo objects.
func (Keeper) GetAllRedelegations ¶
func (k Keeper) GetAllRedelegations( ctx sdk.Context, delegator sdk.AccAddress, srcValAddress, dstValAddress sdk.ValAddress, ) []types.Redelegation
return all redelegations for a delegator
func (Keeper) GetAllSDKDelegations ¶
func (k Keeper) GetAllSDKDelegations(ctx sdk.Context) (delegations []types.Delegation)
return all delegations used during genesis dump TODO: remove this func, change all usage for iterate functionality
func (Keeper) GetAllUndelegations ¶
func (k Keeper) GetAllUndelegations(ctx sdk.Context, delegator sdk.AccAddress) []types.Undelegation
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) GetAllValidatorsByPowerIndex ¶
func (Keeper) GetAllValidatorsByPowerIndexReversed ¶
func (Keeper) GetBondedPool ¶
func (k Keeper) GetBondedPool(ctx sdk.Context) (bondedPool authtypes.ModuleAccountI)
GetBondedPool returns the bonded coins pool's module account.
func (Keeper) GetBondedValidatorsByPower ¶
get the current group of bonded validators sorted by power-rank
func (Keeper) GetCustomCoinStaked ¶
func (Keeper) GetDelegation ¶
func (k Keeper) GetDelegation(ctx sdk.Context, delegator sdk.AccAddress, validator sdk.ValAddress, denom string) (delegation types.Delegation, found bool)
GetDelegation returns specific delegation by the given delegator address, validator and staked coin's denom.
func (Keeper) GetDelegationsCount ¶ added in v0.1.0
func (Keeper) GetDelegatorBonded ¶
GetDelegatorBonded returs the total amount a delegator has bonded.
func (Keeper) GetDelegatorDelegations ¶
func (k Keeper) GetDelegatorDelegations(ctx sdk.Context, delegator sdk.AccAddress, maxRetrieve uint16) (delegations []types.Delegation)
GetDelegatorDelegations returns a given amount of all the delegations from a delegator.
func (Keeper) GetDelegatorUnbonding ¶
GetDelegatorUnbonding returns the total amount a delegator has unbonding.
func (Keeper) GetDelegatorValidator ¶
func (k Keeper) GetDelegatorValidator(ctx sdk.Context, delegator sdk.AccAddress, validator sdk.ValAddress) (v types.Validator, err error)
return a validator that a delegator is bonded to
func (Keeper) GetDelegatorValidatorDelegations ¶
func (k Keeper) GetDelegatorValidatorDelegations(ctx sdk.Context, delegator sdk.AccAddress, validator sdk.ValAddress, maxRetrieve uint16) (delegations []types.Delegation)
GetDelegatorValidatorDelegations returns a given amount of all the delegations between the validator and the delegator.
func (Keeper) GetDelegatorValidators ¶
func (k Keeper) GetDelegatorValidators(ctx sdk.Context, delegator sdk.AccAddress, maxRetrieve uint32) types.Validators
Return all validators that a delegator is bonded to. If maxRetrieve is supplied, the respective amount will be returned.
func (Keeper) GetHistoricalInfo ¶
func (k Keeper) GetHistoricalInfo(ctx sdk.Context, height int64) (stakingtypes.HistoricalInfo, bool)
GetHistoricalInfo gets the historical info at a given height. compatible for IBCKeeper
func (Keeper) GetHistoricalInfoDecimal ¶
func (k Keeper) GetHistoricalInfoDecimal(ctx sdk.Context, height int64) (types.HistoricalInfo, bool)
GetHistoricalInfo gets the historical info at a given height.
func (Keeper) GetLastTotalPower ¶
GetLastTotalPower loads the last total validators 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) GetNotBondedPool ¶
func (k Keeper) GetNotBondedPool(ctx sdk.Context) (notBondedPool authtypes.ModuleAccountI)
GetNotBondedPool returns the not bonded coins pool's module account.
func (Keeper) GetRedelegation ¶
func (k Keeper) GetRedelegation(ctx sdk.Context, delegator sdk.AccAddress, validatorSrc, validatorDst sdk.ValAddress) (red types.Redelegation, found bool)
GetRedelegation returns a redelegation.
func (Keeper) GetRedelegationQueueTimeSlice ¶
func (k Keeper) GetRedelegationQueueTimeSlice(ctx sdk.Context, timestamp time.Time) (dvvTriplets []stakingtypes.DVVTriplet)
GetRedelegationQueueTimeSlice 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)
GetRedelegations returns a given amount of all the delegator redelegations.
func (Keeper) GetRedelegationsFromSrcValidator ¶
func (k Keeper) GetRedelegationsFromSrcValidator(ctx sdk.Context, validatorSrc sdk.ValAddress) (reds []types.Redelegation)
GetRedelegationsFromSrcValidator returns all redelegations from a particular validator.
func (Keeper) GetStartHeight ¶
func (Keeper) GetUBDQueueTimeSlice ¶
func (k Keeper) GetUBDQueueTimeSlice(ctx sdk.Context, timestamp time.Time) (dvPairs []stakingtypes.DVPair)
GetUBDQueueTimeSlice 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) GetUnbondingValidators ¶
func (k Keeper) GetUnbondingValidators(ctx sdk.Context, endTime time.Time, endHeight int64) []string
GetUnbondingValidators returns a slice of mature validator addresses that complete their unbonding at a given time and height.
func (Keeper) GetUndelegation ¶
func (k Keeper) GetUndelegation(ctx sdk.Context, delegator sdk.AccAddress, validator sdk.ValAddress) (ubd types.Undelegation, found bool)
GetUndelegation returns a unbonding delegation.
func (Keeper) GetUndelegations ¶
func (k Keeper) GetUndelegations(ctx sdk.Context, delegator sdk.AccAddress, maxRetrieve uint16) (undelegations []types.Undelegation)
GetUndelegations returns a given amount of all the delegator unbonding-delegations.
func (Keeper) GetUndelegationsFromValidator ¶
func (k Keeper) GetUndelegationsFromValidator(ctx sdk.Context, validator sdk.ValAddress) (ubds []types.Undelegation)
GetUndelegationsFromValidator returns all unbonding delegations from a particular validator.
func (Keeper) GetValidator ¶
func (Keeper) GetValidatorByConsAddr ¶
func (k Keeper) GetValidatorByConsAddr(ctx sdk.Context, consAddr sdk.ConsAddress) (validator stakingtypes.Validator, found bool)
compatible for StakingKeeper for Ethermint
func (Keeper) GetValidatorByConsAddrDecimal ¶
func (Keeper) GetValidatorByPowerIndexKey ¶
GetValidatorByPowerIndexKey creates the validator by power index. Power index is the key used in the power-store, and represents the relative power ranking of the validator.
func (Keeper) GetValidatorDelegations ¶
func (k Keeper) GetValidatorDelegations(ctx sdk.Context, validator sdk.ValAddress) (delegations []types.Delegation)
GetValidatorDelegations returns all delegations to a specific validator. Useful for querier.
func (Keeper) GetValidatorRS ¶
func (k Keeper) GetValidatorRS(ctx sdk.Context, valAddr sdk.ValAddress) (rewards types.ValidatorRS, err error)
func (Keeper) GetValidatorSigningInfo ¶
func (k Keeper) GetValidatorSigningInfo(ctx sdk.Context, addr sdk.ConsAddress, fromHeight, toHeight int64) types.ValidatorSigningInfo
fromHeight must bee less toHeight [fromHeight, toHeight]
func (Keeper) GetValidators ¶
return a given amount of all the validators
func (Keeper) HandleDoubleSign ¶
func (k Keeper) HandleDoubleSign(ctx sdk.Context, addr crypto.Address, infractionHeight int64, timestamp time.Time, power int64, params types.Params)
handle a validator signing two blocks at the same height power: power of the double-signing validator at the height of infraction
func (Keeper) HandleValidatorSignature ¶
func (k Keeper) HandleValidatorSignature(ctx sdk.Context, addr cryptotypes.Address, power int64, signed bool, params types.Params)
HandleValidatorSignature handles a validator signature, must be called once per validator per block.
func (Keeper) HasDelegations ¶ added in v0.1.0
func (Keeper) HasMaxRedelegationEntries ¶
func (k Keeper) HasMaxRedelegationEntries(ctx sdk.Context, delegator sdk.AccAddress, validatorSrc, validatorDst sdk.ValAddress) bool
HasMaxRedelegationEntries checks if redelegation has maximum number of entries.
func (Keeper) HasMaxUndelegationEntries ¶
func (k Keeper) HasMaxUndelegationEntries(ctx sdk.Context, delegator sdk.AccAddress, validator sdk.ValAddress) bool
HasMaxUndelegationEntries - check if unbonding delegation has maximum number of entries.
func (Keeper) HasReceivingRedelegation ¶
func (k Keeper) HasReceivingRedelegation(ctx sdk.Context, delegator sdk.AccAddress, validatorDst sdk.ValAddress) bool
HasReceivingRedelegation checks if validator is receiving a redelegation.
func (Keeper) HasRedelegations ¶ added in v0.1.0
func (Keeper) HasUndelegations ¶ added in v0.1.0
func (Keeper) HasValidatorByPowerIndex ¶ added in v0.1.0
TODO: remove
func (Keeper) HistoricalEntries ¶
HistoricalEntries returns number of historical info entries to persist in store.
func (Keeper) IncrementDelegationsCount ¶ added in v0.1.0
func (k Keeper) IncrementDelegationsCount(ctx sdk.Context, valAddr sdk.ValAddress)
func (Keeper) InitGenesis ¶
func (k Keeper) InitGenesis(ctx sdk.Context, data *types.GenesisState) (res []abci.ValidatorUpdate)
InitGenesis sets the pool and parameters for the provided keeper. For each validator in data, it sets that validator in the keeper along with manually setting the indexes. In addition, it also sets any delegations found in data. Finally, it updates the bonded validators. Returns final validator set after applying all declaration and delegations
func (Keeper) InsertRedelegationQueue ¶
func (k Keeper) InsertRedelegationQueue(ctx sdk.Context, red types.Redelegation, completionTime time.Time)
InsertRedelegationQueue insert an redelegation delegation to the appropriate timeslice in the redelegation queue.
func (Keeper) InsertUBDQueue ¶
InsertUBDQueue inserts an unbonding delegation to the appropriate timeslice in the unbonding queue.
func (Keeper) InsertUnbondingValidatorQueue ¶
InsertUnbondingValidatorQueue inserts a given unbonding validator address into the unbonding validator queue for a given height and time.
func (Keeper) IterateAllCustomCoinStaked ¶
func (Keeper) IterateAllDelegations ¶
func (k Keeper) IterateAllDelegations(ctx sdk.Context, cb func(delegation types.Delegation) (stop bool))
IterateAllDelegations iterates through all of the delegations.
func (Keeper) IterateBondedValidatorsByPower ¶
func (k Keeper) IterateBondedValidatorsByPower(ctx sdk.Context, fn func(index int64, validator stakingtypes.ValidatorI) (stop bool))
iterate through the bonded validator set and perform the provided function Compatible for cosmos gov keeper TODO: implement
func (Keeper) IterateDelegations ¶
func (k Keeper) IterateDelegations(ctx sdk.Context, delAddr sdk.AccAddress, fn func(index int64, del stakingtypes.DelegationI) (stop bool), )
iterate through all of the delegations from a delegator
func (Keeper) IterateDelegatorDelegations ¶
func (k Keeper) IterateDelegatorDelegations(ctx sdk.Context, delegator sdk.AccAddress, cb func(delegation types.Delegation) (stop bool))
IterateDelegatorDelegations iterates through one delegator's delegations.
func (Keeper) IterateDelegatorRedelegations ¶
func (k Keeper) IterateDelegatorRedelegations(ctx sdk.Context, delegator sdk.AccAddress, cb func(red types.Redelegation) (stop bool))
IterateDelegatorRedelegations iterates through one delegator's redelegations.
func (Keeper) IterateDelegatorUndelegations ¶
func (k Keeper) IterateDelegatorUndelegations(ctx sdk.Context, delegator sdk.AccAddress, cb func(ubd types.Undelegation) (stop bool))
IterateDelegatorUndelegations iterates through a delegator's unbonding delegations.
func (Keeper) IterateHistoricalInfo ¶
IterateHistoricalInfo provides an iterator over all stored HistoricalInfo objects. For each HistoricalInfo object, cb will be called. If the cb returns true, the iterator will close and stop.
func (Keeper) IterateLastValidatorPowers ¶
func (k Keeper) IterateLastValidatorPowers(ctx sdk.Context, handler func(operator sdk.ValAddress, power int64) (stop bool))
Iterate over last validator powers.
func (Keeper) IterateLastValidators ¶
func (k Keeper) IterateLastValidators(ctx sdk.Context, fn func(index int64, validator types.ValidatorI) (stop bool))
iterate through the active validator set and perform the provided function
func (Keeper) IterateRedelegations ¶
func (k Keeper) IterateRedelegations(ctx sdk.Context, fn func(index int64, red types.Redelegation) (stop bool))
IterateRedelegations iterates through all redelegations.
func (Keeper) IterateUndelegations ¶
func (k Keeper) IterateUndelegations(ctx sdk.Context, fn func(index int64, ubd types.Undelegation) (stop bool))
IterateUndelegations iterates through all of the unbonding delegations.
func (Keeper) IterateValidators ¶
func (k Keeper) IterateValidators(ctx sdk.Context, fn func(index int64, validator types.ValidatorI) (stop bool))
iterate through the 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) LastValidatorsIterator ¶
returns an iterator for the consensus validators in the last block
func (Keeper) MaxDelegations ¶
MaxDelegations returns maximum number of delegations.
func (Keeper) MaxEntries ¶
MaxEntries returns maximum number of simultaneous redelegations/undelegations (per trio/pair).
func (Keeper) MaxValidators ¶
MaxValidators returns maximum number of validators.
func (Keeper) MinSignedPerWindow ¶
func (Keeper) MustGetValidatorRS ¶
func (Keeper) PayValidators ¶
func (Keeper) RedelegationQueueIterator ¶
RedelegationQueueIterator returns all the redelegation queue timeslices from time 0 until endTime.
func (Keeper) RedelegationTime ¶
RedelegationTime returns time duration needed to redelegate a stake.
func (Keeper) RemoveDelegation ¶
RemoveDelegation removes a delegation
func (Keeper) RemoveRedelegation ¶
func (k Keeper) RemoveRedelegation(ctx sdk.Context, red types.Redelegation)
RemoveRedelegation removes a redelegation object and associated index.
func (Keeper) RemoveUndelegation ¶
func (k Keeper) RemoveUndelegation(ctx sdk.Context, ubd types.Undelegation)
RemoveUndelegation removes 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 TODO, this function panics, and it's not good.
func (Keeper) SetCustomCoinStaked ¶
func (Keeper) SetDelegation ¶
func (k Keeper) SetDelegation(ctx sdk.Context, delegation types.Delegation)
SetDelegation sets a delegation.
func (Keeper) SetHistoricalInfo ¶
SetHistoricalInfo sets the historical info at a given height.
func (Keeper) SetLastTotalPower ¶
SetLastTotalPower sets the last total validators power.
func (Keeper) SetLastValidatorPower ¶
Set the last validator power.
func (Keeper) SetNewValidatorByPowerIndex ¶
validator index
func (Keeper) SetRedelegation ¶
func (k Keeper) SetRedelegation(ctx sdk.Context, red types.Redelegation)
SetRedelegation set a redelegation and associated index.
func (Keeper) SetRedelegationEntry ¶
func (k Keeper) SetRedelegationEntry( ctx sdk.Context, delegator sdk.AccAddress, validatorSrc sdk.ValAddress, validatorDst sdk.ValAddress, creationHeight int64, minTime time.Time, stake types.Stake, ) types.Redelegation
SetRedelegationEntry adds an entry to the unbonding delegation at the given addresses. It creates the undelegation if it does not exist.
func (Keeper) SetRedelegationQueueTimeSlice ¶
func (k Keeper) SetRedelegationQueueTimeSlice(ctx sdk.Context, timestamp time.Time, keys []stakingtypes.DVVTriplet)
SetRedelegationQueueTimeSlice sets a specific redelegation queue timeslice.
func (Keeper) SetStartHeight ¶
func (Keeper) SetUBDQueueTimeSlice ¶
func (k Keeper) SetUBDQueueTimeSlice(ctx sdk.Context, timestamp time.Time, keys []stakingtypes.DVPair)
SetUBDQueueTimeSlice sets a specific unbonding queue timeslice.
func (Keeper) SetUnbondingValidatorsQueue ¶
func (k Keeper) SetUnbondingValidatorsQueue(ctx sdk.Context, endTime time.Time, endHeight int64, addrs []string)
SetUnbondingValidatorsQueue sets a given slice of validator addresses into the unbonding validator queue by a given height and time.
func (Keeper) SetUndelegation ¶
func (k Keeper) SetUndelegation(ctx sdk.Context, ubd types.Undelegation)
SetUndelegation sets the unbonding delegation and associated index.
func (Keeper) SetUndelegationEntry ¶
func (k Keeper) SetUndelegationEntry( ctx sdk.Context, delegator sdk.AccAddress, validator sdk.ValAddress, creationHeight int64, minTime time.Time, stake types.Stake, ) types.Undelegation
SetUndelegationEntry adds an entry to the unbonding delegation at the given addresses. It creates the unbonding delegation if it does not exist.
func (Keeper) SetValidator ¶
func (Keeper) SetValidatorByConsAddr ¶
validator index
func (Keeper) SetValidatorByPowerIndex ¶
validator index
func (Keeper) SetValidatorRS ¶
func (k Keeper) SetValidatorRS(ctx sdk.Context, valAddr sdk.ValAddress, rewards types.ValidatorRS)
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 delegations & redelegations appropriately
CONTRACT:
slashFactor is non-negative
CONTRACT:
Infraction was 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 was committed at the current height or at a past height, not at a height in the future
func (Keeper) SlashFractionDoubleSign ¶
func (Keeper) SlashFractionDowntime ¶
func (Keeper) SubCustomCoinStaked ¶ added in v0.1.0
func (Keeper) TrackHistoricalInfo ¶
TrackHistoricalInfo saves the latest historical-info and deletes the oldest heights that are below pruning height.
func (Keeper) TransferStakeBetweenPools ¶
func (k Keeper) TransferStakeBetweenPools(ctx sdk.Context, statusSrc types.BondStatus, statusDst types.BondStatus, stake types.Stake) error
func (Keeper) UBDQueueIterator ¶
UBDQueueIterator returns all the unbonding queue timeslices from time 0 until endTime.
func (Keeper) Unbond ¶
func (k Keeper) Unbond(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, stake, remainStake types.Stake) (err error)
func (Keeper) UnbondAllMatureValidators ¶
UnbondAllMatureValidators unbonds all the mature unbonding validators that have finished their unbonding period.
func (Keeper) UnbondingTime ¶
compatible method for IBCKeeper
func (Keeper) UnbondingToUnbonded ¶
func (Keeper) Undelegate ¶
func (k Keeper) Undelegate( ctx sdk.Context, delegator sdk.AccAddress, valAddress sdk.ValAddress, stake types.Stake, remainStake types.Stake, ) (time.Time, error)
Undelegate unbonds a stake from a given validator. stake and remainStake must be calculated before by CalculateUnbondStake It create an unbonding object and insert into the unbonding queue which will be processed during EndBlocker.
func (Keeper) UndelegationTime ¶
UndelegationTime returns time duration needed to undelegate a stake.
func (Keeper) Unjail ¶
func (k Keeper) Unjail(ctx sdk.Context, consAddr sdk.ConsAddress)
unjail a validator
func (Keeper) Validator ¶
func (k Keeper) Validator(ctx sdk.Context, address sdk.ValAddress) types.ValidatorI
Validator gets the Validator interface for a particular address
func (Keeper) ValidatorByConsAddr ¶
func (k Keeper) ValidatorByConsAddr(ctx sdk.Context, addr sdk.ConsAddress) stakingtypes.ValidatorI
ValidatorByConsAddr gets the validator interface for a particular pubkey
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
Migrator is a struct for handling in-place store migrations.
type Querier ¶
type Querier struct {
Keeper
}
Querier is used as Keeper will have duplicate methods if used directly, and gRPC names take precedence over keeper.
func (Querier) CustomCoinPrice ¶ added in v0.1.0
func (k Querier) CustomCoinPrice(c context.Context, req *types.QueryCustomCoinPriceRequest) (*types.QueryCustomCoinPriceResponse, error)
CustomCoinPrice queries the total amount bonded custom coins.
func (Querier) Delegations ¶
func (k Querier) Delegations(c context.Context, req *types.QueryDelegationsRequest) (*types.QueryDelegationsResponse, error)
Delegations queries delegations info for given validator delegator pair.
func (Querier) DelegatorDelegations ¶
func (k Querier) DelegatorDelegations(c context.Context, req *types.QueryDelegatorDelegationsRequest) (*types.QueryDelegatorDelegationsResponse, error)
DelegatorDelegations queries all delegations of a give delegator address
func (Querier) DelegatorRedelegations ¶
func (k Querier) DelegatorRedelegations(c context.Context, req *types.QueryDelegatorRedelegationsRequest) (*types.QueryDelegatorRedelegationsResponse, error)
DelegatorRedelegations queries all redelegations of a given delegator address.
func (Querier) DelegatorUndelegations ¶
func (k Querier) DelegatorUndelegations(c context.Context, req *types.QueryDelegatorUndelegationsRequest) (*types.QueryDelegatorUndelegationsResponse, error)
DelegatorUndelegations queries all undelegations of a given delegator address.
func (Querier) DelegatorValidator ¶
func (k Querier) DelegatorValidator(c context.Context, req *types.QueryDelegatorValidatorRequest) (*types.QueryDelegatorValidatorResponse, error)
DelegatorValidator queries validator info for given delegator validator pair.
func (Querier) DelegatorValidators ¶
func (k Querier) DelegatorValidators(c context.Context, req *types.QueryDelegatorValidatorsRequest) (*types.QueryDelegatorValidatorsResponse, error)
DelegatorValidators queries all validators info for given delegator address.
func (Querier) HistoricalInfo ¶
func (k Querier) HistoricalInfo(c context.Context, req *types.QueryHistoricalInfoRequest) (*types.QueryHistoricalInfoResponse, error)
HistoricalInfo queries the historical info for given height.
func (Querier) Params ¶
func (k Querier) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params queries the module params.
func (Querier) Pool ¶
func (k Querier) Pool(c context.Context, _ *types.QueryPoolRequest) (*types.QueryPoolResponse, error)
Pool queries the pool info.
func (Querier) Redelegations ¶
func (k Querier) Redelegations(c context.Context, req *types.QueryRedelegationsRequest) (*types.QueryRedelegationsResponse, error)
Redelegations queries redelegations info for given validator delegator pair.
func (Querier) TotalCustomCoin ¶ added in v0.1.0
func (k Querier) TotalCustomCoin(c context.Context, req *types.QueryTotalCustomCoinRequest) (*types.QueryTotalCustomCoinResponse, error)
TotalCustomCoin queries the total amount bonded custom coins.
func (Querier) Undelegation ¶
func (k Querier) Undelegation(c context.Context, req *types.QueryUndelegationRequest) (*types.QueryUndelegationResponse, error)
Undelegation queries undelegations info for given validator delegator pair.
func (Querier) Validator ¶
func (k Querier) Validator(c context.Context, req *types.QueryValidatorRequest) (*types.QueryValidatorResponse, error)
Validator queries validator info for given validator address.
func (Querier) ValidatorDelegations ¶
func (k Querier) ValidatorDelegations(c context.Context, req *types.QueryValidatorDelegationsRequest) (*types.QueryValidatorDelegationsResponse, error)
ValidatorDelegations queries delegate info for given validator.
func (Querier) ValidatorRedelegations ¶
func (k Querier) ValidatorRedelegations(c context.Context, req *types.QueryValidatorRedelegationsRequest) (*types.QueryValidatorRedelegationsResponse, error)
ValidatorRedelegations queries redelegations of a validator.
func (Querier) ValidatorUndelegations ¶
func (k Querier) ValidatorUndelegations(c context.Context, req *types.QueryValidatorUndelegationsRequest) (*types.QueryValidatorUndelegationsResponse, error)
ValidatorUndelegations queries undelegations of a validator.
func (Querier) Validators ¶
func (k Querier) Validators(c context.Context, req *types.QueryValidatorsRequest) (*types.QueryValidatorsResponse, error)
Validators queries all validators that match the given status.