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: 19 Imported by: 0

Documentation

Overview

nolint

Index

Constants

View Source
const (
	EventTypeSetWithdrawAddress = "set_withdraw_address"
	EventTypeRewards            = "rewards"
	EventTypeCommission         = "commission"
	EventTypeWithdrawRewards    = "withdraw_rewards"
	EventTypeWithdrawCommission = "withdraw_commission"
	EventTypeProposerReward     = "proposer_reward"

	AttributeKeyWithdrawAddress = "withdraw_address"
	AttributeKeyValidator       = "validator"

	AttributeValueCategory = ModuleName
)

distribution module event types

View Source
const (
	// ModuleName is the module name constant used in many places
	ModuleName = "distribution"

	// StoreKey is the store key string for distribution
	StoreKey = ModuleName

	// RouterKey is the message route for distribution
	RouterKey = ModuleName

	// QuerierRoute is the querier route for distribution
	QuerierRoute = ModuleName
)
View Source
const (
	QueryParams                      = "params"
	QueryValidatorOutstandingRewards = "validator_outstanding_rewards"
	QueryValidatorCommission         = "validator_commission"
	QueryValidatorSlashes            = "validator_slashes"
	QueryDelegationRewards           = "delegation_rewards"
	QueryDelegatorTotalRewards       = "delegator_total_rewards"
	QueryDelegatorValidators         = "delegator_validators"
	QueryWithdrawAddr                = "withdraw_addr"
	QueryCommunityPool               = "community_pool"
)

querier keys

View Source
const (
	// default paramspace for params keeper
	DefaultParamspace = ModuleName
)
View Source
const (
	// ProposalTypeCommunityPoolSpend defines the type for a CommunityPoolSpendProposal
	ProposalTypeCommunityPoolSpend = "CommunityPoolSpend"
)
View Source
const TypeMsgFundCommunityPool = "fund_community_pool"

Variables

View Source
var (
	ErrEmptyDelegatorAddr      = sdkerrors.Register(ModuleName, 2, "delegator address is empty")
	ErrEmptyWithdrawAddr       = sdkerrors.Register(ModuleName, 3, "withdraw address is empty")
	ErrEmptyValidatorAddr      = sdkerrors.Register(ModuleName, 4, "validator address is empty")
	ErrEmptyDelegationDistInfo = sdkerrors.Register(ModuleName, 5, "no delegation distribution info")
	ErrNoValidatorDistInfo     = sdkerrors.Register(ModuleName, 6, "no validator distribution info")
	ErrNoValidatorCommission   = sdkerrors.Register(ModuleName, 7, "no validator commission to withdraw")
	ErrSetWithdrawAddrDisabled = sdkerrors.Register(ModuleName, 8, "set withdraw address disabled")
	ErrBadDistribution         = sdkerrors.Register(ModuleName, 9, "community pool does not have sufficient coins to distribute")
	ErrInvalidProposalAmount   = sdkerrors.Register(ModuleName, 10, "invalid community pool spend proposal amount")
	ErrEmptyProposalRecipient  = sdkerrors.Register(ModuleName, 11, "invalid community pool spend proposal recipient")
	ErrNoValidatorExists       = sdkerrors.Register(ModuleName, 12, "validator does not exist")
	ErrNoDelegationExists      = sdkerrors.Register(ModuleName, 13, "delegation does not exist")
)

x/distribution module sentinel errors

View Source
var (
	FeePoolKey                        = []byte{0x00} // key for global distribution state
	ProposerKey                       = []byte{0x01} // key for the proposer operator address
	ValidatorOutstandingRewardsPrefix = []byte{0x02} // key for outstanding rewards

	DelegatorWithdrawAddrPrefix          = []byte{0x03} // key for delegator withdraw address
	DelegatorStartingInfoPrefix          = []byte{0x04} // key for delegator starting info
	ValidatorHistoricalRewardsPrefix     = []byte{0x05} // key for historical validators rewards / stake
	ValidatorCurrentRewardsPrefix        = []byte{0x06} // key for current validator rewards
	ValidatorAccumulatedCommissionPrefix = []byte{0x07} // key for accumulated validator commission
	ValidatorSlashEventPrefix            = []byte{0x08} // key for validator slash fraction
)

Keys for distribution store Items are stored with the following key: values

- 0x00<proposalID_Bytes>: FeePol

- 0x01: sdk.ConsAddress

- 0x02<valAddr_Bytes>: ValidatorOutstandingRewards

- 0x03<accAddr_Bytes>: sdk.AccAddress

- 0x04<valAddr_Bytes><accAddr_Bytes>: DelegatorStartingInfo

- 0x05<valAddr_Bytes><period_Bytes>: ValidatorHistoricalRewards

- 0x06<valAddr_Bytes>: ValidatorCurrentRewards

- 0x07<valAddr_Bytes>: ValidatorCurrentRewards

- 0x08<valAddr_Bytes><height>: ValidatorSlashEvent

View Source
var (
	ParamStoreKeyCommunityTax        = []byte("communitytax")
	ParamStoreKeyBaseProposerReward  = []byte("baseproposerreward")
	ParamStoreKeyBonusProposerReward = []byte("bonusproposerreward")
	ParamStoreKeyWithdrawAddrEnabled = []byte("withdrawaddrenabled")
)

Parameter keys

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/distribution 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/distribution and
	// defined at the application level.
	ModuleCdc = codec.NewHybridCodec(amino, types.NewInterfaceRegistry())
)

Functions

func GetDelegatorStartingInfoAddresses added in v1.0.0

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

gets the addresses from a delegator starting info key

func GetDelegatorStartingInfoKey added in v1.0.0

func GetDelegatorStartingInfoKey(v sdk.ValAddress, d sdk.AccAddress) []byte

gets the key for a delegator's starting info

func GetDelegatorWithdrawAddrKey added in v1.0.0

func GetDelegatorWithdrawAddrKey(delAddr sdk.AccAddress) []byte

gets the key for a delegator's withdraw addr

func GetDelegatorWithdrawInfoAddress added in v1.0.0

func GetDelegatorWithdrawInfoAddress(key []byte) (delAddr sdk.AccAddress)

gets an address from a delegator's withdraw info key

func GetValidatorAccumulatedCommissionAddress added in v1.0.0

func GetValidatorAccumulatedCommissionAddress(key []byte) (valAddr sdk.ValAddress)

gets the address from a validator's accumulated commission key

func GetValidatorAccumulatedCommissionKey added in v1.0.0

func GetValidatorAccumulatedCommissionKey(v sdk.ValAddress) []byte

gets the key for a validator's current commission

func GetValidatorCurrentRewardsAddress added in v1.0.0

func GetValidatorCurrentRewardsAddress(key []byte) (valAddr sdk.ValAddress)

gets the address from a validator's current rewards key

