types

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2020 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventTypeCompleteUnbonding    = "complete_unbonding"
	EventTypeCompleteRedelegation = "complete_redelegation"
	EventTypeCreateValidator      = "create_validator"
	EventTypeEditValidator        = "edit_validator"
	EventTypeDelegate             = "delegate"
	EventTypeUnbond               = "unbond"
	EventTypeRedelegate           = "redelegate"

	AttributeKeyValidator         = "validator"
	AttributeKeyCommissionRate    = "commission_rate"
	AttributeKeyMinSelfDelegation = "min_self_delegation"
	AttributeKeySrcValidator      = "source_validator"
	AttributeKeyDstValidator      = "destination_validator"
	AttributeKeyDelegator         = "delegator"
	AttributeKeyCompletionTime    = "completion_time"
	AttributeValueCategory        = ModuleName
)

staking module event types

View Source
const (
	// ModuleName is the name of the staking module
	ModuleName = "staking"

	// StoreKey is the string store representation
	StoreKey = ModuleName

	// QuerierRoute is the querier route for the staking module
	QuerierRoute = ModuleName

	// RouterKey is the msg router key for the staking module
	RouterKey = ModuleName
)
View Source
const (
	// DefaultUnbondingTime reflects three weeks in seconds as the default
	// unbonding time.
	// TODO: Justify our choice of default here.
	DefaultUnbondingTime time.Duration = time.Hour * 24 * 7 * 3

	// Default maximum number of bonded validators
	DefaultMaxValidators uint32 = 100

	// Default maximum entries in a UBD/RED pair
	DefaultMaxEntries uint32 = 7

	// DefaultHistorical entries is 100. Apps that don't use IBC can ignore this
	// value by not adding the staking module to the application module manager's
	// SetOrderBeginBlockers.
	DefaultHistoricalEntries uint32 = 100
)

Staking params default values

View Source
const (
	NotBondedPoolName = "not_bonded_tokens_pool"
	BondedPoolName    = "bonded_tokens_pool"
)

names used as root for pool module accounts:

- NotBondedPool -> "not_bonded_tokens_pool"

- BondedPool -> "bonded_tokens_pool"

View Source
const (
	QueryValidators                    = "validators"
	QueryValidator                     = "validator"
	QueryDelegatorDelegations          = "delegatorDelegations"
	QueryDelegatorUnbondingDelegations = "delegatorUnbondingDelegations"
	QueryRedelegations                 = "redelegations"
	QueryValidatorDelegations          = "validatorDelegations"
	QueryValidatorRedelegations        = "validatorRedelegations"
	QueryValidatorUnbondingDelegations = "validatorUnbondingDelegations"
	QueryDelegation                    = "delegation"
	QueryUnbondingDelegation           = "unbondingDelegation"
	QueryDelegatorValidators           = "delegatorValidators"
	QueryDelegatorValidator            = "delegatorValidator"
	QueryPool                          = "pool"
	QueryParameters                    = "parameters"
	QueryHistoricalInfo                = "historicalInfo"
)

query endpoints supported by the staking Querier

View Source
const (
	// TODO: Why can't we just have one string description which can be JSON by convention
	MaxMonikerLength         = 70
	MaxIdentityLength        = 3000
	MaxWebsiteLength         = 140
	MaxSecurityContactLength = 140
	MaxDetailsLength         = 280
)
View Source
const DoNotModifyDesc = "[do-not-modify]"

constant used in flags to indicate that description field should not be updated

Variables

View Source
var (
	ErrEmptyValidatorAddr              = sdkerrors.Register(ModuleName, 2, "empty validator address")
	ErrBadValidatorAddr                = sdkerrors.Register(ModuleName, 3, "validator address is invalid")
	ErrNoValidatorFound                = sdkerrors.Register(ModuleName, 4, "validator does not exist")
	ErrValidatorOwnerExists            = sdkerrors.Register(ModuleName, 5, "validator already exist for this operator address; must use new validator operator address")
	ErrValidatorPubKeyExists           = sdkerrors.Register(ModuleName, 6, "validator already exist for this pubkey; must use new validator pubkey")
	ErrValidatorPubKeyTypeNotSupported = sdkerrors.Register(ModuleName, 7, "validator pubkey type is not supported")
	ErrValidatorJailed                 = sdkerrors.Register(ModuleName, 8, "validator for this address is currently jailed")
	ErrBadRemoveValidator              = sdkerrors.Register(ModuleName, 9, "failed to remove validator")
	ErrCommissionNegative              = sdkerrors.Register(ModuleName, 10, "commission must be positive")
	ErrCommissionHuge                  = sdkerrors.Register(ModuleName, 11, "commission cannot be more than 100%")
	ErrCommissionGTMaxRate             = sdkerrors.Register(ModuleName, 12, "commission cannot be more than the max rate")
	ErrCommissionUpdateTime            = sdkerrors.Register(ModuleName, 13, "commission cannot be changed more than once in 24h")
	ErrCommissionChangeRateNegative    = sdkerrors.Register(ModuleName, 14, "commission change rate must be positive")
	ErrCommissionChangeRateGTMaxRate   = sdkerrors.Register(ModuleName, 15, "commission change rate cannot be more than the max rate")
	ErrCommissionGTMaxChangeRate       = sdkerrors.Register(ModuleName, 16, "commission cannot be changed more than max change rate")
	ErrSelfDelegationBelowMinimum      = sdkerrors.Register(ModuleName, 17, "validator's self delegation must be greater than their minimum self delegation")
	ErrMinSelfDelegationInvalid        = sdkerrors.Register(ModuleName, 18, "minimum self delegation must be a positive integer")
	ErrMinSelfDelegationDecreased      = sdkerrors.Register(ModuleName, 19, "minimum self delegation cannot be decrease")
	ErrEmptyDelegatorAddr              = sdkerrors.Register(ModuleName, 20, "empty delegator address")
	ErrBadDenom                        = sdkerrors.Register(ModuleName, 21, "invalid coin denomination")
	ErrBadDelegationAddr               = sdkerrors.Register(ModuleName, 22, "invalid address for (address, validator) tuple")
	ErrBadDelegationAmount             = sdkerrors.Register(ModuleName, 23, "invalid delegation amount")
	ErrNoDelegation                    = sdkerrors.Register(ModuleName, 24, "no delegation for (address, validator) tuple")
	ErrBadDelegatorAddr                = sdkerrors.Register(ModuleName, 25, "delegator does not exist with address")
	ErrNoDelegatorForAddress           = sdkerrors.Register(ModuleName, 26, "delegator does not contain delegation")
	ErrInsufficientShares              = sdkerrors.Register(ModuleName, 27, "insufficient delegation shares")
	ErrDelegationValidatorEmpty        = sdkerrors.Register(ModuleName, 28, "cannot delegate to an empty validator")
	ErrNotEnoughDelegationShares       = sdkerrors.Register(ModuleName, 29, "not enough delegation shares")
	ErrBadSharesAmount                 = sdkerrors.Register(ModuleName, 30, "invalid shares amount")
	ErrBadSharesPercent                = sdkerrors.Register(ModuleName, 31, "Invalid shares percent")
	ErrNotMature                       = sdkerrors.Register(ModuleName, 32, "entry not mature")
	ErrNoUnbondingDelegation           = sdkerrors.Register(ModuleName, 33, "no unbonding delegation found")
	ErrMaxUnbondingDelegationEntries   = sdkerrors.Register(ModuleName, 34, "too many unbonding delegation entries for (delegator, validator) tuple")
	ErrBadRedelegationAddr             = sdkerrors.Register(ModuleName, 35, "invalid address for (address, src-validator, dst-validator) tuple")
	ErrNoRedelegation                  = sdkerrors.Register(ModuleName, 36, "no redelegation found")
	ErrSelfRedelegation                = sdkerrors.Register(ModuleName, 37, "cannot redelegate to the same validator")
	ErrTinyRedelegationAmount          = sdkerrors.Register(ModuleName, 38, "too few tokens to redelegate (truncates to zero tokens)")
	ErrBadRedelegationDst              = sdkerrors.Register(ModuleName, 39, "redelegation destination validator not found")
	ErrTransitiveRedelegation          = sdkerrors.Register(ModuleName, 40, "redelegation to this validator already in progress; first redelegation to this validator must complete before next redelegation")
	ErrMaxRedelegationEntries          = sdkerrors.Register(ModuleName, 41, "too many redelegation entries for (delegator, src-validator, dst-validator) tuple")
	ErrDelegatorShareExRateInvalid     = sdkerrors.Register(ModuleName, 42, "cannot delegate to validators with invalid (zero) ex-rate")
	ErrBothShareMsgsGiven              = sdkerrors.Register(ModuleName, 43, "both shares amount and shares percent provided")
	ErrNeitherShareMsgsGiven           = sdkerrors.Register(ModuleName, 44, "neither shares amount nor shares percent provided")
	ErrInvalidHistoricalInfo           = sdkerrors.Register(ModuleName, 45, "invalid historical info")
	ErrNoHistoricalInfo                = sdkerrors.Register(ModuleName, 46, "no historical info found")
	ErrEmptyValidatorPubKey            = sdkerrors.Register(ModuleName, 47, "empty validator public key")
)

x/staking module sentinel errors

TODO: Many of these errors are redundant. They should be removed and replaced by sdkerrors.ErrInvalidRequest.

REF: https://github.com/KiraCore/cosmos-sdk/issues/5450

