Documentation ¶
Overview ¶
nolint
Index ¶
- Constants
- Variables
- func EndBlocker(ctx sdk.Context, k Keeper) (ValidatorUpdates []abci.Validator)
- func ErrBadBondingAmount(codespace sdk.CodespaceType) sdk.Error
- func ErrBadBondingDenom(codespace sdk.CodespaceType) sdk.Error
- func ErrBadDelegatorAddr(codespace sdk.CodespaceType) sdk.Error
- func ErrBadRemoveValidator(codespace sdk.CodespaceType) sdk.Error
- func ErrBadShares(codespace sdk.CodespaceType) sdk.Error
- func ErrBadValidatorAddr(codespace sdk.CodespaceType) sdk.Error
- func ErrBondNotNominated(codespace sdk.CodespaceType) sdk.Error
- func ErrCommissionHuge(codespace sdk.CodespaceType) sdk.Error
- func ErrCommissionNegative(codespace sdk.CodespaceType) sdk.Error
- func ErrInsufficientFunds(codespace sdk.CodespaceType) sdk.Error
- func ErrMissingSignature(codespace sdk.CodespaceType) sdk.Error
- func ErrNoBondingAcct(codespace sdk.CodespaceType) sdk.Error
- func ErrNoDelegatorForAddress(codespace sdk.CodespaceType) sdk.Error
- func ErrNoValidatorForAddress(codespace sdk.CodespaceType) sdk.Error
- func ErrNotEnoughBondShares(codespace sdk.CodespaceType, shares string) sdk.Error
- func ErrValidatorEmpty(codespace sdk.CodespaceType) sdk.Error
- func ErrValidatorExistsAddr(codespace sdk.CodespaceType) sdk.Error
- func ErrValidatorRevoked(codespace sdk.CodespaceType) sdk.Error
- func GetDelegationKey(delegatorAddr, validatorAddr sdk.Address, cdc *wire.Codec) []byte
- func GetDelegationsKey(delegatorAddr sdk.Address, cdc *wire.Codec) []byte
- func GetTendermintUpdatesKey(ownerAddr sdk.Address) []byte
- func GetValidatorByPubKeyIndexKey(pubkey crypto.PubKey) []byte
- func GetValidatorKey(ownerAddr sdk.Address) []byte
- func GetValidatorsBondedKey(pk crypto.PubKey) []byte
- func GetValidatorsByPowerKey(validator Validator, pool Pool) []byte
- func InitGenesis(ctx sdk.Context, k Keeper, data GenesisState)
- func NewHandler(k Keeper) sdk.Handler
- func RegisterWire(cdc *wire.Codec)
- func ValEq(t *testing.T, exp, got Validator) (*testing.T, bool, string, Validator, Validator)
- func WriteValidators(ctx sdk.Context, k Keeper) (vals []tmtypes.GenesisValidator)
- type CodeType
- type Delegation
- type Description
- type GenesisState
- type Keeper
- func (k Keeper) Delegation(ctx sdk.Context, addrDel sdk.Address, addrVal sdk.Address) sdk.Delegation
- func (k Keeper) GetDelegation(ctx sdk.Context, delegatorAddr, validatorAddr sdk.Address) (bond Delegation, found bool)
- func (k Keeper) GetDelegations(ctx sdk.Context, delegator sdk.Address, maxRetrieve int16) (bonds []Delegation)
- func (k Keeper) GetParams(ctx sdk.Context) Params
- func (k Keeper) GetPool(ctx sdk.Context) (pool Pool)
- func (k Keeper) GetValidator(ctx sdk.Context, addr sdk.Address) (validator Validator, found bool)
- func (k Keeper) GetValidatorByPubKey(ctx sdk.Context, pubkey crypto.PubKey) (validator Validator, found bool)
- func (k Keeper) GetValidators(ctx sdk.Context, maxRetrieve int16) (validators Validators)
- func (k Keeper) GetValidatorsBonded(ctx sdk.Context) (validators []Validator)
- func (k Keeper) GetValidatorsByPower(ctx sdk.Context) []Validator
- func (k Keeper) IterateDelegators(ctx sdk.Context, delAddr sdk.Address, ...)
- 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) Revoke(ctx sdk.Context, pubkey crypto.PubKey)
- func (k Keeper) Slash(ctx sdk.Context, pubkey crypto.PubKey, height int64, fraction sdk.Rat)
- func (k Keeper) TotalPower(ctx sdk.Context) sdk.Rat
- func (k Keeper) Unrevoke(ctx sdk.Context, pubkey crypto.PubKey)
- func (k Keeper) Validator(ctx sdk.Context, addr sdk.Address) sdk.Validator
- type MsgCreateValidator
- type MsgDelegate
- type MsgEditValidator
- type MsgUnbond
- type Params
- type Pool
- type PoolShareKind
- type PoolShares
- func (s PoolShares) Bonded() sdk.Rat
- func (s PoolShares) Equal(s2 PoolShares) bool
- func (s PoolShares) ToBonded(p Pool) PoolShares
- func (s PoolShares) ToUnbonded(p Pool) PoolShares
- func (s PoolShares) ToUnbonding(p Pool) PoolShares
- func (s PoolShares) Tokens(p Pool) sdk.Rat
- func (s PoolShares) Unbonded() sdk.Rat
- func (s PoolShares) Unbonding() sdk.Rat
- type Validator
- func (v Validator) DelegatorShareExRate(pool Pool) sdk.Rat
- func (v Validator) EquivalentBondedShares(pool Pool) (eqBondedShares sdk.Rat)
- func (v Validator) GetBondHeight() int64
- func (v Validator) GetMoniker() string
- func (v Validator) GetOwner() sdk.Address
- func (v Validator) GetPower() sdk.Rat
- func (v Validator) GetPubKey() crypto.PubKey
- func (v Validator) GetStatus() sdk.BondStatus
- func (v Validator) HumanReadableString() (string, error)
- func (v Validator) Status() sdk.BondStatus
- func (v Validator) UpdateStatus(pool Pool, NewStatus sdk.BondStatus) (Validator, Pool)
- type Validators
- type ViewSlashKeeper
Constants ¶
const MsgType = "stake"
name to idetify transaction types
const StakingToken = "steak"
XXX remove: think it makes more sense belonging with the Params so we can initialize at genesis - to allow for the same tests we should should make the ValidateBasic() function a return from an initializable function ValidateBasic(bondDenom string) function
Variables ¶
var ( // Keys for store prefixes ParamKey = []byte{0x00} // key for parameters relating to staking PoolKey = []byte{0x01} // key for the staking pools ValidatorsKey = []byte{0x02} // prefix for each key to a validator ValidatorsByPubKeyIndexKey = []byte{0x03} // prefix for each key to a validator by pubkey ValidatorsBondedKey = []byte{0x04} // prefix for each key to bonded/actively validating validators ValidatorsByPowerKey = []byte{0x05} // prefix for each key to a validator sorted by power ValidatorCliffKey = []byte{0x06} // key for block-local tx index ValidatorPowerCliffKey = []byte{0x07} // key for block-local tx index TendermintUpdatesKey = []byte{0x08} // prefix for each key to a validator which is being updated DelegationKey = []byte{0x09} // prefix for each key to a delegator's bond IntraTxCounterKey = []byte{0x10} // key for block-local tx index )
nolint
Functions ¶
func EndBlocker ¶ added in v0.18.0
Called every block, process inflation, update validator set
func ErrBadBondingAmount ¶
func ErrBadBondingAmount(codespace sdk.CodespaceType) sdk.Error
func ErrBadBondingDenom ¶
func ErrBadBondingDenom(codespace sdk.CodespaceType) sdk.Error
func ErrBadDelegatorAddr ¶
func ErrBadDelegatorAddr(codespace sdk.CodespaceType) sdk.Error
func ErrBadRemoveValidator ¶
func ErrBadRemoveValidator(codespace sdk.CodespaceType) sdk.Error
func ErrBadShares ¶
func ErrBadShares(codespace sdk.CodespaceType) sdk.Error
func ErrBadValidatorAddr ¶
func ErrBadValidatorAddr(codespace sdk.CodespaceType) sdk.Error
func ErrBondNotNominated ¶
func ErrBondNotNominated(codespace sdk.CodespaceType) sdk.Error
func ErrCommissionHuge ¶
func ErrCommissionHuge(codespace sdk.CodespaceType) sdk.Error
func ErrCommissionNegative ¶
func ErrCommissionNegative(codespace sdk.CodespaceType) sdk.Error
func ErrInsufficientFunds ¶
func ErrInsufficientFunds(codespace sdk.CodespaceType) sdk.Error
func ErrMissingSignature ¶
func ErrMissingSignature(codespace sdk.CodespaceType) sdk.Error
func ErrNoBondingAcct ¶
func ErrNoBondingAcct(codespace sdk.CodespaceType) sdk.Error
func ErrNoDelegatorForAddress ¶
func ErrNoDelegatorForAddress(codespace sdk.CodespaceType) sdk.Error
func ErrNoValidatorForAddress ¶ added in v0.18.0
func ErrNoValidatorForAddress(codespace sdk.CodespaceType) sdk.Error
func ErrNotEnoughBondShares ¶
func ErrNotEnoughBondShares(codespace sdk.CodespaceType, shares string) sdk.Error
func ErrValidatorEmpty ¶ added in v0.18.0
func ErrValidatorEmpty(codespace sdk.CodespaceType) sdk.Error
func ErrValidatorExistsAddr ¶ added in v0.18.0
func ErrValidatorExistsAddr(codespace sdk.CodespaceType) sdk.Error
func ErrValidatorRevoked ¶ added in v0.18.0
func ErrValidatorRevoked(codespace sdk.CodespaceType) sdk.Error
func GetDelegationKey ¶ added in v0.18.0
get the key for delegator bond with validator
func GetDelegationsKey ¶ added in v0.18.0
get the prefix for a delegator for all validators
func GetTendermintUpdatesKey ¶ added in v0.18.0
get the key for the accumulated update validators
func GetValidatorByPubKeyIndexKey ¶ added in v0.18.0
get the key for the validator with pubkey
func GetValidatorKey ¶
get the key for the validator with address
func GetValidatorsBondedKey ¶ added in v0.18.0
get the key for the current validator group, ordered like tendermint
func GetValidatorsByPowerKey ¶ added in v0.18.0
get the key for the validator used in the power-store
func InitGenesis ¶ added in v0.16.0
func InitGenesis(ctx sdk.Context, k Keeper, data GenesisState)
InitGenesis - store genesis parameters
func NewHandler ¶
func WriteValidators ¶ added in v0.19.0
func WriteValidators(ctx sdk.Context, k Keeper) (vals []tmtypes.GenesisValidator)
WriteValidators - output current validator set
Types ¶
type CodeType ¶
const ( DefaultCodespace sdk.CodespaceType = 4 // Gaia errors reserve 200 ~ 299. CodeInvalidValidator CodeType = 201 CodeInvalidBond CodeType = 202 CodeInvalidInput CodeType = 203 CodeValidatorJailed CodeType = 204 CodeInternal CodeType = sdk.CodeInternal CodeUnknownRequest CodeType = sdk.CodeUnknownRequest )
type Delegation ¶ added in v0.18.0
type Delegation struct { DelegatorAddr sdk.Address `json:"delegator_addr"` ValidatorAddr sdk.Address `json:"validator_addr"` Height int64 `json:"height"` // Last height bond updated }
Delegation represents the bond with tokens held by an account. It is owned by one delegator, and is associated with the voting power of one pubKey. TODO better way of managing space
func (Delegation) GetBondShares ¶ added in v0.18.0
func (b Delegation) GetBondShares() sdk.Rat
func (Delegation) GetDelegator ¶ added in v0.18.0
func (b Delegation) GetDelegator() sdk.Address
nolint - for sdk.Delegation
func (Delegation) GetValidator ¶ added in v0.18.0
func (b Delegation) GetValidator() sdk.Address
func (Delegation) HumanReadableString ¶ added in v0.18.0
func (b Delegation) HumanReadableString() (string, error)
Human Friendly pretty printer
type Description ¶
type Description struct { Moniker string `json:"moniker"` Identity string `json:"identity"` Website string `json:"website"` Details string `json:"details"` }
Description - description fields for a validator
func NewDescription ¶
func NewDescription(moniker, identity, website, details string) Description
type GenesisState ¶
type GenesisState struct { Pool Pool `json:"pool"` Params Params `json:"params"` Validators []Validator `json:"validators"` Bonds []Delegation `json:"bonds"` }
GenesisState - all staking state that must be provided at genesis
func DefaultGenesisState ¶ added in v0.18.0
func DefaultGenesisState() GenesisState
get raw genesis raw message for testing
func NewGenesisState ¶ added in v0.18.0
func NewGenesisState(pool Pool, params Params, validators []Validator, bonds []Delegation) GenesisState
func WriteGenesis ¶ added in v0.16.0
func WriteGenesis(ctx sdk.Context, k Keeper) GenesisState
WriteGenesis - output genesis parameters
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
keeper of the staking store
func (Keeper) Delegation ¶ added in v0.18.0
func (k Keeper) Delegation(ctx sdk.Context, addrDel sdk.Address, addrVal sdk.Address) sdk.Delegation
get the delegation for a particular set of delegator and validator addresses
func (Keeper) GetDelegation ¶ added in v0.18.0
func (k Keeper) GetDelegation(ctx sdk.Context, delegatorAddr, validatorAddr sdk.Address) (bond Delegation, found bool)
load a delegator bond
func (Keeper) GetDelegations ¶ added in v0.18.0
func (k Keeper) GetDelegations(ctx sdk.Context, delegator sdk.Address, maxRetrieve int16) (bonds []Delegation)
load all bonds of a delegator
func (Keeper) GetValidator ¶ added in v0.18.0
get a single validator
func (Keeper) GetValidatorByPubKey ¶ added in v0.18.0
func (k Keeper) GetValidatorByPubKey(ctx sdk.Context, pubkey crypto.PubKey) (validator Validator, found bool)
get a single validator by pubkey
func (Keeper) GetValidators ¶
func (k Keeper) GetValidators(ctx sdk.Context, maxRetrieve int16) (validators Validators)
Get the set of all validators, retrieve a maxRetrieve number of records
func (Keeper) GetValidatorsBonded ¶ added in v0.18.0
get the group of the bonded validators
func (Keeper) GetValidatorsByPower ¶ added in v0.18.0
get the group of bonded validators sorted by power-rank
func (Keeper) IterateDelegators ¶ added in v0.18.0
func (k Keeper) IterateDelegators(ctx sdk.Context, delAddr sdk.Address, fn func(index int64, delegation sdk.Delegation) (stop bool))
iterate through the active validator set and perform the provided function
func (Keeper) IterateValidators ¶ added in v0.18.0
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 ¶ added in v0.18.0
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) TotalPower ¶ added in v0.18.0
total power from the bond
type MsgCreateValidator ¶ added in v0.18.0
type MsgCreateValidator struct { Description ValidatorAddr sdk.Address `json:"address"` PubKey crypto.PubKey `json:"pubkey"` Bond sdk.Coin `json:"bond"` }
MsgCreateValidator - struct for unbonding transactions
func NewMsgCreateValidator ¶ added in v0.18.0
func NewMsgCreateValidator(validatorAddr sdk.Address, pubkey crypto.PubKey, bond sdk.Coin, description Description) MsgCreateValidator
func (MsgCreateValidator) GetSignBytes ¶ added in v0.18.0
func (msg MsgCreateValidator) GetSignBytes() []byte
get the bytes for the message signer to sign on
func (MsgCreateValidator) GetSigners ¶ added in v0.18.0
func (msg MsgCreateValidator) GetSigners() []sdk.Address
func (MsgCreateValidator) Type ¶ added in v0.18.0
func (msg MsgCreateValidator) Type() string
nolint
func (MsgCreateValidator) ValidateBasic ¶ added in v0.18.0
func (msg MsgCreateValidator) ValidateBasic() sdk.Error
quick validity check
type MsgDelegate ¶
type MsgDelegate struct { DelegatorAddr sdk.Address `json:"delegator_addr"` ValidatorAddr sdk.Address `json:"validator_addr"` Bond sdk.Coin `json:"bond"` }
MsgDelegate - struct for bonding transactions
func NewMsgDelegate ¶
func NewMsgDelegate(delegatorAddr, validatorAddr sdk.Address, bond sdk.Coin) MsgDelegate
func (MsgDelegate) GetSignBytes ¶
func (msg MsgDelegate) GetSignBytes() []byte
get the bytes for the message signer to sign on
func (MsgDelegate) GetSigners ¶
func (msg MsgDelegate) GetSigners() []sdk.Address
func (MsgDelegate) ValidateBasic ¶
func (msg MsgDelegate) ValidateBasic() sdk.Error
quick validity check
type MsgEditValidator ¶ added in v0.18.0
type MsgEditValidator struct { Description ValidatorAddr sdk.Address `json:"address"` }
MsgEditValidator - struct for editing a validator
func NewMsgEditValidator ¶ added in v0.18.0
func NewMsgEditValidator(validatorAddr sdk.Address, description Description) MsgEditValidator
func (MsgEditValidator) GetSignBytes ¶ added in v0.18.0
func (msg MsgEditValidator) GetSignBytes() []byte
get the bytes for the message signer to sign on
func (MsgEditValidator) GetSigners ¶ added in v0.18.0
func (msg MsgEditValidator) GetSigners() []sdk.Address
func (MsgEditValidator) ValidateBasic ¶ added in v0.18.0
func (msg MsgEditValidator) ValidateBasic() sdk.Error
quick validity check
type MsgUnbond ¶
type MsgUnbond struct { DelegatorAddr sdk.Address `json:"delegator_addr"` ValidatorAddr sdk.Address `json:"validator_addr"` }
MsgUnbond - struct for unbonding transactions
func NewMsgUnbond ¶
func (MsgUnbond) GetSignBytes ¶
get the bytes for the message signer to sign on
func (MsgUnbond) GetSigners ¶
func (MsgUnbond) ValidateBasic ¶
quick validity check
type Params ¶
type Params struct { InflationRateChange sdk.Rat `json:"inflation_rate_change"` // maximum annual change in inflation rate InflationMax sdk.Rat `json:"inflation_max"` // maximum inflation rate InflationMin sdk.Rat `json:"inflation_min"` // minimum inflation rate GoalBonded sdk.Rat `json:"goal_bonded"` // Goal of percent bonded atoms MaxValidators uint16 `json:"max_validators"` // maximum number of validators BondDenom string `json:"bond_denom"` // bondable coin denomination }
Params defines the high level settings for staking
type Pool ¶
type Pool struct { LooseUnbondedTokens int64 `json:"loose_unbonded_tokens"` // tokens not associated with any validator UnbondedTokens int64 `json:"unbonded_tokens"` // reserve of unbonded tokens held with validators UnbondingTokens int64 `json:"unbonding_tokens"` // tokens moving from bonded to unbonded pool BondedTokens int64 `json:"bonded_tokens"` // reserve of bonded tokens InflationLastTime int64 `json:"inflation_last_time"` // block which the last inflation was processed // TODO make time Inflation sdk.Rat `json:"inflation"` // current annual inflation rate DateLastCommissionReset int64 `json:"date_last_commission_reset"` // unix timestamp for last commission accounting reset (daily) PrevBondedShares sdk.Rat `json:"prev_bonded_shares"` // last recorded bonded shares - for fee calcualtions }
Pool - dynamic parameters of the current state
func (Pool) TokenSupply ¶ added in v0.18.0
Sum total of all staking tokens in the pool
type PoolShares ¶ added in v0.18.0
type PoolShares struct {}
pool shares held by a validator
func NewBondedShares ¶ added in v0.18.0
func NewBondedShares(amount sdk.Rat) PoolShares
func NewUnbondedShares ¶ added in v0.18.0
func NewUnbondedShares(amount sdk.Rat) PoolShares
func NewUnbondingShares ¶ added in v0.18.0
func NewUnbondingShares(amount sdk.Rat) PoolShares
func (PoolShares) Bonded ¶ added in v0.18.0
func (s PoolShares) Bonded() sdk.Rat
amount of bonded shares
func (PoolShares) Equal ¶ added in v0.18.0
func (s PoolShares) Equal(s2 PoolShares) bool
only the vitals - does not check bond height of IntraTxCounter
func (PoolShares) ToBonded ¶ added in v0.18.0
func (s PoolShares) ToBonded(p Pool) PoolShares
equivalent amount of shares if the shares were bonded
func (PoolShares) ToUnbonded ¶ added in v0.18.0
func (s PoolShares) ToUnbonded(p Pool) PoolShares
equivalent amount of shares if the shares were unbonded
func (PoolShares) ToUnbonding ¶ added in v0.18.0
func (s PoolShares) ToUnbonding(p Pool) PoolShares
equivalent amount of shares if the shares were unbonding
func (PoolShares) Tokens ¶ added in v0.18.0
func (s PoolShares) Tokens(p Pool) sdk.Rat
TODO better tests get the equivalent amount of tokens contained by the shares
func (PoolShares) Unbonded ¶ added in v0.18.0
func (s PoolShares) Unbonded() sdk.Rat
amount of unbonded shares
func (PoolShares) Unbonding ¶ added in v0.18.0
func (s PoolShares) Unbonding() sdk.Rat
amount of unbonding shares
type Validator ¶
type Validator struct { Owner sdk.Address `json:"owner"` // sender of BondTx - UnbondTx returns here PubKey crypto.PubKey `json:"pub_key"` // pubkey of validator Revoked bool `json:"revoked"` // has the validator been revoked from bonded status? Description Description `json:"description"` // description terms for the validator BondHeight int64 `json:"bond_height"` // earliest height as a bonded validator BondIntraTxCounter int16 `json:"bond_intra_tx_counter"` // block-local tx index of validator change ProposerRewardPool sdk.Coins `json:"proposer_reward_pool"` // XXX reward pool collected from being the proposer Commission sdk.Rat `json:"commission"` // XXX the commission rate of fees charged to any delegators CommissionMax sdk.Rat `json:"commission_max"` // XXX maximum commission rate which this validator can ever charge CommissionChangeRate sdk.Rat `json:"commission_change_rate"` // XXX maximum daily increase of the validator commission CommissionChangeToday sdk.Rat `json:"commission_change_today"` // XXX commission rate change today, reset each day (UTC time) PrevBondedShares sdk.Rat `json:"prev_bonded_shares"` // total shares of a global hold pools }
Validator defines the total amount of bond shares and their exchange rate to coins. Accumulation of interest is modelled as an in increase in the exchange rate, and slashing as a decrease. When coins are delegated to this validator, the validator is credited with a Delegation whose number of bond shares is based on the amount of coins delegated divided by the current exchange rate. Voting power can be calculated as total bonds multiplied by exchange rate.
func NewValidator ¶ added in v0.18.0
NewValidator - initialize a new validator
func (Validator) DelegatorShareExRate ¶ added in v0.18.0
get the exchange rate of tokens over delegator shares UNITS: eq-val-bonded-shares/delegator-shares
func (Validator) EquivalentBondedShares ¶ added in v0.18.0
XXX TEST get the power or potential power for a validator if bonded, the power is the BondedShares if not bonded, the power is the amount of bonded shares which the
the validator would have it was bonded
func (Validator) GetBondHeight ¶ added in v0.18.0
func (Validator) GetMoniker ¶ added in v0.19.0
nolint - for sdk.Validator
func (Validator) GetStatus ¶ added in v0.18.0
func (v Validator) GetStatus() sdk.BondStatus
func (Validator) HumanReadableString ¶ added in v0.18.0
Human Friendly pretty printer
func (Validator) Status ¶ added in v0.18.0
func (v Validator) Status() sdk.BondStatus
abci validator from stake validator type
func (Validator) UpdateStatus ¶ added in v0.18.0
update the location of the shares within a validator if its bond status has changed
type ViewSlashKeeper ¶ added in v0.16.0
type ViewSlashKeeper struct {
// contains filtered or unexported fields
}
keeper to view information & slash validators will be used by governance module
func NewViewSlashKeeper ¶ added in v0.16.0
func NewViewSlashKeeper(k Keeper) ViewSlashKeeper
NewViewSlashKeeper creates a keeper restricted to viewing information & slashing validators
func (ViewSlashKeeper) GetDelegation ¶ added in v0.18.0
func (v ViewSlashKeeper) GetDelegation(ctx sdk.Context, delegatorAddr sdk.Address, validatorAddr sdk.Address) (bond Delegation, found bool)
load a delegator bond
func (ViewSlashKeeper) GetDelegations ¶ added in v0.18.0
func (v ViewSlashKeeper) GetDelegations(ctx sdk.Context, delegator sdk.Address, maxRetrieve int16) (bonds []Delegation)
load n delegator bonds