func GetValidatorCurrentRewardsKey added in v1.0.0

func GetValidatorCurrentRewardsKey(v sdk.ValAddress) []byte

gets the key for a validator's current rewards

func GetValidatorHistoricalRewardsAddressPeriod added in v1.0.0

func GetValidatorHistoricalRewardsAddressPeriod(key []byte) (valAddr sdk.ValAddress, period uint64)

gets the address & period from a validator's historical rewards key

func GetValidatorHistoricalRewardsKey added in v1.0.0

func GetValidatorHistoricalRewardsKey(v sdk.ValAddress, k uint64) []byte

gets the key for a validator's historical rewards

func GetValidatorHistoricalRewardsPrefix added in v1.0.0

func GetValidatorHistoricalRewardsPrefix(v sdk.ValAddress) []byte

gets the prefix key for a validator's historical rewards

func GetValidatorOutstandingRewardsAddress added in v1.0.0

func GetValidatorOutstandingRewardsAddress(key []byte) (valAddr sdk.ValAddress)

gets an address from a validator's outstanding rewards key

func GetValidatorOutstandingRewardsKey added in v1.0.0

func GetValidatorOutstandingRewardsKey(valAddr sdk.ValAddress) []byte

gets the outstanding rewards key for a validator

func GetValidatorSlashEventAddressHeight added in v1.0.0

func GetValidatorSlashEventAddressHeight(key []byte) (valAddr sdk.ValAddress, height uint64)

gets the height from a validator's slash event key

func GetValidatorSlashEventKey added in v1.0.0

func GetValidatorSlashEventKey(v sdk.ValAddress, height, period uint64) []byte

gets the key for a validator's slash fraction

func GetValidatorSlashEventKeyPrefix added in v1.0.0

func GetValidatorSlashEventKeyPrefix(v sdk.ValAddress, height uint64) []byte

gets the prefix key for a validator's slash fraction (ValidatorSlashEventPrefix + height)

func GetValidatorSlashEventPrefix added in v1.0.0

func GetValidatorSlashEventPrefix(v sdk.ValAddress) []byte

gets the prefix key for a validator's slash fractions

func ParamKeyTable added in v1.0.0

func ParamKeyTable() paramtypes.KeyTable

ParamKeyTable returns the parameter key table.

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

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

func ValidateGenesis added in v0.28.0

func ValidateGenesis(gs GenesisState) error

ValidateGenesis validates the genesis state of distribution genesis input

Types

type AccountKeeper added in v1.0.0