View Source
var (
	// Keys for store prefixes
	// Last* values are constant during a block.
	LastValidatorPowerKey = []byte{0x11} // prefix for each key to a validator index, for bonded validators
	LastTotalPowerKey     = []byte{0x12} // prefix for the total power

	ValidatorsKey             = []byte{0x21} // prefix for each key to a validator
	ValidatorsByConsAddrKey   = []byte{0x22} // prefix for each key to a validator index, by pubkey
	ValidatorsByPowerIndexKey = []byte{0x23} // prefix for each key to a validator index, sorted by power

	DelegationKey                    = []byte{0x31} // key for a delegation
	UnbondingDelegationKey           = []byte{0x32} // key for an unbonding-delegation
	UnbondingDelegationByValIndexKey = []byte{0x33} // prefix for each key for an unbonding-delegation, by validator operator
	RedelegationKey                  = []byte{0x34} // key for a redelegation
	RedelegationByValSrcIndexKey     = []byte{0x35} // prefix for each key for an redelegation, by source validator operator
	RedelegationByValDstIndexKey     = []byte{0x36} // prefix for each key for an redelegation, by destination validator operator

	UnbondingQueueKey    = []byte{0x41} // prefix for the timestamps in unbonding queue
	RedelegationQueueKey = []byte{0x42} // prefix for the timestamps in redelegations queue
	ValidatorQueueKey    = []byte{0x43} // prefix for the timestamps in validator queue

	HistoricalInfoKey = []byte{0x50} // prefix for the historical info
)
View Source
var (
	KeyUnbondingTime     = []byte("UnbondingTime")
	KeyMaxValidators     = []byte("MaxValidators")
	KeyMaxEntries        = []byte("KeyMaxEntries")
	KeyBondDenom         = []byte("BondDenom")
	KeyHistoricalEntries = []byte("HistoricalEntries")
)
View Source
var (
	ErrInvalidLengthTypes        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTypes          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (

	// ModuleCdc references the global x/staking module codec. Note, the codec should
	// ONLY be used in certain instances of tests and for JSON encoding as Amino is
	// still used for that purpose.
	//
	// The actual codec used for serialization should be provided to x/staking and
	// defined at the application level.
	ModuleCdc = codec.NewHybridCodec(amino, types.NewInterfaceRegistry())
)

Functions

func AddressFromLastValidatorPowerKey added in v1.0.0

func AddressFromLastValidatorPowerKey(key []byte) []byte

Get the validator operator address from LastValidatorPowerKey

func GetDelegationKey added in v1.0.0

func GetDelegationKey(delAddr sdk.AccAddress, valAddr sdk.ValAddress) []byte

gets the key for delegator bond with validator VALUE: staking/Delegation

func GetDelegationsKey added in v1.0.0

func GetDelegationsKey(delAddr sdk.AccAddress) []byte

gets the prefix for a delegator for all validators

func GetHistoricalInfoKey added in v1.0.0

func GetHistoricalInfoKey(height int64) []byte

GetHistoricalInfoKey gets the key for the historical info

func GetLastValidatorPowerKey added in v1.0.0

func GetLastValidatorPowerKey(operator sdk.ValAddress) []byte

get the bonded validator index key for an operator address

func GetREDByValDstIndexKey added in v1.0.0

func GetREDByValDstIndexKey(delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress) []byte

gets the index-key for a redelegation, stored by destination-validator-index VALUE: none (key rearrangement used)

func GetREDByValSrcIndexKey added in v1.0.0

func GetREDByValSrcIndexKey(delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress) []byte

gets the index-key for a redelegation, stored by source-validator-index VALUE: none (key rearrangement used)

func GetREDKey added in v1.0.0

func GetREDKey(delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress) []byte

gets the key for a redelegation VALUE: staking/RedelegationKey

func GetREDKeyFromValDstIndexKey added in v1.0.0

func GetREDKeyFromValDstIndexKey(indexKey []byte) []byte

GetREDKeyFromValDstIndexKey rearranges the ValDstIndexKey to get the REDKey

func GetREDKeyFromValSrcIndexKey added in v1.0.0

func GetREDKeyFromValSrcIndexKey(indexKey []byte) []byte

GetREDKeyFromValSrcIndexKey rearranges the ValSrcIndexKey to get the REDKey

func GetREDsByDelToValDstIndexKey added in v1.0.0

func GetREDsByDelToValDstIndexKey(delAddr sdk.AccAddress, valDstAddr sdk.ValAddress) []byte

gets the prefix keyspace for all redelegations redelegating towards a destination validator from a particular delegator

func GetREDsFromValSrcIndexKey added in v1.0.0

func GetREDsFromValSrcIndexKey(valSrcAddr sdk.ValAddress) []byte

gets the prefix keyspace for all redelegations redelegating away from a source validator

func GetREDsKey added in v1.0.0

func GetREDsKey(delAddr sdk.AccAddress) []byte

gets the prefix keyspace for redelegations from a delegator

func GetREDsToValDstIndexKey added in v1.0.0

func GetREDsToValDstIndexKey(valDstAddr sdk.ValAddress) []byte

gets the prefix keyspace for all redelegations redelegating towards a destination validator

func GetRedelegationTimeKey added in v1.0.0

func GetRedelegationTimeKey(timestamp time.Time) []byte

gets the prefix for all unbonding delegations from a delegator

func GetUBDByValIndexKey added in v1.0.0

func GetUBDByValIndexKey(delAddr sdk.AccAddress, valAddr sdk.ValAddress) []byte

gets the index-key for an unbonding delegation, stored by validator-index VALUE: none (key rearrangement used)

func GetUBDKey added in v1.0.0

func GetUBDKey(delAddr sdk.AccAddress, valAddr sdk.ValAddress) []byte

gets the key for an unbonding delegation by delegator and validator addr VALUE: staking/UnbondingDelegation

func GetUBDKeyFromValIndexKey added in v1.0.0

func GetUBDKeyFromValIndexKey(indexKey []byte) []byte

rearranges the ValIndexKey to get the UBDKey

func GetUBDsByValIndexKey added in v1.0.0

func GetUBDsByValIndexKey(valAddr sdk.ValAddress) []byte

gets the prefix keyspace for the indexes of unbonding delegations for a validator

func GetUBDsKey added in v1.0.0

func GetUBDsKey(delAddr sdk.AccAddress) []byte

gets the prefix for all unbonding delegations from a delegator

func GetUnbondingDelegationTimeKey added in v1.0.0

func GetUnbondingDelegationTimeKey(timestamp time.Time) []byte

gets the prefix for all unbonding delegations from a delegator

func GetValidatorByConsAddrKey added in v1.0.0

func GetValidatorByConsAddrKey(addr sdk.ConsAddress) []byte

gets the key for the validator with pubkey VALUE: validator operator address ([]byte)

func GetValidatorKey added in v1.0.0

func GetValidatorKey(operatorAddr sdk.ValAddress) []byte

gets the key for the validator with address VALUE: staking/Validator

func GetValidatorQueueTimeKey added in v1.0.0

func GetValidatorQueueTimeKey(timestamp time.Time) []byte

gets the prefix for all unbonding delegations from a delegator

func GetValidatorsByPowerIndexKey added in v1.0.0

func GetValidatorsByPowerIndexKey(validator Validator) []byte

get the validator by power index. Power index is the key used in the power-store, and represents the relative power ranking of the validator. VALUE: validator operator address ([]byte)

func MustMarshalDelegation

func MustMarshalDelegation(cdc codec.Marshaler, delegation Delegation) []byte

MustMarshalDelegation returns the delegation bytes. Panics if fails

func MustMarshalHistoricalInfo added in v1.0.0

func MustMarshalHistoricalInfo(cdc codec.Marshaler, hi HistoricalInfo) []byte

MustMarshalHistoricalInfo wll marshal historical info and panic on error

func MustMarshalRED

func MustMarshalRED(cdc codec.Marshaler, red Redelegation) []byte

MustMarshalRED returns the Redelegation bytes. Panics if fails.

func MustMarshalUBD

func MustMarshalUBD(cdc codec.Marshaler, ubd UnbondingDelegation) []byte

return the unbonding delegation

func MustMarshalValidator

func MustMarshalValidator(cdc codec.Marshaler, validator Validator) []byte

return the redelegation

func ParseValidatorPowerRankKey added in v1.0.0

func ParseValidatorPowerRankKey(key []byte) (operAddr []byte)

parse the validators operator address from power rank key

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers the necessary x/staking interfaces and concrete types on the provided Amino codec. These types are used for Amino JSON serialization.

func ValidateBasic added in v1.0.0

func ValidateBasic(hi HistoricalInfo) error

ValidateBasic will ensure HistoricalInfo is not nil and sorted

Types

type AccountKeeper added in v1.0.0

type AccountKeeper interface {
	IterateAccounts(ctx sdk.Context, process func(authexported.Account) (stop bool))
	GetAccount(ctx sdk.Context, addr sdk.AccAddress) authexported.Account // only used for simulation

	GetModuleAddress(name string) sdk.AccAddress
	GetModuleAccount(ctx sdk.Context, moduleName string) authexported.ModuleAccountI

	// TODO remove with genesis 2-phases refactor https://github.com/KiraCore/cosmos-sdk/issues/2862
	SetModuleAccount(sdk.Context, authexported.ModuleAccountI)
}

AccountKeeper defines the expected account keeper (noalias)

type BankKeeper added in v0.32.0

type BankKeeper interface {
	GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
	GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin
	SetBalances(ctx sdk.Context, addr sdk.AccAddress, balances sdk.Coins) error
	LockedCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
	SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins

	GetSupply(ctx sdk.Context) bankexported.SupplyI

	SendCoinsFromModuleToModule(ctx sdk.Context, senderPool, recipientPool string, amt sdk.Coins) error
	UndelegateCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
	DelegateCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error

	BurnCoins(ctx sdk.Context, name string, amt sdk.Coins) error
}

BankKeeper defines the expected interface needed to retrieve account balances.

type Commission

type Commission struct {
	CommissionRates `protobuf:"bytes,1,opt,name=commission_rates,json=commissionRates,proto3,embedded=commission_rates" json:"commission_rates"`
	UpdateTime      time.Time `protobuf:"bytes,2,opt,name=update_time,json=updateTime,proto3,stdtime" json:"update_time" yaml:"update_time"`
}

Commission defines a commission parameters for a given validator.

func NewCommission

func NewCommission(rate, maxRate, maxChangeRate sdk.Dec) Commission

NewCommission returns an initialized validator commission.

func NewCommissionWithTime

func NewCommissionWithTime(rate, maxRate, maxChangeRate sdk.Dec, updatedAt time.Time) Commission

NewCommissionWithTime returns an initialized validator commission with a specified update time which should be the current block BFT time.

func (*Commission) Descriptor added in v1.0.0

func (*Commission) Descriptor() ([]byte, []int)

func (*Commission) Equal

func (this *Commission) Equal(that interface{}) bool

func (*Commission) GetUpdateTime added in v1.0.0

func (m *Commission) GetUpdateTime() time.Time

func (*Commission) Marshal added in v1.0.0

func (m *Commission) Marshal() (dAtA []byte, err error)

func (*Commission) MarshalTo added in v1.0.0

func (m *Commission) MarshalTo(dAtA []byte) (int, error)

func (*Commission) MarshalToSizedBuffer added in v1.0.0

func (m *Commission) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Commission) ProtoMessage added in v1.0.0

func (*Commission) ProtoMessage()

func (*Commission) Reset added in v1.0.0

func (m *Commission) Reset()

func (*Commission) Size added in v1.0.0

func (m *Commission) Size() (n int)

func (Commission) String

func (c Commission) String() string

String implements the Stringer interface for a Commission object.

func (*Commission) Unmarshal added in v1.0.0

func (m *Commission) Unmarshal(dAtA []byte) error

func (Commission) ValidateNewRate

func (c Commission) ValidateNewRate(newRate sdk.Dec, blockTime time.Time) error

ValidateNewRate performs basic sanity validation checks of a new commission rate. If validation fails, an SDK error is returned.

func (*Commission) XXX_DiscardUnknown added in v1.0.0

func (m *Commission) XXX_DiscardUnknown()

func (*Commission) XXX_Marshal added in v1.0.0

func (m *Commission) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Commission) XXX_Merge added in v1.0.0

func (m *Commission) XXX_Merge(src proto.Message)

func (*Commission) XXX_Size added in v1.0.0

func (m *Commission) XXX_Size() int

func (*Commission) XXX_Unmarshal added in v1.0.0

func (m *Commission) XXX_Unmarshal(b []byte) error

type CommissionRates added in v1.0.0

type CommissionRates struct {
	Rate          github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=rate,proto3,customtype=github.com/KiraCore/cosmos-sdk/types.Dec" json:"rate"`
	MaxRate       github_com_cosmos_cosmos_sdk_types.Dec `` /* 140-byte string literal not displayed */
	MaxChangeRate github_com_cosmos_cosmos_sdk_types.Dec `` /* 167-byte string literal not displayed */
}

CommissionRates defines the initial commission rates to be used for creating a validator.

func NewCommissionRates added in v1.0.0

func NewCommissionRates(rate, maxRate, maxChangeRate sdk.Dec) CommissionRates

NewCommissionRates returns an initialized validator commission rates.

func (*CommissionRates) Descriptor added in v1.0.0

func (*CommissionRates) Descriptor() ([]byte, []int)

func (*CommissionRates) Equal added in v1.0.0

func (this *CommissionRates) Equal(that interface{}) bool

func (*CommissionRates) Marshal added in v1.0.0

func (m *CommissionRates) Marshal() (dAtA []byte, err error)

func (*CommissionRates) MarshalTo added in v1.0.0

func (m *CommissionRates) MarshalTo(dAtA []byte) (int, error)

func (*CommissionRates) MarshalToSizedBuffer added in v1.0.0

func (m *CommissionRates) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*CommissionRates) ProtoMessage added in v1.0.0

func (*CommissionRates) ProtoMessage()

func (*CommissionRates) Reset added in v1.0.0

func (m *CommissionRates) Reset()

func (*CommissionRates) Size added in v1.0.0

func (m *CommissionRates) Size() (n int)

func (CommissionRates) String added in v1.0.0

func (cr CommissionRates) String() string

String implements the Stringer interface for a CommissionRates object.

func (*CommissionRates) Unmarshal added in v1.0.0

func (m *CommissionRates) Unmarshal(dAtA []byte) error

func (CommissionRates) Validate added in v1.0.0

func (cr CommissionRates) Validate() error

Validate performs basic sanity validation checks of initial commission parameters. If validation fails, an SDK error is returned.

func (*CommissionRates) XXX_DiscardUnknown added in v1.0.0

func (m *CommissionRates) XXX_DiscardUnknown()

func (*CommissionRates) XXX_Marshal added in v1.0.0

func (m *CommissionRates) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CommissionRates) XXX_Merge added in v1.0.0

func (m *CommissionRates) XXX_Merge(src proto.Message)

func (*CommissionRates) XXX_Size added in v1.0.0

func (m *CommissionRates) XXX_Size() int

func (*CommissionRates) XXX_Unmarshal added in v1.0.0

func (m *CommissionRates) XXX_Unmarshal(b []byte) error

type DVPair

type DVPair struct {
	DelegatorAddress github_com_cosmos_cosmos_sdk_types.AccAddress `` /* 191-byte string literal not displayed */
	ValidatorAddress github_com_cosmos_cosmos_sdk_types.ValAddress `` /* 191-byte string literal not displayed */
}

DVPair is struct that just has a delegator-validator pair with no other data. It is intended to be used as a marshalable pointer. For example, a DVPair can be used to construct the key to getting an UnbondingDelegation from state.

func (*DVPair) Descriptor added in v1.0.0

func (*DVPair) Descriptor() ([]byte, []int)

func (*DVPair) Equal added in v1.0.0

func (this *DVPair) Equal(that interface{}) bool

func (*DVPair) GetDelegatorAddress added in v1.0.0

func (m *DVPair) GetDelegatorAddress() github_com_cosmos_cosmos_sdk_types.AccAddress

func (*DVPair) GetValidatorAddress added in v1.0.0

func (m *DVPair) GetValidatorAddress() github_com_cosmos_cosmos_sdk_types.ValAddress

func (*DVPair) Marshal added in v1.0.0

func (m *DVPair) Marshal() (dAtA []byte, err error)

func (*DVPair) MarshalTo added in v1.0.0

func (m *DVPair) MarshalTo(dAtA []byte) (int, error)

func (*DVPair) MarshalToSizedBuffer added in v1.0.0

