Documentation ¶
Overview ¶
Package distribution implements a Cosmos SDK module, that provides an implementation of the F1 fee distribution algorithm. It handles reward tracking, allocation, and distribution. Please refer to the specification under /spec for further information.
Index ¶
- Constants
- Variables
- func BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock, k keeper.Keeper)
- func ExportGenesis(ctx sdk.Context, keeper Keeper) types.GenesisState
- func InitGenesis(ctx sdk.Context, bk types.BankKeeperAccountID, ...)
- func NewCommunityPoolSpendProposalHandler(k Keeper) types.GovTypesHandler
- func NewHandler(k keeper.Keeper) msg.Handler
- type AccountID
- type AppModule
- func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock)
- func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate
- func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONMarshaler) json.RawMessage
- func (AppModule) GenerateGenesisState(simState *module.SimulationState)
- func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONMarshaler, data json.RawMessage) []abci.ValidatorUpdate
- func (AppModule) Name() string
- func (am AppModule) NewHandler() sdk.Handler
- func (am AppModule) NewQuerierHandler() sdk.Querier
- func (am AppModule) ProposalContents(_ module.SimulationState) []sim.WeightedProposalContent
- func (AppModule) QuerierRoute() string
- func (AppModule) RandomizedParams(r *rand.Rand) []sim.ParamChange
- func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry)
- func (AppModule) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry)
- func (AppModule) Route() string
- func (am AppModule) WeightedOperations(simState module.SimulationState) []sim.WeightedOperation
- type AppModuleBasic
- func (AppModuleBasic) DefaultGenesis(cdc codec.JSONMarshaler) json.RawMessage
- func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
- func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command
- func (AppModuleBasic) Name() string
- func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
- func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)
- func (AppModuleBasic) ValidateGenesis(cdc codec.JSONMarshaler, bz json.RawMessage) error
- type CommunityPoolSpendProposal
- type DelegationDelegatorReward
- type DelegatorStartingInfo
- type DelegatorStartingInfoRecord
- type DelegatorWithdrawInfo
- type FeePool
- type GenesisState
- type Hooks
- type Keeper
- type MsgSetWithdrawAccountId
- type MsgWithdrawDelegatorReward
- type MsgWithdrawValidatorCommission
- type Params
- type QueryDelegationRewardsParams
- type QueryDelegatorParams
- type QueryDelegatorTotalRewardsResponse
- type QueryDelegatorWithdrawAddrParams
- type QueryValidatorCommissionParams
- type QueryValidatorOutstandingRewardsParams
- type QueryValidatorSlashesParams
- type ValidatorAccumulatedCommission
- type ValidatorAccumulatedCommissionRecord
- type ValidatorCurrentRewards
- type ValidatorCurrentRewardsRecord
- type ValidatorHistoricalRewards
- type ValidatorHistoricalRewardsRecord
- type ValidatorOutstandingRewards
- type ValidatorOutstandingRewardsRecord
- type ValidatorSlashEvent
- type ValidatorSlashEventRecord
- type ValidatorSlashEvents
Constants ¶
const ( ModuleName = types.ModuleName StoreKey = types.StoreKey RouterKey = types.RouterKey QuerierRoute = types.QuerierRoute ProposalTypeCommunityPoolSpend = types.ProposalTypeCommunityPoolSpend QueryParams = types.QueryParams QueryValidatorOutstandingRewards = types.QueryValidatorOutstandingRewards QueryValidatorCommission = types.QueryValidatorCommission QueryValidatorSlashes = types.QueryValidatorSlashes QueryDelegationRewards = types.QueryDelegationRewards QueryDelegatorTotalRewards = types.QueryDelegatorTotalRewards QueryDelegatorValidators = types.QueryDelegatorValidators QueryWithdrawAddr = types.QueryWithdrawAddr QueryCommunityPool = types.QueryCommunityPool DefaultParamspace = types.DefaultParamspace )
Variables ¶
var ( // functions aliases RegisterInvariants = keeper.RegisterInvariants AllInvariants = keeper.AllInvariants NonNegativeOutstandingInvariant = keeper.NonNegativeOutstandingInvariant CanWithdrawInvariant = keeper.CanWithdrawInvariant ReferenceCountInvariant = keeper.ReferenceCountInvariant ModuleAccountInvariant = keeper.ModuleAccountInvariant NewKeeper = keeper.NewKeeper GetValidatorOutstandingRewardsAddress = types.GetValidatorOutstandingRewardsAddress GetDelegatorWithdrawInfoAddress = types.GetDelegatorWithdrawInfoAddress GetDelegatorStartingInfoAddresses = types.GetDelegatorStartingInfoAddresses GetValidatorHistoricalRewardsAddressPeriod = types.GetValidatorHistoricalRewardsAddressPeriod GetValidatorCurrentRewardsAddress = types.GetValidatorCurrentRewardsAddress GetValidatorAccumulatedCommissionAddress = types.GetValidatorAccumulatedCommissionAddress GetValidatorSlashEventAddressHeight = types.GetValidatorSlashEventAddressHeight GetValidatorOutstandingRewardsKey = types.GetValidatorOutstandingRewardsKey GetDelegatorWithdrawAddrKey = types.GetDelegatorWithdrawAddrKey GetDelegatorStartingInfoKey = types.GetDelegatorStartingInfoKey GetValidatorHistoricalRewardsPrefix = types.GetValidatorHistoricalRewardsPrefix GetValidatorHistoricalRewardsKey = types.GetValidatorHistoricalRewardsKey GetValidatorCurrentRewardsKey = types.GetValidatorCurrentRewardsKey GetValidatorAccumulatedCommissionKey = types.GetValidatorAccumulatedCommissionKey GetValidatorSlashEventPrefix = types.GetValidatorSlashEventPrefix GetValidatorSlashEventKeyPrefix = types.GetValidatorSlashEventKeyPrefix GetValidatorSlashEventKey = types.GetValidatorSlashEventKey HandleCommunityPoolSpendProposal = keeper.HandleCommunityPoolSpendProposal NewQuerier = keeper.NewQuerier ParamKeyTable = types.ParamKeyTable DefaultParams = types.DefaultParams RegisterCodec = types.RegisterCodec NewDelegatorStartingInfo = types.NewDelegatorStartingInfo ErrEmptyDelegatorAddr = types.ErrEmptyDelegatorAddr ErrEmptyWithdrawAddr = types.ErrEmptyWithdrawAddr ErrEmptyValidatorAddr = types.ErrEmptyValidatorAddr ErrEmptyDelegationDistInfo = types.ErrEmptyDelegationDistInfo ErrNoValidatorDistInfo = types.ErrNoValidatorDistInfo ErrNoValidatorExists = types.ErrNoValidatorExists ErrNoDelegationExists = types.ErrNoDelegationExists ErrNoValidatorCommission = types.ErrNoValidatorCommission ErrSetWithdrawAddrDisabled = types.ErrSetWithdrawAddrDisabled ErrBadDistribution = types.ErrBadDistribution ErrInvalidProposalAmount = types.ErrInvalidProposalAmount ErrEmptyProposalRecipient = types.ErrEmptyProposalRecipient InitialFeePool = types.InitialFeePool NewGenesisState = types.NewGenesisState DefaultGenesisState = types.DefaultGenesisState ValidateGenesis = types.ValidateGenesis NewMsgSetWithdrawAccountId = types.NewMsgSetWithdrawAccountId NewMsgWithdrawDelegatorReward = types.NewMsgWithdrawDelegatorReward NewMsgWithdrawValidatorCommission = types.NewMsgWithdrawValidatorCommission MsgFundCommunityPool = types.NewMsgFundCommunityPool NewCommunityPoolSpendProposal = types.NewCommunityPoolSpendProposal NewQueryValidatorOutstandingRewardsParams = types.NewQueryValidatorOutstandingRewardsParams NewQueryValidatorCommissionParams = types.NewQueryValidatorCommissionParams NewQueryValidatorSlashesParams = types.NewQueryValidatorSlashesParams NewQueryDelegationRewardsParams = types.NewQueryDelegationRewardsParams NewQueryDelegatorParams = types.NewQueryDelegatorParams NewQueryDelegatorWithdrawAddrParams = types.NewQueryDelegatorWithdrawAddrParams NewQueryDelegatorTotalRewardsResponse = types.NewQueryDelegatorTotalRewardsResponse NewDelegationDelegatorReward = types.NewDelegationDelegatorReward NewValidatorHistoricalRewards = types.NewValidatorHistoricalRewards NewValidatorCurrentRewards = types.NewValidatorCurrentRewards InitialValidatorAccumulatedCommission = types.InitialValidatorAccumulatedCommission NewValidatorSlashEvent = types.NewValidatorSlashEvent // variable aliases FeePoolKey = types.FeePoolKey ProposerKey = types.ProposerKey ValidatorOutstandingRewardsPrefix = types.ValidatorOutstandingRewardsPrefix DelegatorWithdrawAddrPrefix = types.DelegatorWithdrawAddrPrefix DelegatorStartingInfoPrefix = types.DelegatorStartingInfoPrefix ValidatorHistoricalRewardsPrefix = types.ValidatorHistoricalRewardsPrefix ValidatorCurrentRewardsPrefix = types.ValidatorCurrentRewardsPrefix ValidatorAccumulatedCommissionPrefix = types.ValidatorAccumulatedCommissionPrefix ValidatorSlashEventPrefix = types.ValidatorSlashEventPrefix ParamStoreKeyCommunityTax = types.ParamStoreKeyCommunityTax ParamStoreKeyBaseProposerReward = types.ParamStoreKeyBaseProposerReward ParamStoreKeyBonusProposerReward = types.ParamStoreKeyBonusProposerReward ParamStoreKeyWithdrawAddrEnabled = types.ParamStoreKeyWithdrawAddrEnabled ModuleCdc = types.ModuleCdc EventTypeSetWithdrawAddress = types.EventTypeSetWithdrawAddress EventTypeRewards = types.EventTypeRewards EventTypeCommission = types.EventTypeCommission EventTypeWithdrawRewards = types.EventTypeWithdrawRewards EventTypeWithdrawCommission = types.EventTypeWithdrawCommission EventTypeProposerReward = types.EventTypeProposerReward AttributeKeyWithdrawAddress = types.AttributeKeyWithdrawAddress AttributeKeyValidator = types.AttributeKeyValidator AttributeValueCategory = types.AttributeValueCategory ProposalHandler = client.ProposalHandler )
Functions ¶
func BeginBlocker ¶
BeginBlocker sets the proposer for determining distribution during endblock and distribute rewards for the previous block by cancer
func ExportGenesis ¶
func ExportGenesis(ctx sdk.Context, keeper Keeper) types.GenesisState
ExportGenesis returns a GenesisState for a given context and keeper.
func InitGenesis ¶
func InitGenesis(ctx sdk.Context, bk types.BankKeeperAccountID, supplyKeeper types.SupplyKeeperAccountID, keeper Keeper, data types.GenesisState)
InitGenesis sets distribution information for genesis
func NewCommunityPoolSpendProposalHandler ¶
func NewCommunityPoolSpendProposalHandler(k Keeper) types.GovTypesHandler
Types ¶
type AppModule ¶
type AppModule struct { AppModuleBasic // contains filtered or unexported fields }
AppModule implements an application module for the distribution module.
func NewAppModule ¶
func NewAppModule( keeper Keeper, accountKeeper types.AccountKeeperAccountID, bankKeeper types.BankKeeperAccountID, supplyKeeper types.SupplyKeeperAccountID, stakingKeeper types.StakingKPKeeper, ) AppModule
NewAppModule creates a new AppModule object
func (AppModule) BeginBlock ¶
func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock)
BeginBlock returns the begin blocker for the distribution module.
func (AppModule) EndBlock ¶
func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate
EndBlock returns the end blocker for the distribution module. It returns no validator updates.
func (AppModule) ExportGenesis ¶
func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONMarshaler) json.RawMessage
ExportGenesis returns the exported genesis state as raw bytes for the distribution module.
func (AppModule) GenerateGenesisState ¶
func (AppModule) GenerateGenesisState(simState *module.SimulationState)
GenerateGenesisState creates a randomized GenState of the distribution module.
func (AppModule) InitGenesis ¶
func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONMarshaler, data json.RawMessage) []abci.ValidatorUpdate
InitGenesis performs genesis initialization for the distribution module. It returns no validator updates.
func (AppModule) NewHandler ¶
NewHandler returns an sdk.Handler for the distribution module.
func (AppModule) NewQuerierHandler ¶
NewQuerierHandler returns the distribution module sdk.Querier.
func (AppModule) ProposalContents ¶
func (am AppModule) ProposalContents(_ module.SimulationState) []sim.WeightedProposalContent
ProposalContents returns all the distribution content functions used to simulate governance proposals.
func (AppModule) QuerierRoute ¶
QuerierRoute returns the distribution module's querier route name.
func (AppModule) RandomizedParams ¶
func (AppModule) RandomizedParams(r *rand.Rand) []sim.ParamChange
RandomizedParams creates randomized distribution param changes for the simulator.
func (AppModule) RegisterInvariants ¶
func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry)
RegisterInvariants registers the distribution module invariants.
func (AppModule) RegisterStoreDecoder ¶
func (AppModule) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry)
RegisterStoreDecoder registers a decoder for distribution module's types
func (AppModule) WeightedOperations ¶
func (am AppModule) WeightedOperations(simState module.SimulationState) []sim.WeightedOperation
WeightedOperations returns the all the gov module operations with their respective weights.
type AppModuleBasic ¶
type AppModuleBasic struct{}
AppModuleBasic defines the basic application module used by the distribution module.
func (AppModuleBasic) DefaultGenesis ¶
func (AppModuleBasic) DefaultGenesis(cdc codec.JSONMarshaler) json.RawMessage
DefaultGenesis returns default genesis state as raw bytes for the distribution module.
func (AppModuleBasic) GetQueryCmd ¶
func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
GetQueryCmd returns the root query command for the distribution module.
func (AppModuleBasic) GetTxCmd ¶
func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command
GetTxCmd returns the root tx command for the distribution module.
func (AppModuleBasic) Name ¶
func (AppModuleBasic) Name() string
Name returns the distribution module's name.
func (AppModuleBasic) RegisterCodec ¶
func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
RegisterCodec registers the distribution module's types for the given codec.
func (AppModuleBasic) RegisterRESTRoutes ¶
func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)
RegisterRESTRoutes registers the REST routes for the distribution module.
func (AppModuleBasic) ValidateGenesis ¶
func (AppModuleBasic) ValidateGenesis(cdc codec.JSONMarshaler, bz json.RawMessage) error
ValidateGenesis performs genesis state validation for the distribution module.
type CommunityPoolSpendProposal ¶
type CommunityPoolSpendProposal = types.CommunityPoolSpendProposal
type DelegationDelegatorReward ¶
type DelegationDelegatorReward = types.DelegationDelegatorReward
type DelegatorStartingInfo ¶
type DelegatorStartingInfo = types.DelegatorStartingInfo
type DelegatorStartingInfoRecord ¶
type DelegatorStartingInfoRecord = types.DelegatorStartingInfoRecord
type DelegatorWithdrawInfo ¶
type DelegatorWithdrawInfo = types.DelegatorWithdrawInfo
type GenesisState ¶
type GenesisState = types.GenesisState
type MsgSetWithdrawAccountId ¶
type MsgSetWithdrawAccountId = types.MsgSetWithdrawAccountId
type MsgWithdrawDelegatorReward ¶
type MsgWithdrawDelegatorReward = types.MsgWithdrawDelegatorReward
type MsgWithdrawValidatorCommission ¶
type MsgWithdrawValidatorCommission = types.MsgWithdrawValidatorCommission
type QueryDelegationRewardsParams ¶
type QueryDelegationRewardsParams = types.QueryDelegationRewardsParams
type QueryDelegatorParams ¶
type QueryDelegatorParams = types.QueryDelegatorParams
type QueryDelegatorTotalRewardsResponse ¶
type QueryDelegatorTotalRewardsResponse = types.QueryDelegatorTotalRewardsResponse
type QueryDelegatorWithdrawAddrParams ¶
type QueryDelegatorWithdrawAddrParams = types.QueryDelegatorWithdrawAddrParams
type QueryValidatorCommissionParams ¶
type QueryValidatorCommissionParams = types.QueryValidatorCommissionParams
type QueryValidatorOutstandingRewardsParams ¶
type QueryValidatorOutstandingRewardsParams = types.QueryValidatorOutstandingRewardsParams
type QueryValidatorSlashesParams ¶
type QueryValidatorSlashesParams = types.QueryValidatorSlashesParams
type ValidatorAccumulatedCommission ¶
type ValidatorAccumulatedCommission = types.ValidatorAccumulatedCommission
type ValidatorAccumulatedCommissionRecord ¶
type ValidatorAccumulatedCommissionRecord = types.ValidatorAccumulatedCommissionRecord
type ValidatorCurrentRewards ¶
type ValidatorCurrentRewards = types.ValidatorCurrentRewards
type ValidatorCurrentRewardsRecord ¶
type ValidatorCurrentRewardsRecord = types.ValidatorCurrentRewardsRecord
type ValidatorHistoricalRewards ¶
type ValidatorHistoricalRewards = types.ValidatorHistoricalRewards
type ValidatorHistoricalRewardsRecord ¶
type ValidatorHistoricalRewardsRecord = types.ValidatorHistoricalRewardsRecord
type ValidatorOutstandingRewards ¶
type ValidatorOutstandingRewards = types.ValidatorOutstandingRewards
type ValidatorOutstandingRewardsRecord ¶
type ValidatorOutstandingRewardsRecord = types.ValidatorOutstandingRewardsRecord
type ValidatorSlashEvent ¶
type ValidatorSlashEvent = types.ValidatorSlashEvent
type ValidatorSlashEventRecord ¶
type ValidatorSlashEventRecord = types.ValidatorSlashEventRecord
type ValidatorSlashEvents ¶
type ValidatorSlashEvents = types.ValidatorSlashEvents