type AccountKeeper interface {
	GetAccount(ctx sdk.Context, addr sdk.AccAddress) authexported.Account

	GetModuleAddress(name string) sdk.AccAddress
	GetModuleAccount(ctx sdk.Context, name 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 used for simulations (noalias)

type BankKeeper

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

	SendCoinsFromModuleToModule(ctx sdk.Context, senderModule string, recipientModule string, amt sdk.Coins) error
	SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
	SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error
}

BankKeeper defines the expected interface needed to retrieve account balances.

type CommunityPoolSpendProposal added in v1.0.0

type CommunityPoolSpendProposal struct {
	Title       string                                        `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
	Description string                                        `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	Recipient   github_com_cosmos_cosmos_sdk_types.AccAddress `` /* 128-byte string literal not displayed */
	Amount      github_com_cosmos_cosmos_sdk_types.Coins      `protobuf:"bytes,4,rep,name=amount,proto3,castrepeated=github.com/KiraCore/cosmos-sdk/types.Coins" json:"amount"`
}

CommunityPoolSpendProposal spends from the community pool

func NewCommunityPoolSpendProposal added in v1.0.0

func NewCommunityPoolSpendProposal(title, description string, recipient sdk.AccAddress, amount sdk.Coins) *CommunityPoolSpendProposal

NewCommunityPoolSpendProposal creates a new community pool spned proposal.

func (*CommunityPoolSpendProposal) Descriptor added in v1.0.0

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

func (*CommunityPoolSpendProposal) Equal added in v1.0.0

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

func (*CommunityPoolSpendProposal) GetDescription added in v1.0.0

func (csp *CommunityPoolSpendProposal) GetDescription() string

GetDescription returns the description of a community pool spend proposal.

func (*CommunityPoolSpendProposal) GetTitle added in v1.0.0

func (csp *CommunityPoolSpendProposal) GetTitle() string

GetTitle returns the title of a community pool spend proposal.

func (*CommunityPoolSpendProposal) Marshal added in v1.0.0

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

func (*CommunityPoolSpendProposal) MarshalTo added in v1.0.0

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

func (*CommunityPoolSpendProposal) MarshalToSizedBuffer added in v1.0.0

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

func (*CommunityPoolSpendProposal) ProposalRoute added in v1.0.0

func (csp *CommunityPoolSpendProposal) ProposalRoute() string

GetDescription returns the routing key of a community pool spend proposal.

func (*CommunityPoolSpendProposal) ProposalType added in v1.0.0

func (csp *CommunityPoolSpendProposal) ProposalType() string

ProposalType returns the type of a community pool spend proposal.

func (*CommunityPoolSpendProposal) ProtoMessage added in v1.0.0

func (*CommunityPoolSpendProposal) ProtoMessage()

func (*CommunityPoolSpendProposal) Reset added in v1.0.0

func (m *CommunityPoolSpendProposal) Reset()

func (*CommunityPoolSpendProposal) Size added in v1.0.0

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

func (CommunityPoolSpendProposal) String added in v1.0.0

func (csp CommunityPoolSpendProposal) String() string

String implements the Stringer interface.

func (*CommunityPoolSpendProposal) Unmarshal added in v1.0.0

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

func (*CommunityPoolSpendProposal) ValidateBasic added in v1.0.0

func (csp *CommunityPoolSpendProposal) ValidateBasic() error

ValidateBasic runs basic stateless validity checks

func (*CommunityPoolSpendProposal) XXX_DiscardUnknown added in v1.0.0

func (m *CommunityPoolSpendProposal) XXX_DiscardUnknown()

func (*CommunityPoolSpendProposal) XXX_Marshal added in v1.0.0

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

func (*CommunityPoolSpendProposal) XXX_Merge added in v1.0.0

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

func (*CommunityPoolSpendProposal) XXX_Size added in v1.0.0

func (m *CommunityPoolSpendProposal) XXX_Size() int

func (*CommunityPoolSpendProposal) XXX_Unmarshal added in v1.0.0

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

type DelegationDelegatorReward added in v1.0.0

type DelegationDelegatorReward struct {
	ValidatorAddress sdk.ValAddress `json:"validator_address" yaml:"validator_address"`
	Reward           sdk.DecCoins   `json:"reward" yaml:"reward"`
}

DelegationDelegatorReward defines the properties of a delegator's delegation reward.

func NewDelegationDelegatorReward added in v1.0.0

func NewDelegationDelegatorReward(valAddr sdk.ValAddress,
	reward sdk.DecCoins) DelegationDelegatorReward

NewDelegationDelegatorReward constructs a DelegationDelegatorReward.

type DelegatorStartingInfo added in v0.30.0

type DelegatorStartingInfo struct {
	PreviousPeriod uint64                                 `` /* 127-byte string literal not displayed */
	Stake          github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=stake,proto3,customtype=github.com/KiraCore/cosmos-sdk/types.Dec" json:"stake" yaml:"stake"`
	Height         uint64                                 `protobuf:"varint,3,opt,name=height,proto3" json:"creation_height" yaml:"creation_height"`
}

starting info for a delegator reward period tracks the previous validator period, the delegation's amount of staking token, and the creation height (to check later on if any slashes have occurred) NOTE that even though validators are slashed to whole staking tokens, the delegators within the validator may be left with less than a full token, thus sdk.Dec is used

func NewDelegatorStartingInfo added in v0.30.0

func NewDelegatorStartingInfo(previousPeriod uint64, stake sdk.Dec, height uint64) DelegatorStartingInfo

create a new DelegatorStartingInfo

func (*DelegatorStartingInfo) Descriptor added in v1.0.0

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

func (*DelegatorStartingInfo) Equal added in v1.0.0

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

func (*DelegatorStartingInfo) GetHeight added in v1.0.0

func (m *DelegatorStartingInfo) GetHeight() uint64

func (*DelegatorStartingInfo) GetPreviousPeriod added in v1.0.0

func (m *DelegatorStartingInfo) GetPreviousPeriod() uint64

func (*DelegatorStartingInfo) Marshal added in v1.0.0

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

func (*DelegatorStartingInfo) MarshalTo added in v1.0.0

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

func (*DelegatorStartingInfo) MarshalToSizedBuffer added in v1.0.0

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

func (*DelegatorStartingInfo) ProtoMessage added in v1.0.0

func (*DelegatorStartingInfo) ProtoMessage()

func (*DelegatorStartingInfo) Reset added in v1.0.0

func (m *DelegatorStartingInfo) Reset()

func (*DelegatorStartingInfo) Size added in v1.0.0

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

func (*DelegatorStartingInfo) String added in v1.0.0

func (m *DelegatorStartingInfo) String() string

func (*DelegatorStartingInfo) Unmarshal added in v1.0.0

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

func (*DelegatorStartingInfo) XXX_DiscardUnknown added in v1.0.0

func (m *DelegatorStartingInfo) XXX_DiscardUnknown()

func (*DelegatorStartingInfo) XXX_Marshal added in v1.0.0

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

func (*DelegatorStartingInfo) XXX_Merge added in v1.0.0

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

func (*DelegatorStartingInfo) XXX_Size added in v1.0.0

func (m *DelegatorStartingInfo) XXX_Size() int

func (*DelegatorStartingInfo) XXX_Unmarshal added in v1.0.0

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

type DelegatorStartingInfoRecord added in v0.30.0

type DelegatorStartingInfoRecord struct {
	DelegatorAddress sdk.AccAddress        `json:"delegator_address" yaml:"delegator_address"`
	ValidatorAddress sdk.ValAddress        `json:"validator_address" yaml:"validator_address"`
	StartingInfo     DelegatorStartingInfo `json:"starting_info" yaml:"starting_info"`
}

used for import / export via genesis json

type DelegatorWithdrawInfo

type DelegatorWithdrawInfo struct {
	DelegatorAddress sdk.AccAddress `json:"delegator_address" yaml:"delegator_address"`
	WithdrawAddress  sdk.AccAddress `json:"withdraw_address" yaml:"withdraw_address"`
}

the address for where distributions rewards are withdrawn to by default this struct is only used at genesis to feed in default withdraw addresses

type FeePool

type FeePool struct {
	CommunityPool github_com_cosmos_cosmos_sdk_types.DecCoins `` /* 171-byte string literal not displayed */
}

global fee pool for distribution

func InitialFeePool

func InitialFeePool() FeePool

zero fee pool

func (*FeePool) Descriptor added in v1.0.0

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

func (*FeePool) Equal added in v1.0.0

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

func (*FeePool) GetCommunityPool added in v1.0.0

func (m *FeePool) GetCommunityPool() github_com_cosmos_cosmos_sdk_types.DecCoins

func (*FeePool) Marshal added in v1.0.0

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

func (*FeePool) MarshalTo added in v1.0.0

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

func (*FeePool) MarshalToSizedBuffer added in v1.0.0

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

func (*FeePool) ProtoMessage added in v1.0.0

func (*FeePool) ProtoMessage()

func (*FeePool) Reset added in v1.0.0

func (m *FeePool) Reset()

func (*FeePool) Size added in v1.0.0

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

func (*FeePool) String added in v1.0.0

func (m *FeePool) String() string

func (*FeePool) Unmarshal added in v1.0.0

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

func (FeePool) ValidateGenesis added in v0.28.0

func (f FeePool) ValidateGenesis() error

ValidateGenesis validates the fee pool for a genesis state

func (*FeePool) XXX_DiscardUnknown added in v1.0.0

func (m *FeePool) XXX_DiscardUnknown()

func (*FeePool) XXX_Marshal added in v1.0.0

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

func (*FeePool) XXX_Merge added in v1.0.0

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

func (*FeePool) XXX_Size added in v1.0.0

func (m *FeePool) XXX_Size() int

func (*FeePool) XXX_Unmarshal added in v1.0.0

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

type GenesisState

type GenesisState struct {
	Params                          Params                                 `json:"params" yaml:"params"`
	FeePool                         FeePool                                `json:"fee_pool" yaml:"fee_pool"`
	DelegatorWithdrawInfos          []DelegatorWithdrawInfo                `json:"delegator_withdraw_infos" yaml:"delegator_withdraw_infos"`
	PreviousProposer                sdk.ConsAddress                        `json:"previous_proposer" yaml:"previous_proposer"`
	OutstandingRewards              []ValidatorOutstandingRewardsRecord    `json:"outstanding_rewards" yaml:"outstanding_rewards"`
	ValidatorAccumulatedCommissions []ValidatorAccumulatedCommissionRecord `json:"validator_accumulated_commissions" yaml:"validator_accumulated_commissions"`
	ValidatorHistoricalRewards      []ValidatorHistoricalRewardsRecord     `json:"validator_historical_rewards" yaml:"validator_historical_rewards"`
	ValidatorCurrentRewards         []ValidatorCurrentRewardsRecord        `json:"validator_current_rewards" yaml:"validator_current_rewards"`
	DelegatorStartingInfos          []DelegatorStartingInfoRecord          `json:"delegator_starting_infos" yaml:"delegator_starting_infos"`
	ValidatorSlashEvents            []ValidatorSlashEventRecord            `json:"validator_slash_events" yaml:"validator_slash_events"`
}

GenesisState - all distribution state that must be provided at genesis

func DefaultGenesisState

func DefaultGenesisState() GenesisState

get raw genesis raw message for testing

type MsgFundCommunityPool added in v1.0.0

type MsgFundCommunityPool struct {
	Amount    github_com_cosmos_cosmos_sdk_types.Coins      `protobuf:"bytes,1,rep,name=amount,proto3,castrepeated=github.com/KiraCore/cosmos-sdk/types.Coins" json:"amount"`
	Depositor github_com_cosmos_cosmos_sdk_types.AccAddress `` /* 128-byte string literal not displayed */
}

MsgFundCommunityPool defines a Msg type that allows an account to directly fund the community pool.

func NewMsgFundCommunityPool added in v1.0.0

func NewMsgFundCommunityPool(amount sdk.Coins, depositor sdk.AccAddress) MsgFundCommunityPool

NewMsgFundCommunityPool returns a new MsgFundCommunityPool with a sender and a funding amount.

func (*MsgFundCommunityPool) Descriptor added in v1.0.0

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

func (*MsgFundCommunityPool) Equal added in v1.0.0

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

func (*MsgFundCommunityPool) GetAmount added in v1.0.0

func (*MsgFundCommunityPool) GetDepositor added in v1.0.0

func (MsgFundCommunityPool) GetSignBytes added in v1.0.0

func (msg MsgFundCommunityPool) GetSignBytes() []byte

GetSignBytes returns the raw bytes for a MsgFundCommunityPool message that the expected signer needs to sign.

func (MsgFundCommunityPool) GetSigners added in v1.0.0

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

GetSigners returns the signer addresses that are expected to sign the result of GetSignBytes.

func (*MsgFundCommunityPool) Marshal added in v1.0.0

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

func (*MsgFundCommunityPool) MarshalTo added in v1.0.0

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

func (*MsgFundCommunityPool) MarshalToSizedBuffer added in v1.0.0

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

func (*MsgFundCommunityPool) ProtoMessage added in v1.0.0

func (*MsgFundCommunityPool) ProtoMessage()

func (*MsgFundCommunityPool) Reset added in v1.0.0

func (m *MsgFundCommunityPool) Reset()

func (MsgFundCommunityPool) Route added in v1.0.0

func (msg MsgFundCommunityPool) Route() string

Route returns the MsgFundCommunityPool message route.

func (*MsgFundCommunityPool) Size added in v1.0.0

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

func (*MsgFundCommunityPool) String added in v1.0.0

func (m *MsgFundCommunityPool) String() string

func (MsgFundCommunityPool) Type added in v1.0.0

func (msg MsgFundCommunityPool) Type() string

Type returns the MsgFundCommunityPool message type.

func (*MsgFundCommunityPool) Unmarshal added in v1.0.0

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

func (MsgFundCommunityPool) ValidateBasic added in v1.0.0

func (msg MsgFundCommunityPool) ValidateBasic() error

ValidateBasic performs basic MsgFundCommunityPool message validation.

func (*MsgFundCommunityPool) XXX_DiscardUnknown added in v1.0.0

func (m *MsgFundCommunityPool) XXX_DiscardUnknown()

func (*MsgFundCommunityPool) XXX_Marshal added in v1.0.0

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

func (*MsgFundCommunityPool) XXX_Merge added in v1.0.0

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

func (*MsgFundCommunityPool) XXX_Size added in v1.0.0

func (m *MsgFundCommunityPool) XXX_Size() int

func (*MsgFundCommunityPool) XXX_Unmarshal added in v1.0.0

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

type MsgSetWithdrawAddress

type MsgSetWithdrawAddress struct {
	DelegatorAddress github_com_cosmos_cosmos_sdk_types.AccAddress `` /* 191-byte string literal not displayed */
	WithdrawAddress  github_com_cosmos_cosmos_sdk_types.AccAddress `` /* 187-byte string literal not displayed */
}

msg struct for changing the withdraw address for a delegator (or validator self-delegation)

func NewMsgSetWithdrawAddress

func NewMsgSetWithdrawAddress(delAddr, withdrawAddr sdk.AccAddress) MsgSetWithdrawAddress

func (*MsgSetWithdrawAddress) Descriptor added in v1.0.0

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

func (*MsgSetWithdrawAddress) Equal added in v1.0.0

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

func (*MsgSetWithdrawAddress) GetDelegatorAddress added in v1.0.0

func (MsgSetWithdrawAddress) GetSignBytes

func (msg MsgSetWithdrawAddress) GetSignBytes() []byte

get the bytes for the message signer to sign on

func (MsgSetWithdrawAddress) GetSigners

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

Return address that must sign over msg.GetSignBytes()

func (*MsgSetWithdrawAddress) GetWithdrawAddress added in v1.0.0

func (*MsgSetWithdrawAddress) Marshal added in v1.0.0

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

func (*MsgSetWithdrawAddress) MarshalTo added in v1.0.0

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

func (*MsgSetWithdrawAddress) MarshalToSizedBuffer added in v1.0.0

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

func (*MsgSetWithdrawAddress) ProtoMessage added in v1.0.0

func (*MsgSetWithdrawAddress) ProtoMessage()

func (*MsgSetWithdrawAddress) Reset added in v1.0.0

func (m *MsgSetWithdrawAddress) Reset()

func (MsgSetWithdrawAddress) Route

func (msg MsgSetWithdrawAddress) Route() string

func (*MsgSetWithdrawAddress) Size added in v1.0.0

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

func (*MsgSetWithdrawAddress) String added in v1.0.0

func (m *MsgSetWithdrawAddress) String() string

func (MsgSetWithdrawAddress) Type

func (msg MsgSetWithdrawAddress) Type() string

func (*MsgSetWithdrawAddress) Unmarshal added in v1.0.0

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

func (MsgSetWithdrawAddress) ValidateBasic

func (msg MsgSetWithdrawAddress) ValidateBasic() error

quick validity check

func (*MsgSetWithdrawAddress) XXX_DiscardUnknown added in v1.0.0

func (m *MsgSetWithdrawAddress) XXX_DiscardUnknown()

func (*MsgSetWithdrawAddress) XXX_Marshal added in v1.0.0

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

func (*MsgSetWithdrawAddress) XXX_Merge added in v1.0.0

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

func (*MsgSetWithdrawAddress) XXX_Size added in v1.0.0

func (m *MsgSetWithdrawAddress) XXX_Size() int

func (*MsgSetWithdrawAddress) XXX_Unmarshal added in v1.0.0

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

type MsgWithdrawDelegatorReward

type MsgWithdrawDelegatorReward 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 */
}