func (m *DVPair) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*DVPair) ProtoMessage added in v1.0.0

func (*DVPair) ProtoMessage()

func (*DVPair) Reset added in v1.0.0

func (m *DVPair) Reset()

func (*DVPair) Size added in v1.0.0

func (m *DVPair) Size() (n int)

func (DVPair) String added in v1.0.0

func (dv DVPair) String() string

String implements the Stringer interface for a DVPair object.

func (*DVPair) Unmarshal added in v1.0.0

func (m *DVPair) Unmarshal(dAtA []byte) error

func (*DVPair) XXX_DiscardUnknown added in v1.0.0

func (m *DVPair) XXX_DiscardUnknown()

func (*DVPair) XXX_Marshal added in v1.0.0

func (m *DVPair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DVPair) XXX_Merge added in v1.0.0

func (m *DVPair) XXX_Merge(src proto.Message)

func (*DVPair) XXX_Size added in v1.0.0

func (m *DVPair) XXX_Size() int

func (*DVPair) XXX_Unmarshal added in v1.0.0

func (m *DVPair) XXX_Unmarshal(b []byte) error

type DVPairs added in v1.0.0

type DVPairs struct {
	Pairs []DVPair `protobuf:"bytes,1,rep,name=pairs,proto3" json:"pairs"`
}

DVPairs defines an array of DVPair objects.

func (*DVPairs) Descriptor added in v1.0.0

func (*DVPairs) Descriptor() ([]byte, []int)

func (*DVPairs) GetPairs added in v1.0.0

func (m *DVPairs) GetPairs() []DVPair

func (*DVPairs) Marshal added in v1.0.0

func (m *DVPairs) Marshal() (dAtA []byte, err error)

func (*DVPairs) MarshalTo added in v1.0.0

func (m *DVPairs) MarshalTo(dAtA []byte) (int, error)

func (*DVPairs) MarshalToSizedBuffer added in v1.0.0

func (m *DVPairs) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*DVPairs) ProtoMessage added in v1.0.0

func (*DVPairs) ProtoMessage()

func (*DVPairs) Reset added in v1.0.0

func (m *DVPairs) Reset()

func (*DVPairs) Size added in v1.0.0

func (m *DVPairs) Size() (n int)

func (*DVPairs) String added in v1.0.0

func (m *DVPairs) String() string

func (*DVPairs) Unmarshal added in v1.0.0

func (m *DVPairs) Unmarshal(dAtA []byte) error

func (*DVPairs) XXX_DiscardUnknown added in v1.0.0

func (m *DVPairs) XXX_DiscardUnknown()

func (*DVPairs) XXX_Marshal added in v1.0.0

func (m *DVPairs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DVPairs) XXX_Merge added in v1.0.0

func (m *DVPairs) XXX_Merge(src proto.Message)

func (*DVPairs) XXX_Size added in v1.0.0

func (m *DVPairs) XXX_Size() int

func (*DVPairs) XXX_Unmarshal added in v1.0.0

func (m *DVPairs) XXX_Unmarshal(b []byte) error

type DVVTriplet

type DVVTriplet struct {
	DelegatorAddress    github_com_cosmos_cosmos_sdk_types.AccAddress `` /* 191-byte string literal not displayed */
	ValidatorSrcAddress github_com_cosmos_cosmos_sdk_types.ValAddress `` /* 206-byte string literal not displayed */
	ValidatorDstAddress github_com_cosmos_cosmos_sdk_types.ValAddress `` /* 206-byte string literal not displayed */
}

DVVTriplet is struct that just has a delegator-validator-validator triplet with no other data. It is intended to be used as a marshalable pointer. For example, a DVVTriplet can be used to construct the key to getting a Redelegation from state.

func (*DVVTriplet) Descriptor added in v1.0.0

func (*DVVTriplet) Descriptor() ([]byte, []int)

func (*DVVTriplet) Equal added in v1.0.0

func (this *DVVTriplet) Equal(that interface{}) bool

func (*DVVTriplet) GetDelegatorAddress added in v1.0.0

func (m *DVVTriplet) GetDelegatorAddress() github_com_cosmos_cosmos_sdk_types.AccAddress

func (*DVVTriplet) GetValidatorDstAddress added in v1.0.0

func (m *DVVTriplet) GetValidatorDstAddress() github_com_cosmos_cosmos_sdk_types.ValAddress

func (*DVVTriplet) GetValidatorSrcAddress added in v1.0.0

func (m *DVVTriplet) GetValidatorSrcAddress() github_com_cosmos_cosmos_sdk_types.ValAddress

func (*DVVTriplet) Marshal added in v1.0.0

func (m *DVVTriplet) Marshal() (dAtA []byte, err error)

func (*DVVTriplet) MarshalTo added in v1.0.0

func (m *DVVTriplet) MarshalTo(dAtA []byte) (int, error)

func (*DVVTriplet) MarshalToSizedBuffer added in v1.0.0

func (m *DVVTriplet) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*DVVTriplet) ProtoMessage added in v1.0.0

func (*DVVTriplet) ProtoMessage()

func (*DVVTriplet) Reset added in v1.0.0

func (m *DVVTriplet) Reset()

func (*DVVTriplet) Size added in v1.0.0

func (m *DVVTriplet) Size() (n int)

func (DVVTriplet) String added in v1.0.0

func (dvv DVVTriplet) String() string

String implements the Stringer interface for a DVVTriplet object.

func (*DVVTriplet) Unmarshal added in v1.0.0

func (m *DVVTriplet) Unmarshal(dAtA []byte) error

func (*DVVTriplet) XXX_DiscardUnknown added in v1.0.0

func (m *DVVTriplet) XXX_DiscardUnknown()

func (*DVVTriplet) XXX_Marshal added in v1.0.0

func (m *DVVTriplet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DVVTriplet) XXX_Merge added in v1.0.0

func (m *DVVTriplet) XXX_Merge(src proto.Message)

func (*DVVTriplet) XXX_Size added in v1.0.0

func (m *DVVTriplet) XXX_Size() int

func (*DVVTriplet) XXX_Unmarshal added in v1.0.0

func (m *DVVTriplet) XXX_Unmarshal(b []byte) error

type DVVTriplets added in v1.0.0

type DVVTriplets struct {
	Triplets []DVVTriplet `protobuf:"bytes,1,rep,name=triplets,proto3" json:"triplets"`
}

DVVTriplets defines an array of DVVTriplet objects.

func (*DVVTriplets) Descriptor added in v1.0.0

func (*DVVTriplets) Descriptor() ([]byte, []int)

func (*DVVTriplets) GetTriplets added in v1.0.0

func (m *DVVTriplets) GetTriplets() []DVVTriplet

func (*DVVTriplets) Marshal added in v1.0.0

func (m *DVVTriplets) Marshal() (dAtA []byte, err error)

func (*DVVTriplets) MarshalTo added in v1.0.0

func (m *DVVTriplets) MarshalTo(dAtA []byte) (int, error)

func (*DVVTriplets) MarshalToSizedBuffer added in v1.0.0

func (m *DVVTriplets) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*DVVTriplets) ProtoMessage added in v1.0.0

func (*DVVTriplets) ProtoMessage()

func (*DVVTriplets) Reset added in v1.0.0

func (m *DVVTriplets) Reset()

func (*DVVTriplets) Size added in v1.0.0

func (m *DVVTriplets) Size() (n int)

func (*DVVTriplets) String added in v1.0.0

func (m *DVVTriplets) String() string

func (*DVVTriplets) Unmarshal added in v1.0.0

func (m *DVVTriplets) Unmarshal(dAtA []byte) error

func (*DVVTriplets) XXX_DiscardUnknown added in v1.0.0

func (m *DVVTriplets) XXX_DiscardUnknown()

func (*DVVTriplets) XXX_Marshal added in v1.0.0

func (m *DVVTriplets) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DVVTriplets) XXX_Merge added in v1.0.0

func (m *DVVTriplets) XXX_Merge(src proto.Message)

func (*DVVTriplets) XXX_Size added in v1.0.0

func (m *DVVTriplets) XXX_Size() int

func (*DVVTriplets) XXX_Unmarshal added in v1.0.0

func (m *DVVTriplets) XXX_Unmarshal(b []byte) error

type Delegation

type Delegation struct {
	DelegatorAddress github_com_cosmos_cosmos_sdk_types.AccAddress `` /* 191-byte string literal not displayed */
	ValidatorAddress github_com_cosmos_cosmos_sdk_types.ValAddress `` /* 191-byte string literal not displayed */
	Shares           github_com_cosmos_cosmos_sdk_types.Dec        `protobuf:"bytes,3,opt,name=shares,proto3,customtype=github.com/KiraCore/cosmos-sdk/types.Dec" json:"shares"`
}

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

func MustUnmarshalDelegation

func MustUnmarshalDelegation(cdc codec.Marshaler, value []byte) Delegation

MustUnmarshalDelegation return the unmarshaled delegation from bytes. Panics if fails.

func NewDelegation

func NewDelegation(delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress, shares sdk.Dec) Delegation

NewDelegation creates a new delegation object

func UnmarshalDelegation

func UnmarshalDelegation(cdc codec.Marshaler, value []byte) (delegation Delegation, err error)

return the delegation

func (*Delegation) Descriptor added in v1.0.0

func (*Delegation) Descriptor() ([]byte, []int)

func (*Delegation) Equal

func (this *Delegation) Equal(that interface{}) bool

func (Delegation) GetDelegatorAddr

func (d Delegation) GetDelegatorAddr() sdk.AccAddress

func (*Delegation) GetDelegatorAddress added in v1.0.0

func (m *Delegation) GetDelegatorAddress() github_com_cosmos_cosmos_sdk_types.AccAddress

func (Delegation) GetShares

func (d Delegation) GetShares() sdk.Dec

func (Delegation) GetValidatorAddr

func (d Delegation) GetValidatorAddr() sdk.ValAddress

func (*Delegation) GetValidatorAddress added in v1.0.0

func (m *Delegation) GetValidatorAddress() github_com_cosmos_cosmos_sdk_types.ValAddress

func (*Delegation) Marshal added in v1.0.0

func (m *Delegation) Marshal() (dAtA []byte, err error)

func (*Delegation) MarshalTo added in v1.0.0

func (m *Delegation) MarshalTo(dAtA []byte) (int, error)

func (*Delegation) MarshalToSizedBuffer added in v1.0.0

func (m *Delegation) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Delegation) ProtoMessage added in v1.0.0

func (*Delegation) ProtoMessage()

func (*Delegation) Reset added in v1.0.0

func (m *Delegation) Reset()

func (*Delegation) Size added in v1.0.0

func (m *Delegation) Size() (n int)

func (Delegation) String

func (d Delegation) String() string

String returns a human readable string representation of a Delegation.

func (*Delegation) Unmarshal added in v1.0.0

func (m *Delegation) Unmarshal(dAtA []byte) error

func (*Delegation) XXX_DiscardUnknown added in v1.0.0

func (m *Delegation) XXX_DiscardUnknown()

func (*Delegation) XXX_Marshal added in v1.0.0

func (m *Delegation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Delegation) XXX_Merge added in v1.0.0

func (m *Delegation) XXX_Merge(src proto.Message)

func (*Delegation) XXX_Size added in v1.0.0

func (m *Delegation) XXX_Size() int

func (*Delegation) XXX_Unmarshal added in v1.0.0

func (m *Delegation) XXX_Unmarshal(b []byte) error

type DelegationResponse added in v1.0.0

type DelegationResponse struct {
	Delegation
	Balance sdk.Coin `json:"balance" yaml:"balance"`
}

DelegationResponse is equivalent to Delegation except that it contains a balance in addition to shares which is more suitable for client responses.

func NewDelegationResp added in v1.0.0

func NewDelegationResp(
	delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress, shares sdk.Dec, balance sdk.Coin,
) DelegationResponse

NewDelegationResp creates a new DelegationResponse instance

func (DelegationResponse) MarshalJSON added in v1.0.0

