keeper

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2021 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultParamspace = types.ModuleName
)

Default parameter namespace

Variables

This section is empty.

Functions

func AllInvariants

func AllInvariants(k Keeper) sdk.Invariant

AllInvariants runs all invariants of the staking module.

func DelegatorSharesInvariant

func DelegatorSharesInvariant(k Keeper) sdk.Invariant

DelegatorSharesInvariant checks whether all the delegator shares which persist in the delegator object add up to the correct total delegator shares amount stored in each validator.

func ModuleAccountInvariants

func ModuleAccountInvariants(k Keeper) sdk.Invariant

ModuleAccountInvariants checks that the bonded and notBonded ModuleAccounts pools reflects the tokens actively bonded and not bonded

func NewQuerier

func NewQuerier(k Keeper) sdk.Querier

creates a querier for staking REST endpoints

func NonNegativePowerInvariant

func NonNegativePowerInvariant(k Keeper) sdk.Invariant

NonNegativePowerInvariant checks that all stored validators have >= 0 power.

func ParamKeyTable

func ParamKeyTable() params.KeyTable

ParamTable for staking module

func PositiveDelegationInvariant

func PositiveDelegationInvariant(k Keeper) sdk.Invariant

PositiveDelegationInvariant checks that all stored delegations have > 0 shares.

func RegisterInvariants

func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)

RegisterInvariants registers all staking invariants

Types

type Keeper

type Keeper struct {
	HraKeeper *hra.Keeper
	// contains filtered or unexported fields
}

keeper of the staking store

func NewKeeper

func NewKeeper(
	cdc *codec.Codec, key sdk.StoreKey, supplyKeeper types.SupplyKeeper, paramstore params.Subspace, hk *hra.Keeper,
) Keeper

NewKeeper creates a new staking Keeper instance

func (Keeper) AddValidatorTokensAndShares

func (k Keeper) AddValidatorTokensAndShares(ctx sdk.Context, validator types.Validator,
	tokensToAdd sdk.Int) (valOut types.Validator, addedShares sdk.Dec)

Update the tokens of an existing validator, update the validators power index key

func (Keeper) AfterDelegationModified

func (k Keeper) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)

AfterDelegationModified - call hook if registered

func (Keeper) AfterValidatorBeginUnbonding

func (k Keeper) AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)

AfterValidatorBeginUnbonding - call hook if registered

func (Keeper) AfterValidatorBonded

func (k Keeper) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)

AfterValidatorBonded - call hook if registered

func (Keeper) AfterValidatorCreated

func (k Keeper) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress)

AfterValidatorCreated - call hook if registered

func (Keeper) AfterValidatorRemoved

func (k Keeper) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)

AfterValidatorRemoved - call hook if registered

func (Keeper) ApplyAndReturnValidatorSetUpdates

func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx sdk.Context) (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 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)

BeforeDelegationCreated - call hook if registered

func (Keeper) BeforeDelegationRemoved

func (k Keeper) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)

BeforeDelegationRemoved - call hook if registered

func (Keeper) BeforeDelegationSharesModified

func (k Keeper) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)

BeforeDelegationSharesModified - call hook if registered

func (Keeper) BeforeValidatorModified

func (k Keeper) BeforeValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress)

BeforeValidatorModified - call hook if registered

func (Keeper) BeforeValidatorSlashed

func (k Keeper) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec)

BeforeValidatorSlashed - call hook if registered

func (Keeper) BlockValidatorUpdates

func (k Keeper) BlockValidatorUpdates(ctx sdk.Context) []abci.ValidatorUpdate

Calculate the ValidatorUpdates for the current block Called in each EndBlock

func (Keeper) BondDenom

func (k Keeper) BondDenom(ctx sdk.Context) (res string)

BondDenom - Bondable coin denomination

func (Keeper) BondedRatio

func (k Keeper) BondedRatio(ctx sdk.Context) sdk.Dec

BondedRatio the fraction of the staking tokens which are currently bonded

func (Keeper) CompleteUnbonding