msg struct for delegation withdraw from a single validator

func NewMsgWithdrawDelegatorReward

func NewMsgWithdrawDelegatorReward(delAddr sdk.AccAddress, valAddr sdk.ValAddress) MsgWithdrawDelegatorReward

func (*MsgWithdrawDelegatorReward) Descriptor added in v1.0.0

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

func (*MsgWithdrawDelegatorReward) Equal added in v1.0.0

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

func (*MsgWithdrawDelegatorReward) GetDelegatorAddress added in v1.0.0

func (MsgWithdrawDelegatorReward) GetSignBytes

func (msg MsgWithdrawDelegatorReward) GetSignBytes() []byte

get the bytes for the message signer to sign on

func (MsgWithdrawDelegatorReward) GetSigners

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

Return address that must sign over msg.GetSignBytes()

func (*MsgWithdrawDelegatorReward) GetValidatorAddress added in v1.0.0

func (*MsgWithdrawDelegatorReward) Marshal added in v1.0.0

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

func (*MsgWithdrawDelegatorReward) MarshalTo added in v1.0.0

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

func (*MsgWithdrawDelegatorReward) MarshalToSizedBuffer added in v1.0.0

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

func (*MsgWithdrawDelegatorReward) ProtoMessage added in v1.0.0

func (*MsgWithdrawDelegatorReward) ProtoMessage()