func (d DelegationResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface. This is so we can achieve a flattened structure while embedding other types.

func (DelegationResponse) String added in v1.0.0

func (d DelegationResponse) String() string

String implements the Stringer interface for DelegationResponse.

func (*DelegationResponse) UnmarshalJSON added in v1.0.0

func (d *DelegationResponse) UnmarshalJSON(bz []byte) error

UnmarshalJSON implements the json.Unmarshaler interface. This is so we can achieve a flattened structure while embedding other types.

type DelegationResponses added in v1.0.0

type DelegationResponses []DelegationResponse

DelegationResponses is a collection of DelegationResp

func (DelegationResponses) String added in v1.0.0

func (d DelegationResponses) String() (out string)

String implements the Stringer interface for DelegationResponses.

type DelegationSet added in v1.0.0

type DelegationSet interface {
	GetValidatorSet() ValidatorSet // validator set for which delegation set is based upon

	// iterate through all delegations from one delegator by validator-AccAddress,
	//   execute func for each validator
	IterateDelegations(ctx sdk.Context, delegator sdk.AccAddress,
		fn func(index int64, delegation stakingexported.DelegationI) (stop bool))
}

DelegationSet expected properties for the set of all delegations for a particular (noalias)

type Delegations

type Delegations []Delegation

Delegations is a collection of delegations

func (Delegations) String

func (d Delegations) String() (out string)

type Description

type Description struct {
	Moniker         string `protobuf:"bytes,1,opt,name=moniker,proto3" json:"moniker,omitempty"`
	Identity        string `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"`
	Website         string `protobuf:"bytes,3,opt,name=website,proto3" json:"website,omitempty"`
	SecurityContact string `` /* 130-byte string literal not displayed */
	Details         string `protobuf:"bytes,5,opt,name=details,proto3" json:"details,omitempty"`
}

Description defines a validator description.

func NewDescription

func NewDescription(moniker, identity, website, securityContact, details string) Description

func (*Description) Descriptor added in v1.0.0

func (*Description) Descriptor() ([]byte, []int)

func (Description) EnsureLength

func (d Description) EnsureLength() (Description, error)

EnsureLength ensures the length of a validator's description.

func (*Description) Equal added in v1.0.0

func (this *Description) Equal(that interface{}) bool

func (*Description) GetDetails added in v1.0.0

func (m *Description) GetDetails() string

func (*Description) GetIdentity added in v1.0.0

func (m *Description) GetIdentity() string

func (*Description) GetMoniker added in v1.0.0

func (m *Description) GetMoniker() string

func (*Description) GetSecurityContact added in v1.0.0

func (m *Description) GetSecurityContact() string

func (*Description) GetWebsite added in v1.0.0

func (m *Description) GetWebsite() string

func (*Description) Marshal added in v1.0.0

func (m *Description) Marshal() (dAtA []byte, err error)

func (*Description) MarshalTo added in v1.0.0

func (m *Description) MarshalTo(dAtA []byte) (int, error)

func (*Description) MarshalToSizedBuffer added in v1.0.0

func (m *Description) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Description) ProtoMessage added in v1.0.0

func (*Description) ProtoMessage()

func (*Description) Reset added in v1.0.0

func (m *Description) Reset()

func (*Description) Size added in v1.0.0

func (m *Description) Size() (n int)

func (Description) String added in v1.0.0

func (d Description) String() string

String implements the Stringer interface for a Description object.

func (*Description) Unmarshal added in v1.0.0

func (m *Description) Unmarshal(dAtA []byte) error

func (Description) UpdateDescription

func (d Description) UpdateDescription(d2 Description) (Description, error)

UpdateDescription updates the fields of a given description. An error is returned if the resulting description contains an invalid length.

func (*Description) XXX_DiscardUnknown added in v1.0.0

func (m *Description) XXX_DiscardUnknown()

func (*Description) XXX_Marshal added in v1.0.0

func (m *Description) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Description) XXX_Merge added in v1.0.0

func (m *Description) XXX_Merge(src proto.Message)

func (*Description) XXX_Size added in v1.0.0

func (m *Description) XXX_Size() int

func (*Description) XXX_Unmarshal added in v1.0.0

func (m *Description) XXX_Unmarshal(b []byte) error

type DistributionKeeper added in v0.32.0

type DistributionKeeper interface {
	GetFeePoolCommunityCoins(ctx sdk.Context) sdk.DecCoins
	GetValidatorOutstandingRewardsCoins(ctx sdk.Context, val sdk.ValAddress) sdk.DecCoins
}

DistributionKeeper expected distribution keeper (noalias)

type GenesisState

type GenesisState struct {
	Params               Params                `json:"params" yaml:"params"`
	LastTotalPower       sdk.Int               `json:"last_total_power" yaml:"last_total_power"`
	LastValidatorPowers  []LastValidatorPower  `json:"last_validator_powers" yaml:"last_validator_powers"`
	Validators           Validators            `json:"validators" yaml:"validators"`
	Delegations          Delegations           `json:"delegations" yaml:"delegations"`
	UnbondingDelegations []UnbondingDelegation `json:"unbonding_delegations" yaml:"unbonding_delegations"`
	Redelegations        []Redelegation        `json:"redelegations" yaml:"redelegations"`
	Exported             bool                  `json:"exported" yaml:"exported"`
}

GenesisState - all staking state that must be provided at genesis

func DefaultGenesisState

func DefaultGenesisState() GenesisState

DefaultGenesisState gets the raw genesis raw message for testing

func GetGenesisStateFromAppState added in v1.0.0

func GetGenesisStateFromAppState(cdc *codec.Codec, appState map[string]json.RawMessage) GenesisState

GetGenesisStateFromAppState returns x/staking GenesisState given raw application genesis state.

func NewGenesisState

func NewGenesisState(params Params, validators []Validator, delegations []Delegation) GenesisState

NewGenesisState creates a new GenesisState instanc e

type HistoricalInfo added in v1.0.0

type HistoricalInfo struct {
	Header types1.Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header"`
	Valset []Validator   `protobuf:"bytes,2,rep,name=valset,proto3" json:"valset"`
}

HistoricalInfo contains the historical information that gets stored at each height.

func MustUnmarshalHistoricalInfo added in v1.0.0

func MustUnmarshalHistoricalInfo(cdc codec.Marshaler, value []byte) HistoricalInfo

MustUnmarshalHistoricalInfo wll unmarshal historical info and panic on error

func NewHistoricalInfo added in v1.0.0

func NewHistoricalInfo(header abci.Header, valSet Validators) HistoricalInfo

NewHistoricalInfo will create a historical information struct from header and valset it will first sort valset before inclusion into historical info

func UnmarshalHistoricalInfo added in v1.0.0

func UnmarshalHistoricalInfo(cdc codec.Marshaler, value []byte) (hi HistoricalInfo, err error)

UnmarshalHistoricalInfo will unmarshal historical info and return any error

func (*HistoricalInfo) Descriptor added in v1.0.0

func (*HistoricalInfo) Descriptor() ([]byte, []int)

func (*HistoricalInfo) Equal added in v1.0.0

func (this *HistoricalInfo) Equal(that interface{}) bool

func (*HistoricalInfo) GetHeader added in v1.0.0

func (m *HistoricalInfo) GetHeader() types1.Header

func (*HistoricalInfo) GetValset added in v1.0.0

func (m *HistoricalInfo) GetValset() []Validator

func (*HistoricalInfo) Marshal added in v1.0.0

func (m *HistoricalInfo) Marshal() (dAtA []byte, err error)

func (*HistoricalInfo) MarshalTo added in v1.0.0

func (m *HistoricalInfo) MarshalTo(dAtA []byte) (int, error)

func (*HistoricalInfo) MarshalToSizedBuffer added in v1.0.0

func (m *HistoricalInfo) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*HistoricalInfo) ProtoMessage added in v1.0.0

func (*HistoricalInfo) ProtoMessage()

func (*HistoricalInfo) Reset added in v1.0.0

func (m *HistoricalInfo) Reset()

func (*HistoricalInfo) Size added in v1.0.0

func (m *HistoricalInfo) Size() (n int)

func (*HistoricalInfo) String added in v1.0.0

func (m *HistoricalInfo) String() string

func (*HistoricalInfo) Unmarshal added in v1.0.0

func (m *HistoricalInfo) Unmarshal(dAtA []byte) error

func (*HistoricalInfo) XXX_DiscardUnknown added in v1.0.0

func (m *HistoricalInfo) XXX_DiscardUnknown()

func (*HistoricalInfo) XXX_Marshal added in v1.0.0

func (m *HistoricalInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*HistoricalInfo) XXX_Merge added in v1.0.0

func (m *HistoricalInfo) XXX_Merge(src proto.Message)

func (*HistoricalInfo) XXX_Size added in v1.0.0

func (m *HistoricalInfo) XXX_Size() int

func (*HistoricalInfo) XXX_Unmarshal added in v1.0.0

func (m *HistoricalInfo) XXX_Unmarshal(b []byte) error

type LastValidatorPower

type LastValidatorPower struct {
	Address sdk.ValAddress
	Power   int64
}

LastValidatorPower required for validator set update logic

type MsgBeginRedelegate

type MsgBeginRedelegate struct {
	DelegatorAddress    github_com_cosmos_cosmos_sdk_types.AccAddress `` /* 191-byte string literal not displayed */
	ValidatorSrcAddress github_com_cosmos_cosmos_sdk_types.ValAddress `` /* 206-byte string literal not displayed */
	ValidatorDstAddress github_com_cosmos_cosmos_sdk_types.ValAddress `` /* 206-byte string literal not displayed */
	Amount              types.Coin                                    `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount"`
}

MsgBeginRedelegate defines an SDK message for performing a redelegation from a delegate and source validator to a destination validator.

func NewMsgBeginRedelegate

func NewMsgBeginRedelegate(
	delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress, amount sdk.Coin,
) MsgBeginRedelegate

NewMsgBeginRedelegate creates a new MsgBeginRedelegate instance.

func (*MsgBeginRedelegate) Descriptor added in v1.0.0

func (*MsgBeginRedelegate) Descriptor() ([]byte, []int)

func (*MsgBeginRedelegate) Equal added in v1.0.0

func (this *MsgBeginRedelegate) Equal(that interface{}) bool

func (*MsgBeginRedelegate) GetAmount added in v1.0.0

func (m *MsgBeginRedelegate) GetAmount() types.Coin

func (*MsgBeginRedelegate) GetDelegatorAddress added in v1.0.0

func (MsgBeginRedelegate) GetSignBytes

func (msg MsgBeginRedelegate) GetSignBytes() []byte

GetSignBytes implements the sdk.Msg interface.

func (MsgBeginRedelegate) GetSigners

func (msg MsgBeginRedelegate) GetSigners() []sdk.AccAddress

GetSigners implements the sdk.Msg interface

func (*MsgBeginRedelegate) GetValidatorDstAddress added in v1.0.0

func (*MsgBeginRedelegate) GetValidatorSrcAddress added in v1.0.0

func (*MsgBeginRedelegate) Marshal added in v1.0.0

func (m *MsgBeginRedelegate) Marshal() (dAtA []byte, err error)

func (*MsgBeginRedelegate) MarshalTo added in v1.0.0

func (m *MsgBeginRedelegate) MarshalTo(dAtA []byte) (int, error)

func (*MsgBeginRedelegate) MarshalToSizedBuffer added in v1.0.0

func (m *MsgBeginRedelegate) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgBeginRedelegate) ProtoMessage added in v1.0.0

func (*MsgBeginRedelegate) ProtoMessage()

func (*MsgBeginRedelegate) Reset added in v1.0.0

func (m *MsgBeginRedelegate) Reset()

func (MsgBeginRedelegate) Route

func (msg MsgBeginRedelegate) Route() string

Route implements the sdk.Msg interface.

func (*MsgBeginRedelegate) Size added in v1.0.0

func (m *MsgBeginRedelegate) Size() (n int)

func (*MsgBeginRedelegate) String added in v1.0.0

func (m *MsgBeginRedelegate) String() string

func (MsgBeginRedelegate) Type

func (msg MsgBeginRedelegate) Type() string

Type implements the sdk.Msg interface

func (*MsgBeginRedelegate) Unmarshal added in v1.0.0

func (m *MsgBeginRedelegate) Unmarshal(dAtA []byte) error

func (MsgBeginRedelegate) ValidateBasic

func (msg MsgBeginRedelegate) ValidateBasic() error

ValidateBasic implements the sdk.Msg interface.

func (*MsgBeginRedelegate) XXX_DiscardUnknown added in v1.0.0

func (m *MsgBeginRedelegate) XXX_DiscardUnknown()

func (*MsgBeginRedelegate) XXX_Marshal added in v1.0.0

func (m *MsgBeginRedelegate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgBeginRedelegate) XXX_Merge added in v1.0.0

func (m *MsgBeginRedelegate) XXX_Merge(src proto.Message)

func (*MsgBeginRedelegate) XXX_Size added in v1.0.0

func (m *MsgBeginRedelegate) XXX_Size() int

func (*MsgBeginRedelegate) XXX_Unmarshal added in v1.0.0

func (m *MsgBeginRedelegate) XXX_Unmarshal(b []byte) error

type MsgCreateValidator

type MsgCreateValidator struct {
	Description       Description                                   `protobuf:"bytes,1,opt,name=description,proto3" json:"description"`
	Commission        CommissionRates                               `protobuf:"bytes,2,opt,name=commission,proto3" json:"commission"`
	MinSelfDelegation github_com_cosmos_cosmos_sdk_types.Int        `` /* 183-byte string literal not displayed */
	DelegatorAddress  github_com_cosmos_cosmos_sdk_types.AccAddress `` /* 191-byte string literal not displayed */
	ValidatorAddress  github_com_cosmos_cosmos_sdk_types.ValAddress `` /* 191-byte string literal not displayed */
	Pubkey            string                                        `protobuf:"bytes,6,opt,name=pubkey,proto3" json:"pubkey,omitempty"`
	Value             types.Coin                                    `protobuf:"bytes,7,opt,name=value,proto3" json:"value"`
}

