stake

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2023 License: MPL-2.0 Imports: 15 Imported by: 7

Documentation

Overview

nolint

Index

Constants

View Source
const (
	QueryValidators                    = querier.QueryValidators
	QueryValidator                     = querier.QueryValidator
	QueryValidatorUnbondingDelegations = querier.QueryValidatorUnbondingDelegations
	QueryValidatorRedelegations        = querier.QueryValidatorRedelegations
	QueryDelegation                    = querier.QueryDelegation
	QueryUnbondingDelegation           = querier.QueryUnbondingDelegation
	QueryDelegatorDelegations          = querier.QueryDelegatorDelegations
	QueryDelegatorUnbondingDelegations = querier.QueryDelegatorUnbondingDelegations
	QueryDelegatorRedelegations        = querier.QueryDelegatorRedelegations
	QueryDelegatorValidators           = querier.QueryDelegatorValidators
	QueryDelegatorValidator            = querier.QueryDelegatorValidator
	QueryPool                          = querier.QueryPool
	QueryParameters                    = querier.QueryParameters
	QueryCrossStakeInfo                = querier.QueryCrossStakeInfoByAscAddress

	Topic = types.Topic
)
View Source
const (
	DefaultCodespace      = types.DefaultCodespace
	CodeInvalidValidator  = types.CodeInvalidValidator
	CodeInvalidDelegation = types.CodeInvalidDelegation
	CodeInvalidInput      = types.CodeInvalidInput
	CodeValidatorJailed   = types.CodeValidatorJailed
	CodeUnauthorized      = types.CodeUnauthorized
	CodeInternal          = types.CodeInternal
	CodeUnknownRequest    = types.CodeUnknownRequest
	ChainIDForFlashChain  = types.ChainIDForFlashChain
)

Variables