func (*MsgWithdrawDelegatorReward) Reset added in v1.0.0

func (m *MsgWithdrawDelegatorReward) Reset()

func (MsgWithdrawDelegatorReward) Route

func (msg MsgWithdrawDelegatorReward) Route() string

func (*MsgWithdrawDelegatorReward) Size added in v1.0.0

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

func (*MsgWithdrawDelegatorReward) String added in v1.0.0

func (m *MsgWithdrawDelegatorReward) String() string

func (MsgWithdrawDelegatorReward) Type

func (*MsgWithdrawDelegatorReward) Unmarshal added in v1.0.0

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

func (MsgWithdrawDelegatorReward) ValidateBasic

func (msg MsgWithdrawDelegatorReward) ValidateBasic() error

quick validity check

func (*MsgWithdrawDelegatorReward) XXX_DiscardUnknown added in v1.0.0

func (m *MsgWithdrawDelegatorReward) XXX_DiscardUnknown()

func (*MsgWithdrawDelegatorReward) XXX_Marshal added in v1.0.0

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

func (*MsgWithdrawDelegatorReward) XXX_Merge added in v1.0.0

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

func (*MsgWithdrawDelegatorReward) XXX_Size added in v1.0.0

func (m *MsgWithdrawDelegatorReward) XXX_Size() int

func (*MsgWithdrawDelegatorReward) XXX_Unmarshal added in v1.0.0

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

type MsgWithdrawValidatorCommission added in v0.30.0

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

msg struct for validator withdraw

func NewMsgWithdrawValidatorCommission added in v0.30.0

func NewMsgWithdrawValidatorCommission(valAddr sdk.ValAddress) MsgWithdrawValidatorCommission

func (*MsgWithdrawValidatorCommission) Descriptor added in v1.0.0

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

func (*MsgWithdrawValidatorCommission) Equal added in v1.0.0

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

func (MsgWithdrawValidatorCommission) GetSignBytes added in v0.30.0

func (msg MsgWithdrawValidatorCommission) GetSignBytes() []byte

get the bytes for the message signer to sign on

func (MsgWithdrawValidatorCommission) GetSigners added in v0.30.0

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

Return address that must sign over msg.GetSignBytes()

func (*MsgWithdrawValidatorCommission) GetValidatorAddress added in v1.0.0

func (*MsgWithdrawValidatorCommission) Marshal added in v1.0.0

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

func (*MsgWithdrawValidatorCommission) MarshalTo added in v1.0.0

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

func (*MsgWithdrawValidatorCommission) MarshalToSizedBuffer added in v1.0.0

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

func (*MsgWithdrawValidatorCommission) ProtoMessage added in v1.0.0

func (*MsgWithdrawValidatorCommission) ProtoMessage()

func (*MsgWithdrawValidatorCommission) Reset added in v1.0.0

func (m *MsgWithdrawValidatorCommission) Reset()

func (MsgWithdrawValidatorCommission) Route added in v0.30.0

func (*MsgWithdrawValidatorCommission) Size added in v1.0.0

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

func (*MsgWithdrawValidatorCommission) String added in v1.0.0

func (MsgWithdrawValidatorCommission) Type added in v0.30.0

func (*MsgWithdrawValidatorCommission) Unmarshal added in v1.0.0

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

func (MsgWithdrawValidatorCommission) ValidateBasic added in v0.30.0

func (msg MsgWithdrawValidatorCommission) ValidateBasic() error

quick validity check

func (*MsgWithdrawValidatorCommission) XXX_DiscardUnknown added in v1.0.0

func (m *MsgWithdrawValidatorCommission) XXX_DiscardUnknown()

func (*MsgWithdrawValidatorCommission) XXX_Marshal added in v1.0.0

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

func (*MsgWithdrawValidatorCommission) XXX_Merge added in v1.0.0

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

func (*MsgWithdrawValidatorCommission) XXX_Size added in v1.0.0

func (m *MsgWithdrawValidatorCommission) XXX_Size() int

func (*MsgWithdrawValidatorCommission) XXX_Unmarshal added in v1.0.0

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

type Params added in v1.0.0

type Params struct {
	CommunityTax        github_com_cosmos_cosmos_sdk_types.Dec `` /* 160-byte string literal not displayed */
	BaseProposerReward  github_com_cosmos_cosmos_sdk_types.Dec `` /* 187-byte string literal not displayed */
	BonusProposerReward github_com_cosmos_cosmos_sdk_types.Dec `` /* 191-byte string literal not displayed */
	WithdrawAddrEnabled bool                                   `` /* 150-byte string literal not displayed */
}

Params defines the set of distribution parameters.

func DefaultParams added in v1.0.0

func DefaultParams() Params

DefaultParams returns default distribution parameters

func (*Params) Descriptor added in v1.0.0

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

func (*Params) Equal added in v1.0.0

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

func (*Params) GetWithdrawAddrEnabled added in v1.0.0

func (m *Params) GetWithdrawAddrEnabled() bool

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 v1.0.0

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

ParamSetPairs returns the parameter set pairs.

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 added in v1.0.0

func (p Params) String() string

func (*Params) Unmarshal added in v1.0.0

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

func (Params) ValidateBasic added in v1.0.0

func (p Params) ValidateBasic() error

ValidateBasic performs basic validation on distribution parameters.

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 QueryDelegationRewardsParams added in v1.0.0