MsgCreateValidator defines an SDK message for creating a new validator.

func NewMsgCreateValidator

func NewMsgCreateValidator(
	valAddr sdk.ValAddress, pubKey crypto.PubKey, selfDelegation sdk.Coin,
	description Description, commission CommissionRates, minSelfDelegation sdk.Int,
) MsgCreateValidator

NewMsgCreateValidator creates a new MsgCreateValidator instance. Delegator address and validator address are the same.

func (*MsgCreateValidator) Descriptor added in v1.0.0

func (*MsgCreateValidator) Descriptor() ([]byte, []int)

func (*MsgCreateValidator) Equal added in v1.0.0

func (this *MsgCreateValidator) Equal(that interface{}) bool

func (*MsgCreateValidator) GetCommission added in v1.0.0

func (m *MsgCreateValidator) GetCommission() CommissionRates

func (*MsgCreateValidator) GetDelegatorAddress added in v1.0.0

func (*MsgCreateValidator) GetDescription added in v1.0.0

func (m *MsgCreateValidator) GetDescription() Description

func (*MsgCreateValidator) GetPubkey added in v1.0.0

func (m *MsgCreateValidator) GetPubkey() string

func (MsgCreateValidator) GetSignBytes

func (msg MsgCreateValidator) GetSignBytes() []byte

GetSignBytes returns the message bytes to sign over.

func (MsgCreateValidator) GetSigners

func (msg MsgCreateValidator) GetSigners() []sdk.AccAddress

GetSigners implements the sdk.Msg interface. It returns the address(es) that must sign over msg.GetSignBytes(). If the validator address is not same as delegator's, then the validator must sign the msg as well.

func (*MsgCreateValidator) GetValidatorAddress added in v1.0.0

func (*MsgCreateValidator) GetValue added in v1.0.0

func (m *MsgCreateValidator) GetValue() types.Coin

func (*MsgCreateValidator) Marshal added in v1.0.0

func (m *MsgCreateValidator) Marshal() (dAtA []byte, err error)

func (*MsgCreateValidator) MarshalTo added in v1.0.0

func (m *MsgCreateValidator) MarshalTo(dAtA []byte) (int, error)

func (*MsgCreateValidator) MarshalToSizedBuffer added in v1.0.0

func (m *MsgCreateValidator) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgCreateValidator) ProtoMessage added in v1.0.0

func (*MsgCreateValidator) ProtoMessage()

func (*MsgCreateValidator) Reset added in v1.0.0

func (m *MsgCreateValidator) Reset()

func (MsgCreateValidator) Route

func (msg MsgCreateValidator) Route() string

Route implements the sdk.Msg interface.

func (*MsgCreateValidator) Size added in v1.0.0

func (m *MsgCreateValidator) Size() (n int)

func (*MsgCreateValidator) String added in v1.0.0

func (m *MsgCreateValidator) String() string

func (MsgCreateValidator) Type

func (msg MsgCreateValidator) Type() string

Type implements the sdk.Msg interface.

func (*MsgCreateValidator) Unmarshal added in v1.0.0

func (m *MsgCreateValidator) Unmarshal(dAtA []byte) error

func (MsgCreateValidator) ValidateBasic

func (msg MsgCreateValidator) ValidateBasic() error

ValidateBasic implements the sdk.Msg interface.

func (*MsgCreateValidator) XXX_DiscardUnknown added in v1.0.0

func (m *MsgCreateValidator) XXX_DiscardUnknown()

func (*MsgCreateValidator) XXX_Marshal added in v1.0.0

func (m *MsgCreateValidator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgCreateValidator) XXX_Merge added in v1.0.0

func (m *MsgCreateValidator) XXX_Merge(src proto.Message)

func (*MsgCreateValidator) XXX_Size added in v1.0.0

func (m *MsgCreateValidator) XXX_Size() int

func (*MsgCreateValidator) XXX_Unmarshal added in v1.0.0

func (m *MsgCreateValidator) XXX_Unmarshal(b []byte) error

type MsgDelegate

type MsgDelegate struct {
	DelegatorAddress github_com_cosmos_cosmos_sdk_types.AccAddress `` /* 191-byte string literal not displayed */
	ValidatorAddress github_com_cosmos_cosmos_sdk_types.ValAddress `` /* 191-byte string literal not displayed */
	Amount           types.Coin                                    `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"`
}

MsgDelegate defines an SDK message for performing a delegation from a delegate to a validator.

func NewMsgDelegate

func NewMsgDelegate(delAddr sdk.AccAddress, valAddr sdk.ValAddress, amount sdk.Coin) MsgDelegate

NewMsgDelegate creates a new MsgDelegate instance.

func (*MsgDelegate) Descriptor added in v1.0.0

func (*MsgDelegate) Descriptor() ([]byte, []int)

func (*MsgDelegate) Equal added in v1.0.0

func (this *MsgDelegate) Equal(that interface{}) bool

func (*MsgDelegate) GetAmount added in v1.0.0

func (m *MsgDelegate) GetAmount() types.Coin

func (*MsgDelegate) GetDelegatorAddress added in v1.0.0

func (MsgDelegate) GetSignBytes

func (msg MsgDelegate) GetSignBytes() []byte

GetSignBytes implements the sdk.Msg interface.

func (MsgDelegate) GetSigners

func (msg MsgDelegate) GetSigners() []sdk.AccAddress

GetSigners implements the sdk.Msg interface.

func (*MsgDelegate) GetValidatorAddress added in v1.0.0

func (*MsgDelegate) Marshal added in v1.0.0

func (m *MsgDelegate) Marshal() (dAtA []byte, err error)

func (*MsgDelegate) MarshalTo added in v1.0.0

func (m *MsgDelegate) MarshalTo(dAtA []byte) (int, error)

func (*MsgDelegate) MarshalToSizedBuffer added in v1.0.0

func (m *MsgDelegate) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgDelegate) ProtoMessage added in v1.0.0

func (*MsgDelegate) ProtoMessage()

func (*MsgDelegate) Reset added in v1.0.0

func (m *MsgDelegate) Reset()

func (MsgDelegate) Route

func (msg MsgDelegate) Route() string

Route implements the sdk.Msg interface.

func (*MsgDelegate) Size added in v1.0.0

func (m *MsgDelegate) Size() (n int)

func (*MsgDelegate) String added in v1.0.0

func (m *MsgDelegate) String() string

func (MsgDelegate) Type

func (msg MsgDelegate) Type() string

Type implements the sdk.Msg interface.

func (*MsgDelegate) Unmarshal added in v1.0.0

func (m *MsgDelegate) Unmarshal(dAtA []byte) error

func (MsgDelegate) ValidateBasic

func (msg MsgDelegate) ValidateBasic() error

ValidateBasic implements the sdk.Msg interface.

func (*MsgDelegate) XXX_DiscardUnknown added in v1.0.0

func (m *MsgDelegate) XXX_DiscardUnknown()

func (*MsgDelegate) XXX_Marshal added in v1.0.0

func (m *MsgDelegate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgDelegate) XXX_Merge added in v1.0.0

func (m *MsgDelegate) XXX_Merge(src proto.Message)

func (*MsgDelegate) XXX_Size added in v1.0.0

func (m *MsgDelegate) XXX_Size() int

func (*MsgDelegate) XXX_Unmarshal added in v1.0.0

func (m *MsgDelegate) XXX_Unmarshal(b []byte) error

type MsgEditValidator

type MsgEditValidator struct {
	Description      Description                                   `protobuf:"bytes,1,opt,name=description,proto3" json:"description"`
	ValidatorAddress github_com_cosmos_cosmos_sdk_types.ValAddress `` /* 181-byte string literal not displayed */
	// We pass a reference to the new commission rate and min self delegation as
	// it's not mandatory to update. If not updated, the deserialized rate will be
	// zero with no way to distinguish if an update was intended.
	//
	// REF: #2373
	CommissionRate    *github_com_cosmos_cosmos_sdk_types.Dec `` /* 178-byte string literal not displayed */
	MinSelfDelegation *github_com_cosmos_cosmos_sdk_types.Int `` /* 193-byte string literal not displayed */
}

MsgEditValidator defines an SDK message for editing an existing validator.

func NewMsgEditValidator

func NewMsgEditValidator(valAddr sdk.ValAddress, description Description, newRate *sdk.Dec, newMinSelfDelegation *sdk.Int) MsgEditValidator

NewMsgEditValidator creates a new MsgEditValidator instance

func (*MsgEditValidator) Descriptor added in v1.0.0

func (*MsgEditValidator) Descriptor() ([]byte, []int)

func (*MsgEditValidator) Equal added in v1.0.0

func (this *MsgEditValidator) Equal(that interface{}) bool

func (*MsgEditValidator) GetDescription added in v1.0.0

func (m *MsgEditValidator) GetDescription() Description

func (MsgEditValidator) GetSignBytes

func (msg MsgEditValidator) GetSignBytes() []byte

GetSignBytes implements the sdk.Msg interface.

func (MsgEditValidator) GetSigners

func (msg MsgEditValidator) GetSigners() []sdk.AccAddress

GetSigners implements the sdk.Msg interface.

func (*MsgEditValidator) GetValidatorAddress added in v1.0.0

func (*MsgEditValidator) Marshal added in v1.0.0

func (m *MsgEditValidator) Marshal() (dAtA []byte, err error)

func (*MsgEditValidator) MarshalTo added in v1.0.0

func (m *MsgEditValidator) MarshalTo(dAtA []byte) (int, error)

func (*MsgEditValidator) MarshalToSizedBuffer added in v1.0.0

func (m *MsgEditValidator) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgEditValidator) ProtoMessage added in v1.0.0

func (*MsgEditValidator) ProtoMessage()

func (*MsgEditValidator) Reset added in v1.0.0

func (m *MsgEditValidator) Reset()

func (MsgEditValidator) Route

func (msg MsgEditValidator) Route() string

Route implements the sdk.Msg interface.

func (*MsgEditValidator) Size added in v1.0.0

func (m *MsgEditValidator) Size() (n int)

func (*MsgEditValidator) String added in v1.0.0

func (m *MsgEditValidator) String() string

func (MsgEditValidator) Type

func (msg MsgEditValidator) Type() string

Type implements the sdk.Msg interface.

func (*MsgEditValidator) Unmarshal added in v1.0.0

func (m *MsgEditValidator) Unmarshal(dAtA []byte) error

func (MsgEditValidator) ValidateBasic

func (msg MsgEditValidator) ValidateBasic() error

ValidateBasic implements the sdk.Msg interface.

func (*MsgEditValidator) XXX_DiscardUnknown added in v1.0.0

func (m *MsgEditValidator) XXX_DiscardUnknown()

func (*MsgEditValidator) XXX_Marshal added in v1.0.0

func (m *MsgEditValidator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgEditValidator) XXX_Merge added in v1.0.0

func (m *MsgEditValidator) XXX_Merge(src proto.Message)

func (*MsgEditValidator) XXX_Size added in v1.0.0

func (m *MsgEditValidator) XXX_Size() int

func (*MsgEditValidator) XXX_Unmarshal added in v1.0.0

func (m *MsgEditValidator) XXX_Unmarshal(b []byte) error

type MsgUndelegate

type MsgUndelegate struct {
	DelegatorAddress github_com_cosmos_cosmos_sdk_types.AccAddress `` /* 191-byte string literal not displayed */
	ValidatorAddress github_com_cosmos_cosmos_sdk_types.ValAddress `` /* 191-byte string literal not displayed */
	Amount           types.Coin                                    `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"`
}

MsgUndelegate defines an SDK message for performing an undelegation from a delegate and a validator.

func NewMsgUndelegate

func NewMsgUndelegate(delAddr sdk.AccAddress, valAddr sdk.ValAddress, amount sdk.Coin) MsgUndelegate

NewMsgUndelegate creates a new MsgUndelegate instance.

func (*MsgUndelegate) Descriptor added in v1.0.0

func (*MsgUndelegate) Descriptor() ([]byte, []int)

func (*MsgUndelegate) Equal added in v1.0.0

func (this *MsgUndelegate) Equal(that interface{}) bool

func (*MsgUndelegate) GetAmount added in v1.0.0

func (m *MsgUndelegate) GetAmount() types.Coin

func (*MsgUndelegate) GetDelegatorAddress added in v1.0.0

func (MsgUndelegate) GetSignBytes

func (msg MsgUndelegate) GetSignBytes() []byte

GetSignBytes implements the sdk.Msg interface.

func (MsgUndelegate) GetSigners

func (msg MsgUndelegate) GetSigners() []sdk.AccAddress

GetSigners implements the sdk.Msg interface.

func (*MsgUndelegate) GetValidatorAddress added in v1.0.0

func (*MsgUndelegate) Marshal added in v1.0.0

func (m *MsgUndelegate) Marshal() (dAtA []byte, err error)

func (*MsgUndelegate) MarshalTo added in v1.0.0

func (m *MsgUndelegate) MarshalTo(dAtA []byte) (int, error)