View Source
var (
	NewKeeper = keeper.NewKeeper

	GetValidatorKey                  = keeper.GetValidatorKey
	GetValidatorByConsAddrKey        = keeper.GetValidatorByConsAddrKey
	GetValidatorsByPowerIndexKey     = keeper.GetValidatorsByPowerIndexKey
	GetDelegationKey                 = keeper.GetDelegationKey
	GetDelegationsKey                = keeper.GetDelegationsKey
	PoolKey                          = keeper.PoolKey
	IntraTxCounterKey                = keeper.IntraTxCounterKey
	LastValidatorPowerKey            = keeper.LastValidatorPowerKey
	LastTotalPowerKey                = keeper.LastTotalPowerKey
	ValidatorsKey                    = keeper.ValidatorsKey
	ValidatorsByConsAddrKey          = keeper.ValidatorsByConsAddrKey
	ValidatorsByPowerIndexKey        = keeper.ValidatorsByPowerIndexKey
	DelegationKey                    = keeper.DelegationKey
	GetUBDKey                        = keeper.GetUBDKey
	GetUBDByValIndexKey              = keeper.GetUBDByValIndexKey
	GetUBDsKey                       = keeper.GetUBDsKey
	GetUBDsByValIndexKey             = keeper.GetUBDsByValIndexKey
	GetREDKey                        = keeper.GetREDKey
	GetREDByValSrcIndexKey           = keeper.GetREDByValSrcIndexKey
	GetREDByValDstIndexKey           = keeper.GetREDByValDstIndexKey
	GetREDsKey                       = keeper.GetREDsKey
	GetREDsFromValSrcIndexKey        = keeper.GetREDsFromValSrcIndexKey
	GetREDsToValDstIndexKey          = keeper.GetREDsToValDstIndexKey
	GetREDsByDelToValDstIndexKey     = keeper.GetREDsByDelToValDstIndexKey
	TestingUpdateValidator           = keeper.TestingUpdateValidator
	MigratePowerRankKey              = keeper.MigratePowerRankKey
	MigrateValidatorDistributionAddr = keeper.MigrateValidators
	MigrateWhiteLabelOracleRelayer   = keeper.MigrateWhiteLabelOracleRelayer

	DefaultParamspace = keeper.DefaultParamspace
	KeyUnbondingTime  = types.KeyUnbondingTime
	KeyMaxValidators  = types.KeyMaxValidators
	KeyBondDenom      = types.KeyBondDenom

	DefaultParams           = types.DefaultParams
	InitialPool             = types.InitialPool
	NewValidator            = types.NewValidator
	NewValidatorWithFeeAddr = types.NewValidatorWithFeeAddr
	NewSideChainValidator   = types.NewSideChainValidator
	NewDescription          = types.NewDescription
	NewCommission           = types.NewCommission
	NewCommissionMsg        = types.NewCommissionMsg
	NewCommissionWithTime   = types.NewCommissionWithTime
	NewGenesisState         = types.NewGenesisState
	DefaultGenesisState     = types.DefaultGenesisState
	RegisterCodec           = types.RegisterCodec

	NewMsgCreateValidator           = types.NewMsgCreateValidator
	NewMsgRemoveValidator           = types.NewMsgRemoveValidator
	NewMsgBeginUnbonding            = types.NewMsgBeginUnbonding
	NewMsgCreateValidatorOnBehalfOf = types.NewMsgCreateValidatorOnBehalfOf
	NewMsgEditValidator             = types.NewMsgEditValidator
	NewMsgDelegate                  = types.NewMsgDelegate
	NewMsgUndelegate                = types.NewMsgUndelegate
	NewMsgRedelegate                = types.NewMsgRedelegate

	NewMsgCreateSideChainValidator           = types.NewMsgCreateSideChainValidator
	NewMsgCreateSideChainValidatorOnBehalfOf = types.NewMsgCreateSideChainValidatorOnBehalfOf
	NewMsgEditSideChainValidator             = types.NewMsgEditSideChainValidator
	NewMsgSideChainDelegate                  = types.NewMsgSideChainDelegate
	NewMsgSideChainRedelegate                = types.NewMsgSideChainRedelegate
	NewMsgSideChainUndelegate                = types.NewMsgSideChainUndelegate

	NewQuerier    = querier.NewQuerier
	NewBaseParams = querier.NewBaseParams

	FeeCollectorAddr  = keeper.FeeCollectorAddr
	DelegationAccAddr = keeper.DelegationAccAddr
	FeeForAllAccAddr  = keeper.FeeForAllFcValsAccAddr
)
View Source
var (
	ErrNilValidatorAddr           = types.ErrNilValidatorAddr
	ErrNoValidatorFound           = types.ErrNoValidatorFound
	ErrValidatorOwnerExists       = types.ErrValidatorOwnerExists
	ErrValidatorPubKeyExists      = types.ErrValidatorPubKeyExists
	ErrValidatorSideConsAddrExist = types.ErrValidatorSideConsAddrExists
	ErrInvalidDelegator           = types.ErrInvalidDelegator
	ErrValidatorJailed            = types.ErrValidatorJailed
	ErrInvalidProposal            = types.ErrInvalidProposal
	ErrBadRemoveValidator         = types.ErrBadRemoveValidator
	ErrDescriptionLength          = types.ErrDescriptionLength
	ErrCommissionNegative         = types.ErrCommissionNegative
	ErrCommissionHuge             = types.ErrCommissionHuge

	ErrNilDelegatorAddr          = types.ErrNilDelegatorAddr
	ErrBadDenom                  = types.ErrBadDenom
	ErrBadDelegationAmount       = types.ErrBadDelegationAmount
	ErrNoDelegation              = types.ErrNoDelegation
	ErrBadDelegatorAddr          = types.ErrBadDelegatorAddr
	ErrNoDelegatorForAddress     = types.ErrNoDelegatorForAddress
	ErrInsufficientShares        = types.ErrInsufficientShares
	ErrDelegationValidatorEmpty  = types.ErrDelegationValidatorEmpty
	ErrNotEnoughDelegationShares = types.ErrNotEnoughDelegationShares
	ErrBadSharesAmount           = types.ErrBadSharesAmount
	ErrBadSharesPercent          = types.ErrBadSharesPercent

	ErrInvalidSideChainId = types.ErrInvalidSideChainId

	ErrNotMature             = types.ErrNotMature
	ErrNoUnbondingDelegation = types.ErrNoUnbondingDelegation
	ErrNoRedelegation        = types.ErrNoRedelegation
	ErrBadRedelegationSrc    = types.ErrBadRedelegationSrc
	ErrBadRedelegationDst    = types.ErrBadRedelegationDst
	ErrSelfRedelegation      = types.ErrSelfRedelegation
	ErrInvalidRedelegator    = types.ErrInvalidRedelegator
	ErrNotSelfDelegate       = types.ErrNotSelfDelegate

	ErrBothShareMsgsGiven    = types.ErrBothShareMsgsGiven
	ErrNeitherShareMsgsGiven = types.ErrNeitherShareMsgsGiven
	ErrMissingSignature      = types.ErrMissingSignature
	ErrInvalidPubKey         = types.ErrInvalidPubKey
)