type QueryDelegationRewardsParams struct {
	DelegatorAddress sdk.AccAddress `json:"delegator_address" yaml:"delegator_address"`
	ValidatorAddress sdk.ValAddress `json:"validator_address" yaml:"validator_address"`
}

params for query 'custom/distr/delegation_rewards'

func NewQueryDelegationRewardsParams added in v1.0.0

func NewQueryDelegationRewardsParams(delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress) QueryDelegationRewardsParams

creates a new instance of QueryDelegationRewardsParams

type QueryDelegatorParams added in v1.0.0

type QueryDelegatorParams struct {
	DelegatorAddress sdk.AccAddress `json:"delegator_address" yaml:"delegator_address"`
}

params for query 'custom/distr/delegator_total_rewards' and 'custom/distr/delegator_validators'

func NewQueryDelegatorParams added in v1.0.0

func NewQueryDelegatorParams(delegatorAddr sdk.AccAddress) QueryDelegatorParams

creates a new instance of QueryDelegationRewardsParams

type QueryDelegatorTotalRewardsResponse added in v1.0.0

type QueryDelegatorTotalRewardsResponse struct {
	Rewards []DelegationDelegatorReward `json:"rewards" yaml:"rewards"`
	Total   sdk.DecCoins                `json:"total" yaml:"total"`
}

QueryDelegatorTotalRewardsResponse defines the properties of QueryDelegatorTotalRewards query's response.

func NewQueryDelegatorTotalRewardsResponse added in v1.0.0

func NewQueryDelegatorTotalRewardsResponse(rewards []DelegationDelegatorReward,
	total sdk.DecCoins) QueryDelegatorTotalRewardsResponse

NewQueryDelegatorTotalRewardsResponse constructs a QueryDelegatorTotalRewardsResponse

func (QueryDelegatorTotalRewardsResponse) String added in v1.0.0

type QueryDelegatorWithdrawAddrParams added in v1.0.0

type QueryDelegatorWithdrawAddrParams struct {
	DelegatorAddress sdk.AccAddress `json:"delegator_address" yaml:"delegator_address"`
}

params for query 'custom/distr/withdraw_addr'

func NewQueryDelegatorWithdrawAddrParams added in v1.0.0

func NewQueryDelegatorWithdrawAddrParams(delegatorAddr sdk.AccAddress) QueryDelegatorWithdrawAddrParams

NewQueryDelegatorWithdrawAddrParams creates a new instance of QueryDelegatorWithdrawAddrParams.

type QueryValidatorCommissionParams added in v1.0.0

type QueryValidatorCommissionParams struct {
	ValidatorAddress sdk.ValAddress `json:"validator_address" yaml:"validator_address"`
}

params for query 'custom/distr/validator_commission'

func NewQueryValidatorCommissionParams added in v1.0.0

func NewQueryValidatorCommissionParams(validatorAddr sdk.ValAddress) QueryValidatorCommissionParams

creates a new instance of QueryValidatorCommissionParams

type QueryValidatorOutstandingRewardsParams added in v1.0.0

type QueryValidatorOutstandingRewardsParams struct {
	ValidatorAddress sdk.ValAddress `json:"validator_address" yaml:"validator_address"`
}

params for query 'custom/distr/validator_outstanding_rewards'

func NewQueryValidatorOutstandingRewardsParams added in v1.0.0

func NewQueryValidatorOutstandingRewardsParams(validatorAddr sdk.ValAddress) QueryValidatorOutstandingRewardsParams

creates a new instance of QueryValidatorOutstandingRewardsParams

type QueryValidatorSlashesParams added in v1.0.0

type QueryValidatorSlashesParams struct {
	ValidatorAddress sdk.ValAddress `json:"validator_address" yaml:"validator_address"`
	StartingHeight   uint64         `json:"starting_height" yaml:"starting_height"`
	EndingHeight     uint64         `json:"ending_height" yaml:"ending_height"`
}

params for query 'custom/distr/validator_slashes'

func NewQueryValidatorSlashesParams added in v1.0.0

func NewQueryValidatorSlashesParams(validatorAddr sdk.ValAddress, startingHeight uint64, endingHeight uint64) QueryValidatorSlashesParams

creates a new instance of QueryValidatorSlashesParams

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
	AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) // Must be called when a validator is deleted

	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
	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 StakingKeeper added in v0.30.0

type StakingKeeper 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

	// 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

	IterateDelegations(ctx sdk.Context, delegator sdk.AccAddress,
		fn func(index int64, delegation stakingexported.DelegationI) (stop bool))

	GetLastTotalPower(ctx sdk.Context) sdk.Int
	GetLastValidatorPower(ctx sdk.Context, valAddr sdk.ValAddress) int64

	GetAllSDKDelegations(ctx sdk.Context) []staking.Delegation
}

StakingKeeper expected staking keeper (noalias)

type ValidatorAccumulatedCommission added in v0.30.0

type ValidatorAccumulatedCommission struct {
	Commission github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,1,rep,name=commission,proto3,castrepeated=github.com/KiraCore/cosmos-sdk/types.DecCoins" json:"commission"`
}

accumulated commission for a validator kept as a running counter, can be withdrawn at any time

func InitialValidatorAccumulatedCommission added in v0.30.0

func InitialValidatorAccumulatedCommission() ValidatorAccumulatedCommission

return the initial accumulated commission (zero)

func (*ValidatorAccumulatedCommission) Descriptor added in v1.0.0

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

func (*ValidatorAccumulatedCommission) Equal added in v1.0.0

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

func (*ValidatorAccumulatedCommission) GetCommission added in v1.0.0

func (*ValidatorAccumulatedCommission) Marshal added in v1.0.0

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

func (*ValidatorAccumulatedCommission) MarshalTo added in v1.0.0

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

func (*ValidatorAccumulatedCommission) MarshalToSizedBuffer added in v1.0.0

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

func (*ValidatorAccumulatedCommission) ProtoMessage added in v1.0.0

func (*ValidatorAccumulatedCommission) ProtoMessage()

func (*ValidatorAccumulatedCommission) Reset added in v1.0.0

func (m *ValidatorAccumulatedCommission) Reset()

func (*ValidatorAccumulatedCommission) Size added in v1.0.0

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

func (*ValidatorAccumulatedCommission) String added in v1.0.0

func (*ValidatorAccumulatedCommission) Unmarshal added in v1.0.0

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

func (*ValidatorAccumulatedCommission) XXX_DiscardUnknown added in v1.0.0

func (m *ValidatorAccumulatedCommission) XXX_DiscardUnknown()

func (*ValidatorAccumulatedCommission) XXX_Marshal added in v1.0.0

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

func (*ValidatorAccumulatedCommission) XXX_Merge added in v1.0.0

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

func (*ValidatorAccumulatedCommission) XXX_Size added in v1.0.0

func (m *ValidatorAccumulatedCommission) XXX_Size() int