func (*MsgUndelegate) MarshalToSizedBuffer added in v1.0.0

func (m *MsgUndelegate) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgUndelegate) ProtoMessage added in v1.0.0

func (*MsgUndelegate) ProtoMessage()

func (*MsgUndelegate) Reset added in v1.0.0

func (m *MsgUndelegate) Reset()

func (MsgUndelegate) Route

func (msg MsgUndelegate) Route() string

Route implements the sdk.Msg interface.

func (*MsgUndelegate) Size added in v1.0.0

func (m *MsgUndelegate) Size() (n int)

func (*MsgUndelegate) String added in v1.0.0

func (m *MsgUndelegate) String() string

func (MsgUndelegate) Type

func (msg MsgUndelegate) Type() string

Type implements the sdk.Msg interface.

func (*MsgUndelegate) Unmarshal added in v1.0.0

func (m *MsgUndelegate) Unmarshal(dAtA []byte) error

func (MsgUndelegate) ValidateBasic

func (msg MsgUndelegate) ValidateBasic() error

ValidateBasic implements the sdk.Msg interface.

func (*MsgUndelegate) XXX_DiscardUnknown added in v1.0.0

func (m *MsgUndelegate) XXX_DiscardUnknown()

func (*MsgUndelegate) XXX_Marshal added in v1.0.0

func (m *MsgUndelegate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgUndelegate) XXX_Merge added in v1.0.0

func (m *MsgUndelegate) XXX_Merge(src proto.Message)

func (*MsgUndelegate) XXX_Size added in v1.0.0

func (m *MsgUndelegate) XXX_Size() int

func (*MsgUndelegate) XXX_Unmarshal added in v1.0.0

func (m *MsgUndelegate) XXX_Unmarshal(b []byte) error

type MultiStakingHooks added in v1.0.0

type MultiStakingHooks []StakingHooks

combine multiple staking hooks, all hook functions are run in array sequence

func NewMultiStakingHooks added in v1.0.0

func NewMultiStakingHooks(hooks ...StakingHooks) MultiStakingHooks

func (MultiStakingHooks) AfterDelegationModified added in v1.0.0

func (h MultiStakingHooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)

func (MultiStakingHooks) AfterValidatorBeginUnbonding added in v1.0.0

func (h MultiStakingHooks) AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)

func (MultiStakingHooks) AfterValidatorBonded added in v1.0.0

func (h MultiStakingHooks) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)

func (MultiStakingHooks) AfterValidatorCreated added in v1.0.0

func (h MultiStakingHooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress)

func (MultiStakingHooks) AfterValidatorRemoved added in v1.0.0

func (h MultiStakingHooks) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)

func (MultiStakingHooks) BeforeDelegationCreated added in v1.0.0

func (h MultiStakingHooks) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)

func (MultiStakingHooks) BeforeDelegationRemoved added in v1.0.0

func (h MultiStakingHooks) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)

func (MultiStakingHooks) BeforeDelegationSharesModified added in v1.0.0

func (h MultiStakingHooks) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)

func (MultiStakingHooks) BeforeValidatorModified added in v1.0.0

func (h MultiStakingHooks) BeforeValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress)

func (MultiStakingHooks) BeforeValidatorSlashed added in v1.0.0

func (h MultiStakingHooks) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec)

type Params

type Params struct {
	UnbondingTime     time.Duration `protobuf:"bytes,1,opt,name=unbonding_time,json=unbondingTime,proto3,stdduration" json:"unbonding_time" yaml:"unbonding_time"`
	MaxValidators     uint32        `protobuf:"varint,2,opt,name=max_validators,json=maxValidators,proto3" json:"max_validators,omitempty" yaml:"max_validators"`
	MaxEntries        uint32        `protobuf:"varint,3,opt,name=max_entries,json=maxEntries,proto3" json:"max_entries,omitempty" yaml:"max_entries"`
	HistoricalEntries uint32        `` /* 139-byte string literal not displayed */
	BondDenom         string        `protobuf:"bytes,5,opt,name=bond_denom,json=bondDenom,proto3" json:"bond_denom,omitempty" yaml:"bond_denom"`
}

Params defines the parameters for the staking module.

func DefaultParams

func DefaultParams() Params

DefaultParams returns a default set of parameters.

func MustUnmarshalParams

func MustUnmarshalParams(cdc *codec.Codec, value []byte) Params

unmarshal the current staking params value from store key or panic

func NewParams added in v0.31.0

func NewParams(unbondingTime time.Duration, maxValidators, maxEntries, historicalEntries uint32, bondDenom string) Params

NewParams creates a new Params instance

func UnmarshalParams

func UnmarshalParams(cdc *codec.Codec, value []byte) (params Params, err error)

unmarshal the current staking params value from store key

func (*Params) Descriptor added in v1.0.0

func (*Params) Descriptor() ([]byte, []int)

func (*Params) Equal

func (this *Params) Equal(that interface{}) bool

func (*Params) GetBondDenom added in v1.0.0

func (m *Params) GetBondDenom() string

func (*Params) GetHistoricalEntries added in v1.0.0

func (m *Params) GetHistoricalEntries() uint32

func (*Params) GetMaxEntries added in v1.0.0

func (m *Params) GetMaxEntries() uint32

func (*Params) GetMaxValidators added in v1.0.0

func (m *Params) GetMaxValidators() uint32

func (*Params) GetUnbondingTime added in v1.0.0

func (m *Params) GetUnbondingTime() time.Duration

func (*Params) Marshal added in v1.0.0

func (m *Params) Marshal() (dAtA []byte, err error)

func (*Params) MarshalTo added in v1.0.0

func (m *Params) MarshalTo(dAtA []byte) (int, error)

func (*Params) MarshalToSizedBuffer added in v1.0.0

func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Params) ParamSetPairs added in v0.31.0

func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs

Implements params.ParamSet

func (*Params) ProtoMessage added in v1.0.0

func (*Params) ProtoMessage()

func (*Params) Reset added in v1.0.0

func (m *Params) Reset()

func (*Params) Size added in v1.0.0

func (m *Params) Size() (n int)

func (Params) String

func (p Params) String() string

String returns a human readable string representation of the parameters.

func (*Params) Unmarshal added in v1.0.0

func (m *Params) Unmarshal(dAtA []byte) error

func (Params) Validate added in v0.31.0

func (p Params) Validate() error

validate a set of params

func (*Params) XXX_DiscardUnknown added in v1.0.0

func (m *Params) XXX_DiscardUnknown()

func (*Params) XXX_Marshal added in v1.0.0

func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Params) XXX_Merge added in v1.0.0

func (m *Params) XXX_Merge(src proto.Message)

func (*Params) XXX_Size added in v1.0.0

func (m *Params) XXX_Size() int

func (*Params) XXX_Unmarshal added in v1.0.0

func (m *Params) XXX_Unmarshal(b []byte) error

type Pool

type Pool struct {
	NotBondedTokens sdk.Int `json:"not_bonded_tokens" yaml:"not_bonded_tokens"` // tokens which are not bonded to a validator (unbonded or unbonding)
	BondedTokens    sdk.Int `json:"bonded_tokens" yaml:"bonded_tokens"`         // tokens which are currently bonded to a validator
}

Pool - tracking bonded and not-bonded token supply of the bond denomination

func NewPool added in v1.0.0

func NewPool(notBonded, bonded sdk.Int) Pool

NewPool creates a new Pool instance used for queries

func (Pool) String

func (p Pool) String() string

String returns a human readable string representation of a pool.

type QueryBondsParams added in v1.0.0

type QueryBondsParams struct {
	DelegatorAddr sdk.AccAddress
	ValidatorAddr sdk.ValAddress
}

defines the params for the following queries: - 'custom/staking/delegation' - 'custom/staking/unbondingDelegation' - 'custom/staking/delegatorValidator'

func NewQueryBondsParams added in v1.0.0

func NewQueryBondsParams(delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress) QueryBondsParams

type QueryDelegatorParams added in v1.0.0

type QueryDelegatorParams struct {
	DelegatorAddr sdk.AccAddress
}

defines the params for the following queries: - 'custom/staking/delegatorDelegations' - 'custom/staking/delegatorUnbondingDelegations' - 'custom/staking/delegatorRedelegations' - 'custom/staking/delegatorValidators'

func NewQueryDelegatorParams added in v1.0.0

func NewQueryDelegatorParams(delegatorAddr sdk.AccAddress) QueryDelegatorParams

type QueryHistoricalInfoParams added in v1.0.0

type QueryHistoricalInfoParams struct {
	Height int64
}

QueryHistoricalInfoParams defines the params for the following queries: - 'custom/staking/historicalInfo'

func NewQueryHistoricalInfoParams added in v1.0.0

func NewQueryHistoricalInfoParams(height int64) QueryHistoricalInfoParams

NewQueryHistoricalInfoParams creates a new QueryHistoricalInfoParams instance

type QueryRedelegationParams added in v1.0.0

type QueryRedelegationParams struct {
	DelegatorAddr    sdk.AccAddress
	SrcValidatorAddr sdk.ValAddress
	DstValidatorAddr sdk.ValAddress
}

defines the params for the following queries: - 'custom/staking/redelegation'

func NewQueryRedelegationParams added in v1.0.0

func NewQueryRedelegationParams(delegatorAddr sdk.AccAddress, srcValidatorAddr, dstValidatorAddr sdk.ValAddress) QueryRedelegationParams

type QueryValidatorParams added in v1.0.0

type QueryValidatorParams struct {
	ValidatorAddr sdk.ValAddress
}

defines the params for the following queries: - 'custom/staking/validator' - 'custom/staking/validatorDelegations' - 'custom/staking/validatorUnbondingDelegations' - 'custom/staking/validatorRedelegations'

func NewQueryValidatorParams added in v1.0.0

func NewQueryValidatorParams(validatorAddr sdk.ValAddress) QueryValidatorParams

type QueryValidatorsParams added in v1.0.0

type QueryValidatorsParams struct {
	Page, Limit int
	Status      string
}

QueryValidatorsParams defines the params for the following queries: - 'custom/staking/validators'

func NewQueryValidatorsParams added in v1.0.0

func NewQueryValidatorsParams(page, limit int, status string) QueryValidatorsParams

type Redelegation

type Redelegation struct {
	DelegatorAddress    github_com_cosmos_cosmos_sdk_types.AccAddress `` /* 191-byte string literal not displayed */
	ValidatorSrcAddress github_com_cosmos_cosmos_sdk_types.ValAddress `` /* 206-byte string literal not displayed */
	ValidatorDstAddress github_com_cosmos_cosmos_sdk_types.ValAddress `` /* 206-byte string literal not displayed */
	Entries             []RedelegationEntry                           `protobuf:"bytes,4,rep,name=entries,proto3" json:"entries"`
}

Redelegation contains the list of a particular delegator's redelegating bonds from a particular source validator to a particular destination validator.

func MustUnmarshalRED

func MustUnmarshalRED(cdc codec.Marshaler, value []byte) Redelegation

MustUnmarshalRED unmarshals a redelegation from a store value. Panics if fails.

func NewRedelegation

func NewRedelegation(
	delegatorAddr sdk.AccAddress, validatorSrcAddr, validatorDstAddr sdk.ValAddress,
	creationHeight int64, minTime time.Time, balance sdk.Int, sharesDst sdk.Dec,
) Redelegation

func UnmarshalRED

func UnmarshalRED(cdc codec.Marshaler, value []byte) (red Redelegation, err error)

UnmarshalRED unmarshals a redelegation from a store value

func (*Redelegation) AddEntry

func (red *Redelegation) AddEntry(creationHeight int64, minTime time.Time, balance sdk.Int, sharesDst sdk.Dec)

AddEntry - append entry to the unbonding delegation

func (*Redelegation) Descriptor added in v1.0.0

func (*Redelegation) Descriptor() ([]byte, []int)

func (*Redelegation) Equal

func (this *Redelegation) Equal(that interface{}) bool

func (*Redelegation) GetDelegatorAddress added in v1.0.0

func (*Redelegation) GetEntries added in v1.0.0

func (m *Redelegation) GetEntries() []RedelegationEntry

func (*Redelegation) GetValidatorDstAddress added in v1.0.0

func (m *Redelegation) GetValidatorDstAddress() github_com_cosmos_cosmos_sdk_types.ValAddress

func (*Redelegation) GetValidatorSrcAddress added in v1.0.0

func (m *Redelegation) GetValidatorSrcAddress() github_com_cosmos_cosmos_sdk_types.ValAddress

func (*Redelegation) Marshal added in v1.0.0

func (m *Redelegation) Marshal() (dAtA []byte, err error)

func (*Redelegation) MarshalTo added in v1.0.0

func (m *Redelegation) MarshalTo(dAtA []byte) (int, error)

func (*Redelegation) MarshalToSizedBuffer added in v1.0.0

func (m *Redelegation) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Redelegation) ProtoMessage added in v1.0.0

func (*Redelegation) ProtoMessage()

func (*Redelegation) RemoveEntry