Functions

func EndBlocker

func EndBlocker(ctx sdk.Context, k keeper.Keeper) (validatorUpdates []abci.ValidatorUpdate, completedUbds []types.UnbondingDelegation)

func EndBreatheBlock

func EndBreatheBlock(ctx sdk.Context, k keeper.Keeper) (validatorUpdates []abci.ValidatorUpdate, completedUbds []types.UnbondingDelegation)

func InitGenesis

func InitGenesis(ctx sdk.Context, keeper Keeper, data types.GenesisState) (res []abci.ValidatorUpdate, err error)

InitGenesis sets the pool and parameters for the provided keeper and initializes the IntraTxCounter. 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 NewHandler

func NewHandler(k keeper.Keeper, govKeeper gov.Keeper) sdk.Handler

func NewStakeHandler

func NewStakeHandler(k Keeper) sdk.Handler

func ValidateGenesis

func ValidateGenesis(data types.GenesisState) error

ValidateGenesis validates the provided staking genesis state to ensure the expected invariants holds. (i.e. params in correct bounds, no duplicate validators)

func WriteGenesis

func WriteGenesis(ctx sdk.Context, keeper Keeper) types.GenesisState

WriteGenesis returns a GenesisState for a given context and keeper. The GenesisState will contain the pool, params, validators, and bonds found in the keeper.

func WriteValidators

func WriteValidators(ctx sdk.Context, keeper Keeper) (vals []tmtypes.GenesisValidator)

WriteValidators returns a slice of bonded genesis validators.

Types

type BaseParams

type BaseParams = querier.BaseParams

type ChainDelegateEvent

type ChainDelegateEvent = types.ChainDelegateEvent

type ChainRedelegateEvent

type ChainRedelegateEvent = types.ChainRedelegateEvent

type ChainUndelegateEvent

type ChainUndelegateEvent = types.ChainUndelegateEvent

type Commission

type Commission = types.Commission

type CompletedREDEvent

type CompletedREDEvent = types.CompletedREDEvent

type CompletedUBDEvent

type CompletedUBDEvent = types.CompletedUBDEvent

type CreateValidatorJsonMsg

type CreateValidatorJsonMsg = types.CreateValidatorJsonMsg

type DVPair

type DVPair = types.DVPair

type DVVTriplet

type DVVTriplet = types.DVVTriplet

type DelegateEvent

type DelegateEvent = types.DelegateEvent

type Delegation

type Delegation = types.Delegation

type DelegationRemovedEvent

type DelegationRemovedEvent = types.DelegationRemovedEvent

type DelegationUpdateEvent

type DelegationUpdateEvent = types.DelegationUpdateEvent

type Description

type Description = types.Description

type DistributionData

type DistributionData = types.DistributionData

type DistributionEvent