func (*ValidatorAccumulatedCommission) XXX_Unmarshal added in v1.0.0

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

type ValidatorAccumulatedCommissionRecord added in v0.30.0

type ValidatorAccumulatedCommissionRecord struct {
	ValidatorAddress sdk.ValAddress                 `json:"validator_address" yaml:"validator_address"`
	Accumulated      ValidatorAccumulatedCommission `json:"accumulated" yaml:"accumulated"`
}

used for import / export via genesis json

type ValidatorCurrentRewards added in v0.30.0

type ValidatorCurrentRewards struct {
	Rewards github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,1,rep,name=rewards,proto3,castrepeated=github.com/KiraCore/cosmos-sdk/types.DecCoins" json:"rewards"`
	Period  uint64                                      `protobuf:"varint,2,opt,name=period,proto3" json:"period,omitempty"`
}

current rewards and current period for a validator kept as a running counter and incremented each block as long as the validator's tokens remain constant

func NewValidatorCurrentRewards added in v0.30.0

func NewValidatorCurrentRewards(rewards sdk.DecCoins, period uint64) ValidatorCurrentRewards

create a new ValidatorCurrentRewards

func (*ValidatorCurrentRewards) Descriptor added in v1.0.0

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

func (*ValidatorCurrentRewards) Equal added in v1.0.0

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

func (*ValidatorCurrentRewards) GetPeriod added in v1.0.0

func (m *ValidatorCurrentRewards) GetPeriod() uint64

func (*ValidatorCurrentRewards) GetRewards added in v1.0.0

func (*ValidatorCurrentRewards) Marshal added in v1.0.0

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

func (*ValidatorCurrentRewards) MarshalTo added in v1.0.0

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

func (*ValidatorCurrentRewards) MarshalToSizedBuffer added in v1.0.0

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

func (*ValidatorCurrentRewards) ProtoMessage added in v1.0.0

func (*ValidatorCurrentRewards) ProtoMessage()

func (*ValidatorCurrentRewards) Reset added in v1.0.0

func (m *ValidatorCurrentRewards) Reset()

func (*ValidatorCurrentRewards) Size added in v1.0.0

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

func (*ValidatorCurrentRewards) String added in v1.0.0

func (m *ValidatorCurrentRewards) String() string

func (*ValidatorCurrentRewards) Unmarshal added in v1.0.0

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

func (*ValidatorCurrentRewards) XXX_DiscardUnknown added in v1.0.0

func (m *ValidatorCurrentRewards) XXX_DiscardUnknown()

func (*ValidatorCurrentRewards) XXX_Marshal added in v1.0.0

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

func (*ValidatorCurrentRewards) XXX_Merge added in v1.0.0

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

func (*ValidatorCurrentRewards) XXX_Size added in v1.0.0

func (m *ValidatorCurrentRewards) XXX_Size() int

func (*ValidatorCurrentRewards) XXX_Unmarshal added in v1.0.0

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

type ValidatorCurrentRewardsRecord added in v0.30.0

type ValidatorCurrentRewardsRecord struct {
	ValidatorAddress sdk.ValAddress          `json:"validator_address" yaml:"validator_address"`
	Rewards          ValidatorCurrentRewards `json:"rewards" yaml:"rewards"`
}

used for import / export via genesis json

type ValidatorHistoricalRewards added in v0.30.0

type ValidatorHistoricalRewards struct {
	CumulativeRewardRatio github_com_cosmos_cosmos_sdk_types.DecCoins `` /* 206-byte string literal not displayed */
	ReferenceCount        uint32                                      `` /* 127-byte string literal not displayed */
}

historical rewards for a validator height is implicit within the store key cumulative reward ratio is the sum from the zeroeth period until this period of rewards / tokens, per the spec The reference count indicates the number of objects which might need to reference this historical entry at any point. ReferenceCount =

  number of outstanding delegations which ended the associated period (and might need to read
  that record)
+ number of slashes which ended the associated period (and might need to read that record)
+ one per validator for the zeroeth period, set on initialization

func NewValidatorHistoricalRewards added in v0.30.0

func NewValidatorHistoricalRewards(cumulativeRewardRatio sdk.DecCoins, referenceCount uint32) ValidatorHistoricalRewards

create a new ValidatorHistoricalRewards

func (*ValidatorHistoricalRewards) Descriptor added in v1.0.0

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

func (*ValidatorHistoricalRewards) Equal added in v1.0.0

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

func (*ValidatorHistoricalRewards) GetCumulativeRewardRatio added in v1.0.0

func (*ValidatorHistoricalRewards) GetReferenceCount added in v1.0.0

func (m *ValidatorHistoricalRewards) GetReferenceCount() uint32

func (*ValidatorHistoricalRewards) Marshal added in v1.0.0

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

func (*ValidatorHistoricalRewards) MarshalTo added in v1.0.0

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

func (*ValidatorHistoricalRewards) MarshalToSizedBuffer added in v1.0.0

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

func (*ValidatorHistoricalRewards) ProtoMessage added in v1.0.0

func (*ValidatorHistoricalRewards) ProtoMessage()

func (*ValidatorHistoricalRewards) Reset added in v1.0.0

func (m *ValidatorHistoricalRewards) Reset()

func (*ValidatorHistoricalRewards) Size added in v1.0.0

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

func (*ValidatorHistoricalRewards) String added in v1.0.0

func (m *ValidatorHistoricalRewards) String() string

func (*ValidatorHistoricalRewards) Unmarshal added in v1.0.0

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

func (*ValidatorHistoricalRewards) XXX_DiscardUnknown added in v1.0.0

func (m *ValidatorHistoricalRewards) XXX_DiscardUnknown()

func (*ValidatorHistoricalRewards) XXX_Marshal added in v1.0.0

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

func (*ValidatorHistoricalRewards) XXX_Merge added in v1.0.0

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

func (*ValidatorHistoricalRewards) XXX_Size added in v1.0.0

func (m *ValidatorHistoricalRewards) XXX_Size() int

func (*ValidatorHistoricalRewards) XXX_Unmarshal added in v1.0.0

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

type ValidatorHistoricalRewardsRecord added in v0.30.0

type ValidatorHistoricalRewardsRecord struct {
	ValidatorAddress sdk.ValAddress             `json:"validator_address" yaml:"validator_address"`
	Period           uint64                     `json:"period" yaml:"period"`
	Rewards          ValidatorHistoricalRewards `json:"rewards" yaml:"rewards"`
}

used for import / export via genesis json

type ValidatorOutstandingRewards added in v0.33.0

type ValidatorOutstandingRewards struct {
	Rewards github_com_cosmos_cosmos_sdk_types.DecCoins `` /* 131-byte string literal not displayed */
}

outstanding (un-withdrawn) rewards for a validator inexpensive to track, allows simple sanity checks