func (red *Redelegation) RemoveEntry(i int64)

RemoveEntry - remove entry at index i to the unbonding delegation

func (*Redelegation) Reset added in v1.0.0

func (m *Redelegation) Reset()

func (*Redelegation) Size added in v1.0.0

func (m *Redelegation) Size() (n int)

func (Redelegation) String

func (red Redelegation) String() string

String returns a human readable string representation of a Redelegation.

func (*Redelegation) Unmarshal added in v1.0.0

func (m *Redelegation) Unmarshal(dAtA []byte) error

func (*Redelegation) XXX_DiscardUnknown added in v1.0.0

func (m *Redelegation) XXX_DiscardUnknown()

func (*Redelegation) XXX_Marshal added in v1.0.0

func (m *Redelegation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Redelegation) XXX_Merge added in v1.0.0

func (m *Redelegation) XXX_Merge(src proto.Message)

func (*Redelegation) XXX_Size added in v1.0.0

func (m *Redelegation) XXX_Size() int

func (*Redelegation) XXX_Unmarshal added in v1.0.0

func (m *Redelegation) XXX_Unmarshal(b []byte) error

type RedelegationEntry

type RedelegationEntry struct {
	CreationHeight int64                                  `` /* 127-byte string literal not displayed */
	CompletionTime time.Time                              `protobuf:"bytes,2,opt,name=completion_time,json=completionTime,proto3,stdtime" json:"completion_time" yaml:"completion_time"`
	InitialBalance github_com_cosmos_cosmos_sdk_types.Int `` /* 168-byte string literal not displayed */
	SharesDst      github_com_cosmos_cosmos_sdk_types.Dec `` /* 130-byte string literal not displayed */
}

RedelegationEntry defines a redelegation object with relevant metadata.

func NewRedelegationEntry

func NewRedelegationEntry(creationHeight int64, completionTime time.Time, balance sdk.Int, sharesDst sdk.Dec) RedelegationEntry

func (*RedelegationEntry) Descriptor added in v1.0.0

func (*RedelegationEntry) Descriptor() ([]byte, []int)

func (*RedelegationEntry) Equal added in v1.0.0

func (this *RedelegationEntry) Equal(that interface{}) bool

func (*RedelegationEntry) GetCompletionTime added in v1.0.0

func (m *RedelegationEntry) GetCompletionTime() time.Time

func (*RedelegationEntry) GetCreationHeight added in v1.0.0

func (m *RedelegationEntry) GetCreationHeight() int64

func (RedelegationEntry) IsMature

func (e RedelegationEntry) IsMature(currentTime time.Time) bool

IsMature - is the current entry mature

func (*RedelegationEntry) Marshal added in v1.0.0

func (m *RedelegationEntry) Marshal() (dAtA []byte, err error)

func (*RedelegationEntry) MarshalTo added in v1.0.0

func (m *RedelegationEntry) MarshalTo(dAtA []byte) (int, error)

func (*RedelegationEntry) MarshalToSizedBuffer added in v1.0.0

func (m *RedelegationEntry) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*RedelegationEntry) ProtoMessage added in v1.0.0

func (*RedelegationEntry) ProtoMessage()

func (*RedelegationEntry) Reset added in v1.0.0

func (m *RedelegationEntry) Reset()

func (*RedelegationEntry) Size added in v1.0.0

func (m *RedelegationEntry) Size() (n int)

func (RedelegationEntry) String added in v1.0.0

func (e RedelegationEntry) String() string

String implements the Stringer interface for a RedelegationEntry object.

func (*RedelegationEntry) Unmarshal added in v1.0.0

func (m *RedelegationEntry) Unmarshal(dAtA []byte) error

func (*RedelegationEntry) XXX_DiscardUnknown added in v1.0.0

func (m *RedelegationEntry) XXX_DiscardUnknown()

func (*RedelegationEntry) XXX_Marshal added in v1.0.0

func (m *RedelegationEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RedelegationEntry) XXX_Merge added in v1.0.0

func (m *RedelegationEntry) XXX_Merge(src proto.Message)

func (*RedelegationEntry) XXX_Size added in v1.0.0

func (m *RedelegationEntry) XXX_Size() int

func (*RedelegationEntry) XXX_Unmarshal added in v1.0.0

func (m *RedelegationEntry) XXX_Unmarshal(b []byte) error

type RedelegationEntryResponse added in v1.0.0

type RedelegationEntryResponse struct {
	RedelegationEntry
	Balance sdk.Int `json:"balance"`
}

RedelegationEntryResponse is equivalent to a RedelegationEntry except that it contains a balance in addition to shares which is more suitable for client responses.

func NewRedelegationEntryResponse added in v1.0.0

func NewRedelegationEntryResponse(
	creationHeight int64, completionTime time.Time, sharesDst sdk.Dec, initialBalance, balance sdk.Int) RedelegationEntryResponse

NewRedelegationEntryResponse creates a new RedelegationEntryResponse instance.

type RedelegationResponse added in v1.0.0

type RedelegationResponse struct {
	Redelegation
	Entries []RedelegationEntryResponse `json:"entries" yaml:"entries"`
}

RedelegationResponse is equivalent to a Redelegation except that its entries contain a balance in addition to shares which is more suitable for client responses.

func NewRedelegationResponse added in v1.0.0

func NewRedelegationResponse(
	delegatorAddr sdk.AccAddress, validatorSrc, validatorDst sdk.ValAddress, entries []RedelegationEntryResponse,
) RedelegationResponse

NewRedelegationResponse crates a new RedelegationEntryResponse instance.

func (RedelegationResponse) MarshalJSON added in v1.0.0

func (r RedelegationResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface. This is so we can achieve a flattened structure while embedding other types.

func (RedelegationResponse) String added in v1.0.0

func (r RedelegationResponse) String() string

String implements the Stringer interface for RedelegationResp.

func (*RedelegationResponse) UnmarshalJSON added in v1.0.0

func (r *RedelegationResponse) UnmarshalJSON(bz []byte) error

UnmarshalJSON implements the json.Unmarshaler interface. This is so we can achieve a flattened structure while embedding other types.

type RedelegationResponses added in v1.0.0

type RedelegationResponses []RedelegationResponse

RedelegationResponses are a collection of RedelegationResp

func (RedelegationResponses) String added in v1.0.0

func (r RedelegationResponses) String() (out string)

type Redelegations

type Redelegations []Redelegation

Redelegations are a collection of Redelegation

func (Redelegations) String

func (d Redelegations) String() (out string)

type StakingHooks added in v1.0.0

type StakingHooks interface {
	AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress)                           // Must be called when a validator is created
	BeforeValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress)                         // Must be called when a validator's state changes
	AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) // Must be called when a validator is deleted

	AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)         // Must be called when a validator is bonded
	AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) // Must be called when a validator begins unbonding

	BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)        // Must be called when a delegation is created
	BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) // Must be called when a delegation's shares are modified
	BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)        // Must be called when a delegation is removed
	AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
	BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec)
}

StakingHooks event hooks for staking validator object (noalias)

type UnbondingDelegation

type UnbondingDelegation struct {
	DelegatorAddress github_com_cosmos_cosmos_sdk_types.AccAddress `` /* 191-byte string literal not displayed */
	ValidatorAddress github_com_cosmos_cosmos_sdk_types.ValAddress `` /* 191-byte string literal not displayed */
	Entries          []UnbondingDelegationEntry                    `protobuf:"bytes,3,rep,name=entries,proto3" json:"entries"`
}

UnbondingDelegation stores all of a single delegator's unbonding bonds for a single validator in an time-ordered list

func MustUnmarshalUBD

func MustUnmarshalUBD(cdc codec.Marshaler, value []byte) UnbondingDelegation

unmarshal a unbonding delegation from a store value

func NewUnbondingDelegation

func NewUnbondingDelegation(
	delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress,
	creationHeight int64, minTime time.Time, balance sdk.Int,
) UnbondingDelegation

NewUnbondingDelegation - create a new unbonding delegation object

func UnmarshalUBD

func UnmarshalUBD(cdc codec.Marshaler, value []byte) (ubd UnbondingDelegation, err error)

unmarshal a unbonding delegation from a store value

func (*UnbondingDelegation) AddEntry

func (ubd *UnbondingDelegation) AddEntry(creationHeight int64, minTime time.Time, balance sdk.Int)

AddEntry - append entry to the unbonding delegation

func (*UnbondingDelegation) Descriptor added in v1.0.0

func (*UnbondingDelegation) Descriptor() ([]byte, []int)

func (*UnbondingDelegation) Equal

func (this *UnbondingDelegation) Equal(that interface{}) bool

func (*UnbondingDelegation) GetDelegatorAddress added in v1.0.0

func (*UnbondingDelegation) GetEntries added in v1.0.0

func (*UnbondingDelegation) GetValidatorAddress added in v1.0.0

func (*UnbondingDelegation) Marshal added in v1.0.0

func (m *UnbondingDelegation) Marshal() (dAtA []byte, err error)

func (*UnbondingDelegation) MarshalTo added in v1.0.0

func (m *UnbondingDelegation) MarshalTo(dAtA []byte) (int, error)

func (*UnbondingDelegation) MarshalToSizedBuffer added in v1.0.0

func (m *UnbondingDelegation) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*UnbondingDelegation) ProtoMessage added in v1.0.0

func (*UnbondingDelegation) ProtoMessage()

func (*UnbondingDelegation) RemoveEntry

func (ubd *UnbondingDelegation) RemoveEntry(i int64)

RemoveEntry - remove entry at index i to the unbonding delegation

func (*UnbondingDelegation) Reset added in v1.0.0

func (m *UnbondingDelegation) Reset()

func (*UnbondingDelegation) Size added in v1.0.0

func (m *UnbondingDelegation) Size() (n int)

func (UnbondingDelegation) String

func (ubd UnbondingDelegation) String() string

String returns a human readable string representation of an UnbondingDelegation.

func (*UnbondingDelegation) Unmarshal added in v1.0.0

func (m *UnbondingDelegation) Unmarshal(dAtA []byte) error

func (*UnbondingDelegation) XXX_DiscardUnknown added in v1.0.0

func (m *UnbondingDelegation) XXX_DiscardUnknown()

func (*UnbondingDelegation) XXX_Marshal added in v1.0.0

func (m *UnbondingDelegation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*UnbondingDelegation) XXX_Merge added in v1.0.0

func (m *UnbondingDelegation) XXX_Merge(src proto.Message)

func (*UnbondingDelegation) XXX_Size added in v1.0.0

func (m *UnbondingDelegation) XXX_Size() int

func (*UnbondingDelegation) XXX_Unmarshal added in v1.0.0

func (m *UnbondingDelegation) XXX_Unmarshal(b []byte) error

type UnbondingDelegationEntry

type UnbondingDelegationEntry struct {
	CreationHeight int64                                  `` /* 127-byte string literal not displayed */
	CompletionTime time.Time                              `protobuf:"bytes,2,opt,name=completion_time,json=completionTime,proto3,stdtime" json:"completion_time" yaml:"completion_time"`
	InitialBalance github_com_cosmos_cosmos_sdk_types.Int `` /* 168-byte string literal not displayed */
	Balance        github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=balance,proto3,customtype=github.com/KiraCore/cosmos-sdk/types.Int" json:"balance"`
}

UnbondingDelegationEntry defines an unbonding object with relevant metadata.

func NewUnbondingDelegationEntry

func NewUnbondingDelegationEntry(creationHeight int64, completionTime time.Time, balance sdk.Int) UnbondingDelegationEntry

func (*UnbondingDelegationEntry) Descriptor added in v1.0.0

func (*UnbondingDelegationEntry) Descriptor() ([]byte, []int)

func (*UnbondingDelegationEntry) Equal added in v1.0.0

func (this *UnbondingDelegationEntry) Equal(that interface{}) bool

func (*UnbondingDelegationEntry) GetCompletionTime added in v1.0.0

func (m *UnbondingDelegationEntry) GetCompletionTime() time.Time

func (*UnbondingDelegationEntry) GetCreationHeight added in v1.0.0

func (m *UnbondingDelegationEntry) GetCreationHeight() int64

func (UnbondingDelegationEntry) IsMature

func (e UnbondingDelegationEntry) IsMature(currentTime time.Time) bool

IsMature - is the current entry mature

func (*UnbondingDelegationEntry) Marshal added in v1.0.0

func (m *UnbondingDelegationEntry) Marshal() (dAtA []byte, err error)

func (*UnbondingDelegationEntry) MarshalTo added in v1.0.0

func (m *UnbondingDelegationEntry) MarshalTo(dAtA []byte) (int, error)

func (*UnbondingDelegationEntry) MarshalToSizedBuffer added in v1.0.0

func (m *UnbondingDelegationEntry) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*UnbondingDelegationEntry) ProtoMessage added in v1.0.0

func (*UnbondingDelegationEntry) ProtoMessage()

func (*UnbondingDelegationEntry) Reset added in v1.0.0

func (m *UnbondingDelegationEntry) Reset()