type DistributionEvent = types.DistributionEvent

type ElectedValidatorsEvent

type ElectedValidatorsEvent = types.ElectedValidatorsEvent

type GenesisState

type GenesisState = types.GenesisState

type Keeper

type Keeper = keeper.Keeper

type MsgBeginUnbonding

type MsgBeginUnbonding = types.MsgBeginUnbonding

type MsgCreateSideChainValidator

type MsgCreateSideChainValidator = types.MsgCreateSideChainValidator

type MsgCreateValidator

type MsgCreateValidator = types.MsgCreateValidator

func NewTestMsgCreateValidator

func NewTestMsgCreateValidator(address sdk.ValAddress, pubKey crypto.PubKey, amt int64) MsgCreateValidator

func NewTestMsgCreateValidatorOnBehalfOf

func NewTestMsgCreateValidatorOnBehalfOf(delAddr sdk.AccAddress, valAddr sdk.ValAddress, valPubKey crypto.PubKey, amt int64) MsgCreateValidator

func NewTestMsgCreateValidatorWithCommission

func NewTestMsgCreateValidatorWithCommission(address sdk.ValAddress, pubKey crypto.PubKey,
	amt int64, commissionRate sdk.Dec) MsgCreateValidator

type MsgCreateValidatorOpen

type MsgCreateValidatorOpen = types.MsgCreateValidatorOpen

type MsgCreateValidatorProposal

type MsgCreateValidatorProposal = types.MsgCreateValidatorProposal

type MsgDelegate

type MsgDelegate = types.MsgDelegate

func NewTestMsgDelegate

func NewTestMsgDelegate(delAddr sdk.AccAddress, valAddr sdk.ValAddress, amt int64) MsgDelegate

type MsgEditSideChainValidator

type MsgEditSideChainValidator = types.MsgEditSideChainValidator

type MsgEditValidator

type MsgEditValidator = types.MsgEditValidator

type MsgRedelegate

type MsgRedelegate = types.MsgRedelegate

type MsgRemoveValidator

type MsgRemoveValidator = types.MsgRemoveValidator

type MsgSideChainDelegate

type MsgSideChainDelegate = types.MsgSideChainDelegate

type MsgSideChainRedelegate

type MsgSideChainRedelegate = types.MsgSideChainRedelegate

type MsgSideChainUndelegate

type MsgSideChainUndelegate = types.MsgSideChainUndelegate

type MsgUndelegate

type MsgUndelegate = types.MsgUndelegate

type Params

type Params = types.Params

type Pool

type Pool = types.Pool

type QueryBondsParams

type QueryBondsParams = querier.QueryBondsParams

type QueryCrossStakeInfoParams

type QueryCrossStakeInfoParams = querier.QueryCrossStakeInfoParams

type QueryDelegatorParams

type QueryDelegatorParams = querier.QueryDelegatorParams

type QueryTopValidatorsParams

type QueryTopValidatorsParams = querier.QueryTopValidatorsParams

type QueryValidatorParams

type QueryValidatorParams = querier.QueryValidatorParams

type REDUpdateEvent

type REDUpdateEvent = types.REDUpdateEvent

type RedelegateEvent

type RedelegateEvent = types.RedelegateEvent

type Redelegation

type Redelegation = types.Redelegation

type UBDUpdateEvent

type UBDUpdateEvent = types.UBDUpdateEvent

type UnbondingDelegation

type UnbondingDelegation = types.UnbondingDelegation

type UndelegateEvent

type UndelegateEvent = types.UndelegateEvent

type Validator

type Validator = types.Validator

type ValidatorRemovedEvent

type ValidatorRemovedEvent = types.ValidatorRemovedEvent

type ValidatorUpdateEvent

type ValidatorUpdateEvent = types.ValidatorUpdateEvent

Directories

Path Synopsis
client
cli
nolint
nolint
nolint
nolint
nolint
nolint

Jump to

Keyboard shortcuts

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