func (k Keeper) CompleteUnbonding(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error

CompleteUnbonding performs the same logic as CompleteUnbondingWithAmount except it does not return the total unbonding amount.

func (Keeper) CompleteUnbondingWithAmount

func (k Keeper) CompleteUnbondingWithAmount(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (sdk.Coins, error)

CompleteUnbondingWithAmount 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) Delegate

func (k Keeper) Delegate(
	ctx sdk.Context, delAddr sdk.AccAddress, bondAmt sdk.Int, tokenSrc sdk.BondStatus,
	validator types.Validator, subtractAccount bool,
) (newShares sdk.Dec, err error)

Perform a delegation, set/update everything necessary within the store. tokenSrc indicates the bond status of the incoming funds.

func (Keeper) Delegation

func (k Keeper) Delegation(ctx sdk.Context, addrDel sdk.AccAddress, addrVal sdk.ValAddress) exported.DelegationI

Delegation get the delegation interface for a particular set of delegator and validator addresses

func (Keeper) DeleteHistoricalInfo

func (k Keeper) DeleteHistoricalInfo(ctx sdk.Context, height int64)

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) DeleteValidatorByPowerIndex

func (k Keeper) DeleteValidatorByPowerIndex(ctx sdk.Context, validator types.Validator)

validator index

func (Keeper) DeleteValidatorByTicket

func (k Keeper) DeleteValidatorByTicket(ctx sdk.Context, validator types.Validator)

validator index

func (Keeper) DeleteValidatorQueue

func (k Keeper) DeleteValidatorQueue(ctx sdk.Context, val types.Validator)

Delete a validator address from the validator queue

func (Keeper) DeleteValidatorQueueTimeSlice

func (k Keeper) DeleteValidatorQueueTimeSlice(ctx sdk.Context, timestamp time.Time)

Deletes a specific validator queue timeslice.

func (Keeper) DequeueAllMatureUBDQueue

func (k Keeper) DequeueAllMatureUBDQueue(ctx sdk.Context,
	currTime time.Time) (matureUnbonds []types.DVPair)

Returns a concatenated list of all the timeslices inclusively previous to currTime, and deletes the timeslices from the queue

func (Keeper) DumpTickets

func (k Keeper) DumpTickets(ctx sdk.Context)

func (Keeper) GetAllDelegations

func (k Keeper) GetAllDelegations(ctx sdk.Context) (delegations []types.Delegation)

GetAllDelegations returns all delegations used during genesis dump

func (Keeper) GetAllDelegatorDelegations

func (k Keeper) GetAllDelegatorDelegations(ctx sdk.Context, delegator sdk.AccAddress) []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) 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) GetAllUnbondingDelegations

func (k Keeper) GetAllUnbondingDelegations(ctx sdk.Context, delegator sdk.AccAddress) []types.UnbondingDelegation

return all unbonding-delegations for a delegator

func (Keeper) GetAllValidators

func (k Keeper) GetAllValidators(ctx sdk.Context) (validators []types.Validator)

get the set of all validators with no limits, used during genesis dump

func (Keeper) GetBondedPool

func (k Keeper) GetBondedPool(ctx sdk.Context) (bondedPool exported.ModuleAccountI)

GetBondedPool returns the bonded tokens pool's module account

func (Keeper) GetBondedValidatorsByPower

func (k Keeper) GetBondedValidatorsByPower(ctx sdk.Context) []types.Validator

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 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) GetHistoricalInfo

func (k Keeper) GetHistoricalInfo(ctx sdk.Context, height int64) (types.HistoricalInfo, bool)

GetHistoricalInfo gets the historical info at a given height

func (Keeper) GetLastTicket

func (k Keeper) GetLastTicket(ctx sdk.Context) (ticket uint64)

func (Keeper) GetLastTotalPower

func (k Keeper) GetLastTotalPower(ctx sdk.Context) (power sdk.Int)

Load the last total validator power.

func (Keeper) GetLastValidatorPower

func (k Keeper) GetLastValidatorPower(ctx sdk.Context, operator sdk.ValAddress) (power int64)

Load the last validator power. Returns zero if the operator was not a validator last block.

func (Keeper) GetLastValidators

func (k Keeper) GetLastValidators(ctx sdk.Context) (validators []types.Validator)

get the group of the bonded validators

func (Keeper) GetNotBondedPool

func (k Keeper) GetNotBondedPool(ctx sdk.Context) (notBondedPool exported.ModuleAccountI)

GetNotBondedPool returns the not bonded tokens pool's module account

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) types.Params

Get all parameteras as types.Params

func (Keeper) GetUBDQueueTimeSlice

func (k Keeper) GetUBDQueueTimeSlice(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) 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) 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) GetValidatorDelegations