func (*UnbondingDelegationEntry) Size added in v1.0.0

func (m *UnbondingDelegationEntry) Size() (n int)

func (UnbondingDelegationEntry) String added in v1.0.0

func (e UnbondingDelegationEntry) String() string

String implements the stringer interface for a UnbondingDelegationEntry.

func (*UnbondingDelegationEntry) Unmarshal added in v1.0.0

func (m *UnbondingDelegationEntry) Unmarshal(dAtA []byte) error

func (*UnbondingDelegationEntry) XXX_DiscardUnknown added in v1.0.0

func (m *UnbondingDelegationEntry) XXX_DiscardUnknown()

func (*UnbondingDelegationEntry) XXX_Marshal added in v1.0.0

func (m *UnbondingDelegationEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*UnbondingDelegationEntry) XXX_Merge added in v1.0.0

func (m *UnbondingDelegationEntry) XXX_Merge(src proto.Message)

func (*UnbondingDelegationEntry) XXX_Size added in v1.0.0

func (m *UnbondingDelegationEntry) XXX_Size() int

func (*UnbondingDelegationEntry) XXX_Unmarshal added in v1.0.0

func (m *UnbondingDelegationEntry) XXX_Unmarshal(b []byte) error

type UnbondingDelegations

type UnbondingDelegations []UnbondingDelegation

UnbondingDelegations is a collection of UnbondingDelegation

func (UnbondingDelegations) String

func (ubds UnbondingDelegations) String() (out string)

type Validator

type Validator struct {
	OperatorAddress   github_com_cosmos_cosmos_sdk_types.ValAddress `` /* 187-byte string literal not displayed */
	ConsensusPubkey   string                                        `` /* 130-byte string literal not displayed */
	Jailed            bool                                          `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed,omitempty"`
	Status            github_com_cosmos_cosmos_sdk_types.BondStatus `protobuf:"varint,4,opt,name=status,proto3,casttype=github.com/KiraCore/cosmos-sdk/types.BondStatus" json:"status,omitempty"`
	Tokens            github_com_cosmos_cosmos_sdk_types.Int        `protobuf:"bytes,5,opt,name=tokens,proto3,customtype=github.com/KiraCore/cosmos-sdk/types.Int" json:"tokens"`
	DelegatorShares   github_com_cosmos_cosmos_sdk_types.Dec        `` /* 172-byte string literal not displayed */
	Description       Description                                   `protobuf:"bytes,7,opt,name=description,proto3" json:"description"`
	UnbondingHeight   int64                                         `` /* 131-byte string literal not displayed */
	UnbondingTime     time.Time                                     `protobuf:"bytes,9,opt,name=unbonding_time,json=unbondingTime,proto3,stdtime" json:"unbonding_time" yaml:"unbonding_time"`
	Commission        Commission                                    `protobuf:"bytes,10,opt,name=commission,proto3" json:"commission"`
	MinSelfDelegation github_com_cosmos_cosmos_sdk_types.Int        `` /* 184-byte string literal not displayed */
}

Validator defines the total amount of bond shares and their exchange rate to coins. Slashing results in a decrease in the exchange rate, allowing correct calculation of future undelegations without iterating over delegators. 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 bonded shares multiplied by exchange rate.

func MustUnmarshalValidator

func MustUnmarshalValidator(cdc codec.Marshaler, value []byte) Validator

unmarshal a redelegation from a store value

func NewValidator

func NewValidator(operator sdk.ValAddress, pubKey crypto.PubKey, description Description) Validator

func UnmarshalValidator

func UnmarshalValidator(cdc codec.Marshaler, value []byte) (v Validator, err error)

unmarshal a redelegation from a store value

func (Validator) ABCIValidatorUpdate

func (v Validator) ABCIValidatorUpdate() abci.ValidatorUpdate

ABCIValidatorUpdate returns an abci.ValidatorUpdate from a staking validator type with the full validator power

func (Validator) ABCIValidatorUpdateZero

func (v Validator) ABCIValidatorUpdateZero() abci.ValidatorUpdate

ABCIValidatorUpdateZero returns an abci.ValidatorUpdate from a staking validator type with zero power used for validator updates.

func (Validator) AddTokensFromDel

func (v Validator) AddTokensFromDel(amount sdk.Int) (Validator, sdk.Dec)

AddTokensFromDel adds tokens to a validator

func (Validator) BondedTokens

func (v Validator) BondedTokens() sdk.Int

get the bonded tokens which the validator holds

func (Validator) ConsensusPower added in v1.0.0

func (v Validator) ConsensusPower() int64

get the consensus-engine power a reduction of 10^6 from validator tokens is applied

func (*Validator) Descriptor added in v1.0.0

func (*Validator) Descriptor() ([]byte, []int)

func (*Validator) Equal

func (this *Validator) Equal(that interface{}) bool

func (Validator) GetBondedTokens added in v0.31.0

func (v Validator) GetBondedTokens() sdk.Int

func (Validator) GetCommission

func (v Validator) GetCommission() sdk.Dec

func (Validator) GetConsAddr

func (v Validator) GetConsAddr() sdk.ConsAddress

func (Validator) GetConsPubKey

func (v Validator) GetConsPubKey() crypto.PubKey

func (Validator) GetConsensusPower added in v1.0.0

func (v Validator) GetConsensusPower() int64

func (Validator) GetDelegatorShares

func (v Validator) GetDelegatorShares() sdk.Dec

func (Validator) GetMinSelfDelegation added in v0.31.0

func (v Validator) GetMinSelfDelegation() sdk.Int

func (Validator) GetMoniker

func (v Validator) GetMoniker() string

func (Validator) GetOperator

func (v Validator) GetOperator() sdk.ValAddress

func (Validator) GetStatus

func (v Validator) GetStatus() sdk.BondStatus

func (Validator) GetTokens

func (v Validator) GetTokens() sdk.Int

func (Validator) InvalidExRate added in v0.33.0

func (v Validator) InvalidExRate() bool

In some situations, the exchange rate becomes invalid, e.g. if Validator loses all tokens due to slashing. In this case, make all future delegations invalid.

func (Validator) IsBonded added in v1.0.0

func (v Validator) IsBonded() bool

IsBonded checks if the validator status equals Bonded

func (Validator) IsJailed added in v1.0.0

func (v Validator) IsJailed() bool

func (Validator) IsUnbonded added in v1.0.0

func (v Validator) IsUnbonded() bool

IsUnbonded checks if the validator status equals Unbonded

func (Validator) IsUnbonding added in v1.0.0

func (v Validator) IsUnbonding() bool

IsUnbonding checks if the validator status equals Unbonding

func (*Validator) Marshal added in v1.0.0

func (m *Validator) Marshal() (dAtA []byte, err error)

func (*Validator) MarshalTo added in v1.0.0

func (m *Validator) MarshalTo(dAtA []byte) (int, error)

func (*Validator) MarshalToSizedBuffer added in v1.0.0

func (m *Validator) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (Validator) MinEqual added in v1.0.0

func (v Validator) MinEqual(other Validator) bool

MinEqual defines a more minimum set of equality conditions when comparing two validators.

func (Validator) PotentialConsensusPower added in v1.0.0

func (v Validator) PotentialConsensusPower() int64

potential consensus-engine power

func (*Validator) ProtoMessage added in v1.0.0

func (*Validator) ProtoMessage()

func (Validator) RemoveDelShares

func (v Validator) RemoveDelShares(delShares sdk.Dec) (Validator, sdk.Int)

RemoveDelShares removes delegator shares from a validator. NOTE: because token fractions are left in the valiadator,

the exchange rate of future shares of this validator can increase.

func (Validator) RemoveTokens

func (v Validator) RemoveTokens(tokens sdk.Int) Validator

RemoveTokens removes tokens from a validator

func (*Validator) Reset added in v1.0.0

func (m *Validator) Reset()

func (Validator) SetInitialCommission

func (v Validator) SetInitialCommission(commission Commission) (Validator, error)

SetInitialCommission attempts to set a validator's initial commission. An error is returned if the commission is invalid.

func (Validator) SharesFromTokens added in v1.0.0

func (v Validator) SharesFromTokens(amt sdk.Int) (sdk.Dec, error)

SharesFromTokens returns the shares of a delegation given a bond amount. It returns an error if the validator has no tokens.

func (Validator) SharesFromTokensTruncated added in v1.0.0

func (v Validator) SharesFromTokensTruncated(amt sdk.Int) (sdk.Dec, error)

SharesFromTokensTruncated returns the truncated shares of a delegation given a bond amount. It returns an error if the validator has no tokens.

func (*Validator) Size added in v1.0.0

func (m *Validator) Size() (n int)

func (Validator) String

func (v Validator) String() string

String implements the Stringer interface for a Validator object.

func (Validator) ToTmValidator added in v1.0.0

func (v Validator) ToTmValidator() *tmtypes.Validator

ToTmValidator casts an SDK validator to a tendermint type Validator.

func (Validator) TokensFromShares added in v1.0.0

func (v Validator) TokensFromShares(shares sdk.Dec) sdk.Dec

calculate the token worth of provided shares

func (Validator) TokensFromSharesRoundUp added in v1.0.0

func (v Validator) TokensFromSharesRoundUp(shares sdk.Dec) sdk.Dec

TokensFromSharesRoundUp returns the token worth of provided shares, rounded up.

func (Validator) TokensFromSharesTruncated added in v1.0.0

func (v Validator) TokensFromSharesTruncated(shares sdk.Dec) sdk.Dec

calculate the token worth of provided shares, truncated

func (*Validator) Unmarshal added in v1.0.0

func (m *Validator) Unmarshal(dAtA []byte) error

func (Validator) UpdateStatus

func (v Validator) UpdateStatus(newStatus sdk.BondStatus) Validator

UpdateStatus updates the location of the shares within a validator to reflect the new status

func (*Validator) XXX_DiscardUnknown added in v1.0.0

func (m *Validator) XXX_DiscardUnknown()

func (*Validator) XXX_Marshal added in v1.0.0

func (m *Validator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Validator) XXX_Merge added in v1.0.0

func (m *Validator) XXX_Merge(src proto.Message)

func (*Validator) XXX_Size added in v1.0.0

func (m *Validator) XXX_Size() int

func (*Validator) XXX_Unmarshal added in v1.0.0

func (m *Validator) XXX_Unmarshal(b []byte) error

type ValidatorSet added in v1.0.0

type ValidatorSet interface {
	// iterate through validators by operator address, execute func for each validator
	IterateValidators(sdk.Context,
		func(index int64, validator stakingexported.ValidatorI) (stop bool))

	// iterate through bonded validators by operator address, execute func for each validator
	IterateBondedValidatorsByPower(sdk.Context,
		func(index int64, validator stakingexported.ValidatorI) (stop bool))

	// iterate through the consensus validator set of the last block by operator address, execute func for each validator
	IterateLastValidators(sdk.Context,
		func(index int64, validator stakingexported.ValidatorI) (stop bool))

	Validator(sdk.Context, sdk.ValAddress) stakingexported.ValidatorI            // get a particular validator by operator address
	ValidatorByConsAddr(sdk.Context, sdk.ConsAddress) stakingexported.ValidatorI // get a particular validator by consensus address
	TotalBondedTokens(sdk.Context) sdk.Int                                       // total bonded tokens within the validator set
	StakingTokenSupply(sdk.Context) sdk.Int                                      // total staking token supply

	// slash the validator and delegators of the validator, specifying offence height, offence power, and slash fraction
	Slash(sdk.Context, sdk.ConsAddress, int64, int64, sdk.Dec)
	Jail(sdk.Context, sdk.ConsAddress)   // jail a validator
	Unjail(sdk.Context, sdk.ConsAddress) // unjail a validator

	// Delegation allows for getting a particular delegation for a given validator
	// and delegator outside the scope of the staking module.
	Delegation(sdk.Context, sdk.AccAddress, sdk.ValAddress) stakingexported.DelegationI

	// MaxValidators returns the maximum amount of bonded validators
	MaxValidators(sdk.Context) uint32
}

ValidatorSet expected properties for the set of all validators (noalias)

type Validators

type Validators []Validator

Validators is a collection of Validator

func (Validators) Len added in v1.0.0

func (v Validators) Len() int

Implements sort interface

func (Validators) Less added in v1.0.0

func (v Validators) Less(i, j int) bool

Implements sort interface

func (Validators) Sort added in v1.0.0

func (v Validators) Sort()

Sort Validators sorts validator array in ascending operator address order

func (Validators) String

func (v Validators) String() (out string)

func (Validators) Swap added in v1.0.0

func (v Validators) Swap(i, j int)

Implements sort interface

func (Validators) ToSDKValidators added in v0.32.0

func (v Validators) ToSDKValidators() (validators []exported.ValidatorI)

ToSDKValidators - convenience function convert []Validators to []sdk.Validators

func (Validators) ToTmValidators added in v1.0.0

func (v Validators) ToTmValidators() []*tmtypes.Validator

ToTmValidators casts all validators to the corresponding tendermint type.

Jump to

Keyboard shortcuts

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