func (*ValidatorOutstandingRewards) Descriptor added in v1.0.0

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

func (*ValidatorOutstandingRewards) Equal added in v1.0.0

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

func (*ValidatorOutstandingRewards) GetRewards added in v1.0.0

func (*ValidatorOutstandingRewards) Marshal added in v1.0.0

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

func (*ValidatorOutstandingRewards) MarshalTo added in v1.0.0

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

func (*ValidatorOutstandingRewards) MarshalToSizedBuffer added in v1.0.0

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

func (*ValidatorOutstandingRewards) ProtoMessage added in v1.0.0

func (*ValidatorOutstandingRewards) ProtoMessage()

func (*ValidatorOutstandingRewards) Reset added in v1.0.0

func (m *ValidatorOutstandingRewards) Reset()

func (*ValidatorOutstandingRewards) Size added in v1.0.0

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

func (*ValidatorOutstandingRewards) String added in v1.0.0

func (m *ValidatorOutstandingRewards) String() string

func (*ValidatorOutstandingRewards) Unmarshal added in v1.0.0

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

func (*ValidatorOutstandingRewards) XXX_DiscardUnknown added in v1.0.0

func (m *ValidatorOutstandingRewards) XXX_DiscardUnknown()

func (*ValidatorOutstandingRewards) XXX_Marshal added in v1.0.0

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

func (*ValidatorOutstandingRewards) XXX_Merge added in v1.0.0

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

func (*ValidatorOutstandingRewards) XXX_Size added in v1.0.0

func (m *ValidatorOutstandingRewards) XXX_Size() int

func (*ValidatorOutstandingRewards) XXX_Unmarshal added in v1.0.0

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

type ValidatorOutstandingRewardsRecord added in v0.33.0

type ValidatorOutstandingRewardsRecord struct {
	ValidatorAddress   sdk.ValAddress `json:"validator_address" yaml:"validator_address"`
	OutstandingRewards sdk.DecCoins   `json:"outstanding_rewards" yaml:"outstanding_rewards"`
}

used for import/export via genesis json

type ValidatorSlashEvent added in v0.30.0

type ValidatorSlashEvent struct {
	ValidatorPeriod uint64                                 `` /* 131-byte string literal not displayed */
	Fraction        github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=fraction,proto3,customtype=github.com/KiraCore/cosmos-sdk/types.Dec" json:"fraction"`
}

validator slash event height is implicit within the store key needed to calculate appropriate amounts of staking token for delegations which withdraw after a slash has occurred

func NewValidatorSlashEvent added in v0.30.0

func NewValidatorSlashEvent(validatorPeriod uint64, fraction sdk.Dec) ValidatorSlashEvent

create a new ValidatorSlashEvent

func (*ValidatorSlashEvent) Descriptor added in v1.0.0

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

func (*ValidatorSlashEvent) Equal added in v1.0.0

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

func (*ValidatorSlashEvent) GetValidatorPeriod added in v1.0.0

func (m *ValidatorSlashEvent) GetValidatorPeriod() uint64

func (*ValidatorSlashEvent) Marshal added in v1.0.0

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

func (*ValidatorSlashEvent) MarshalTo added in v1.0.0

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

func (*ValidatorSlashEvent) MarshalToSizedBuffer added in v1.0.0

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

func (*ValidatorSlashEvent) ProtoMessage added in v1.0.0

func (*ValidatorSlashEvent) ProtoMessage()

func (*ValidatorSlashEvent) Reset added in v1.0.0

func (m *ValidatorSlashEvent) Reset()

func (*ValidatorSlashEvent) Size added in v1.0.0

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

func (*ValidatorSlashEvent) String added in v0.30.0

func (m *ValidatorSlashEvent) String() string

func (*ValidatorSlashEvent) Unmarshal added in v1.0.0

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

func (*ValidatorSlashEvent) XXX_DiscardUnknown added in v1.0.0

func (m *ValidatorSlashEvent) XXX_DiscardUnknown()

func (*ValidatorSlashEvent) XXX_Marshal added in v1.0.0

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

func (*ValidatorSlashEvent) XXX_Merge added in v1.0.0

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

func (*ValidatorSlashEvent) XXX_Size added in v1.0.0

func (m *ValidatorSlashEvent) XXX_Size() int

func (*ValidatorSlashEvent) XXX_Unmarshal added in v1.0.0

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

type ValidatorSlashEventRecord added in v0.30.0

type ValidatorSlashEventRecord struct {
	ValidatorAddress sdk.ValAddress      `json:"validator_address" yaml:"validator_address"`
	Height           uint64              `json:"height" yaml:"height"`
	Period           uint64              `json:"period" yaml:"period"`
	Event            ValidatorSlashEvent `json:"validator_slash_event" yaml:"validator_slash_event"`
}

used for import / export via genesis json

type ValidatorSlashEvents added in v0.30.0

type ValidatorSlashEvents struct {
	ValidatorSlashEvents []ValidatorSlashEvent `` /* 143-byte string literal not displayed */
}

ValidatorSlashEvents is a collection of ValidatorSlashEvent

func (*ValidatorSlashEvents) Descriptor added in v1.0.0

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

func (*ValidatorSlashEvents) Equal added in v1.0.0

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

func (*ValidatorSlashEvents) GetValidatorSlashEvents added in v1.0.0

func (m *ValidatorSlashEvents) GetValidatorSlashEvents() []ValidatorSlashEvent

func (*ValidatorSlashEvents) Marshal added in v1.0.0

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

func (*ValidatorSlashEvents) MarshalTo added in v1.0.0

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

func (*ValidatorSlashEvents) MarshalToSizedBuffer added in v1.0.0

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

func (*ValidatorSlashEvents) ProtoMessage added in v1.0.0

func (*ValidatorSlashEvents) ProtoMessage()

func (*ValidatorSlashEvents) Reset added in v1.0.0

func (m *ValidatorSlashEvents) Reset()

func (*ValidatorSlashEvents) Size added in v1.0.0

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

func (ValidatorSlashEvents) String added in v0.30.0

func (vs ValidatorSlashEvents) String() string

func (*ValidatorSlashEvents) Unmarshal added in v1.0.0

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

func (*ValidatorSlashEvents) XXX_DiscardUnknown added in v1.0.0

func (m *ValidatorSlashEvents) XXX_DiscardUnknown()

func (*ValidatorSlashEvents) XXX_Marshal added in v1.0.0

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

func (*ValidatorSlashEvents) XXX_Merge added in v1.0.0

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

func (*ValidatorSlashEvents) XXX_Size added in v1.0.0

func (m *ValidatorSlashEvents) XXX_Size() int

func (*ValidatorSlashEvents) XXX_Unmarshal added in v1.0.0

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

Jump to

Keyboard shortcuts

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