func (k Keeper) GetValidatorDelegations(ctx sdk.Context, valAddr sdk.ValAddress) (delegations []types.Delegation)

return all delegations to a specific validator. Useful for querier.

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() types.ValidatorSet

Returns self as it is both a validatorset and delegationset

func (Keeper) GetValidators

func (k Keeper) GetValidators(ctx sdk.Context, maxRetrieve uint16) (validators []types.Validator)

return a given amount of all the validators

func (Keeper) HasMaxUnbondingDelegationEntries

func (k Keeper) HasMaxUnbondingDelegationEntries(ctx sdk.Context,
	delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress) bool

HasMaxUnbondingDelegationEntries - check if unbonding delegation has maximum number of entries

func (Keeper) HistoricalEntries

func (k Keeper) HistoricalEntries(ctx sdk.Context) (res uint16)

HistoricalEntries = number of historical info entries to persist in store

func (Keeper) InsertUBDQueue

func (k Keeper) InsertUBDQueue(ctx sdk.Context, ubd types.UnbondingDelegation,
	completionTime time.Time)

Insert an unbonding delegation to the appropriate timeslice in the unbonding queue

func (Keeper) InsertValidatorQueue

func (k Keeper) InsertValidatorQueue(ctx sdk.Context, val types.Validator)

Insert an validator address to the appropriate timeslice in the validator queue

func (Keeper) IterateAllDelegations

func (k Keeper) IterateAllDelegations(ctx sdk.Context, cb func(delegation types.Delegation) (stop bool))

IterateAllDelegations iterate through all of the delegations

func (Keeper) IterateBondedValidatorsByPower

func (k Keeper) IterateBondedValidatorsByPower(ctx sdk.Context, fn func(index int64, validator exported.ValidatorI) (stop bool))

iterate through the bonded validator set and perform the provided function

func (Keeper) IterateDelegations

func (k Keeper) IterateDelegations(ctx sdk.Context, delAddr sdk.AccAddress,
	fn func(index int64, del exported.DelegationI) (stop bool))

iterate through all of the delegations from a delegator

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 exported.ValidatorI) (stop bool))

iterate through the active validator set and perform the provided function

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 exported.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

func (k Keeper) LastValidatorsIterator(ctx sdk.Context) (iterator sdk.Iterator)

returns an iterator for the consensus validators in the last block

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

Logger returns a module-specific logger.

func (Keeper) MaxEntries

func (k Keeper) MaxEntries(ctx sdk.Context) (res uint16)

MaxEntries - Maximum number of simultaneous unbonding delegations or redelegations (per pair/trio)

func (Keeper) MaxValidators

func (k Keeper) MaxValidators(ctx sdk.Context) (res uint16)

MaxValidators - Maximum number of validators

func (Keeper) RemoveDelegation

func (k Keeper) RemoveDelegation(ctx sdk.Context, delegation types.Delegation)

remove a delegation

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.Int) 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.Int)

Update the tokens of an existing validator, update the validators power index key

func (Keeper) SetDelegation

func (k Keeper) SetDelegation(ctx sdk.Context, delegation types.Delegation)

set a delegation

func (Keeper) SetHistoricalInfo

func (k Keeper) SetHistoricalInfo(ctx sdk.Context, height int64, hi types.HistoricalInfo)

SetHistoricalInfo sets the historical info at a given height

func (*Keeper) SetHooks

func (k *Keeper) SetHooks(sh types.StakingHooks) *Keeper

Set the validator hooks

func (Keeper) SetLastTicket

func (k Keeper) SetLastTicket(ctx sdk.Context, ticket uint64)

func (Keeper) SetLastTotalPower

func (k Keeper) SetLastTotalPower(ctx sdk.Context, power sdk.Int)

Set the last total validator power.

func (Keeper) SetLastValidatorPower

func (k Keeper) SetLastValidatorPower(ctx sdk.Context, operator sdk.ValAddress, power int64)

Set the last validator power.

func (Keeper) SetNewValidatorByPowerIndex

func (k Keeper) SetNewValidatorByPowerIndex(ctx sdk.Context, validator types.Validator)

validator index

func (Keeper) SetNewValidatorByTicket

func (k Keeper) SetNewValidatorByTicket(ctx sdk.Context, validator types.Validator)

validator index

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, params types.Params)

set the params

func (Keeper) SetUBDQueueTimeSlice

func (k Keeper) SetUBDQueueTimeSlice(ctx sdk.Context, timestamp time.Time, keys []types.DVPair)

Sets a specific unbonding queue timeslice.

func (Keeper) SetUnbondingDelegation

func (k Keeper) SetUnbondingDelegation(ctx sdk.Context, ubd types.UnbondingDelegation)

set the unbonding delegation and associated index

func (Keeper) SetUnbondingDelegationEntry

func (k Keeper) SetUnbondingDelegationEntry(ctx sdk.Context,
	delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress,
	creationHeight int64, minTime time.Time, balance sdk.Int) types.UnbondingDelegation

SetUnbondingDelegationEntry 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 (k Keeper) SetValidator(ctx sdk.Context, validator types.Validator)

set the main record holding validator details

func (Keeper) SetValidatorByConsAddr

func (k Keeper) SetValidatorByConsAddr(ctx sdk.Context, validator types.Validator)

validator index

func (Keeper) SetValidatorByPowerIndex

func (k Keeper) SetValidatorByPowerIndex(ctx sdk.Context, validator types.Validator)

validator index

func (Keeper) SetValidatorByTicket

func (k Keeper) SetValidatorByTicket(ctx sdk.Context, validator types.Validator)

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) 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) StakingTokenSupply

func (k Keeper) StakingTokenSupply(ctx sdk.Context) sdk.Int

StakingTokenSupply staking tokens from the total supply

func (Keeper) TotalBondedTokens

func (k Keeper) TotalBondedTokens(ctx sdk.Context) sdk.Int

TotalBondedTokens total staking tokens supply which is bonded

func (Keeper) TrackHistoricalInfo

func (k Keeper) TrackHistoricalInfo(ctx sdk.Context)

TrackHistoricalInfo saves the latest historical-info and deletes the oldest heights that are below pruning height

func (Keeper) UBDQueueIterator

func (k Keeper) UBDQueueIterator(ctx sdk.Context, endTime time.Time) sdk.Iterator

Returns all the unbonding queue timeslices from time 0 until endTime

func (Keeper) UnbondAllMatureValidatorQueue

func (k Keeper) UnbondAllMatureValidatorQueue(ctx sdk.Context)

Unbonds all the unbonding validators that have finished their unbonding period

func (Keeper) UnbondingTime

func (k Keeper) UnbondingTime(ctx sdk.Context) (res time.Duration)

UnbondingTime

func (Keeper) Undelegate

func (k Keeper) Undelegate(
	ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, sharesAmount sdk.Dec,
) (time.Time, error)

Undelegate unbonds an amount of delegator shares from a given validator. It will verify that the unbonding entries between the delegator and validator are not exceeded and unbond the staked tokens (based on shares) by creating an unbonding object and inserting it into the unbonding queue which will be processed during the staking EndBlocker.

func (Keeper) Unjail

func (k Keeper) Unjail(ctx sdk.Context, consAddr sdk.ConsAddress)

unjail a validator

func (Keeper) ValidateUnbondAmount

func (k Keeper) ValidateUnbondAmount(
	ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, amt sdk.Int,
) (shares sdk.Dec, err error)

ValidateUnbondAmount validates that a given unbond or redelegation amount is valied based on upon the converted shares. If the amount is valid, the total amount of respective shares is returned, otherwise an error is returned.

func (Keeper) Validator

func (k Keeper) Validator(ctx sdk.Context, address sdk.ValAddress) exported.ValidatorI

Validator gets the Validator interface for a particular address

func (Keeper) ValidatorByConsAddr

func (k Keeper) ValidatorByConsAddr(ctx sdk.Context, addr sdk.ConsAddress) exported.ValidatorI

ValidatorByConsAddr gets the validator interface for a particular pubkey

func (Keeper) ValidatorQueueIterator

func (k Keeper) ValidatorQueueIterator(ctx sdk.Context, endTime time.Time) sdk.Iterator

Returns all the validator queue timeslices from time 0 until endTime

func (Keeper) ValidatorTicketStoreIterator

func (k Keeper) ValidatorTicketStoreIterator(ctx sdk.Context) sdk.Iterator

returns an iterator for the current validator ticket store

func (Keeper) ValidatorsPowerStoreIterator

func (k Keeper) ValidatorsPowerStoreIterator(ctx sdk.Context) sdk.Iterator

returns an iterator for the current validator power store

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL