Documentation ¶
Index ¶
- Constants
- Variables
- func ParamKeyTable() params.KeyTable
- func RegisterCodec(cdc *codec.Codec)
- type CommunityPoolMultiSpendProposal
- func (csp CommunityPoolMultiSpendProposal) GetDescription() string
- func (csp CommunityPoolMultiSpendProposal) GetTitle() string
- func (csp CommunityPoolMultiSpendProposal) ProposalRoute() string
- func (csp CommunityPoolMultiSpendProposal) ProposalType() string
- func (csp CommunityPoolMultiSpendProposal) String() string
- func (csp CommunityPoolMultiSpendProposal) ValidateBasic() error
- type DistKeeper
- type GenesisState
- type MultiSpendRecipient
- type MultiSpendRecipients
- type Params
- type Period
- type Periods
- type SupplyKeeper
Constants ¶
const ( EventTypeKavaDist = ModuleName AttributeKeyInflation = "kava_dist_inflation" AttributeKeyStatus = "kava_dist_status" AttributeValueInactive = "inactive" )
Event types for cdp module
const ( // ModuleName name that will be used throughout the module ModuleName = "kavadist" // StoreKey Top level store key where all module items will be stored StoreKey = ModuleName // RouterKey Top level router key RouterKey = ModuleName // QuerierRoute Top level query string QuerierRoute = ModuleName // DefaultParamspace default name for parameter store DefaultParamspace = ModuleName // KavaDistMacc module account for kavadist KavaDistMacc = ModuleName )
const ( QueryGetParams = "params" QueryGetBalance = "balance" )
Querier routes for the kavadist module
const (
// ProposalTypeCommunityPoolMultiSpend defines the type for a CommunityPoolMultiSpendProposal
ProposalTypeCommunityPoolMultiSpend = "CommunityPoolMultiSpend"
)
Variables ¶
var ( ErrInvalidProposalAmount = sdkerrors.Register(ModuleName, 2, "invalid community pool multi-spend proposal amount") ErrEmptyProposalRecipient = sdkerrors.Register(ModuleName, 3, "invalid community pool multi-spend proposal recipient") )
x/kavadist errors
var ( CurrentDistPeriodKey = []byte{0x00} PreviousBlockTimeKey = []byte{0x01} )
var ( KeyActive = []byte("Active") KeyPeriods = []byte("Periods") DefaultActive = false DefaultPeriods = Periods{} DefaultPreviousBlockTime = tmtime.Canonical(time.Unix(1, 0)) GovDenom = cdptypes.DefaultGovDenom )
Parameter keys and default values
var ModuleCdc *codec.Codec
ModuleCdc generic sealed codec to be used throughout module
Functions ¶
func ParamKeyTable ¶
ParamKeyTable Key declaration for parameters
func RegisterCodec ¶
RegisterCodec registers the necessary types for cdp module
Types ¶
type CommunityPoolMultiSpendProposal ¶ added in v0.14.2
type CommunityPoolMultiSpendProposal struct { Title string `json:"title" yaml:"title"` Description string `json:"description" yaml:"description"` RecipientList MultiSpendRecipients `json:"recipient_list" yaml:"recipient_list"` }
CommunityPoolMultiSpendProposal spends from the community pool by sending to one or more addresses
func NewCommunityPoolMultiSpendProposal ¶ added in v0.14.2
func NewCommunityPoolMultiSpendProposal(title, description string, recipientList MultiSpendRecipients) CommunityPoolMultiSpendProposal
NewCommunityPoolMultiSpendProposal creates a new community pool multi-spend proposal.
func (CommunityPoolMultiSpendProposal) GetDescription ¶ added in v0.14.2
func (csp CommunityPoolMultiSpendProposal) GetDescription() string
GetDescription returns the description of a community pool multi-spend proposal.
func (CommunityPoolMultiSpendProposal) GetTitle ¶ added in v0.14.2
func (csp CommunityPoolMultiSpendProposal) GetTitle() string
GetTitle returns the title of a community pool multi-spend proposal.
func (CommunityPoolMultiSpendProposal) ProposalRoute ¶ added in v0.14.2
func (csp CommunityPoolMultiSpendProposal) ProposalRoute() string
GetDescription returns the routing key of a community pool multi-spend proposal.
func (CommunityPoolMultiSpendProposal) ProposalType ¶ added in v0.14.2
func (csp CommunityPoolMultiSpendProposal) ProposalType() string
ProposalType returns the type of a community pool multi-spend proposal.
func (CommunityPoolMultiSpendProposal) String ¶ added in v0.14.2
func (csp CommunityPoolMultiSpendProposal) String() string
String implements fmt.Stringer
func (CommunityPoolMultiSpendProposal) ValidateBasic ¶ added in v0.14.2
func (csp CommunityPoolMultiSpendProposal) ValidateBasic() error
ValidateBasic stateless validation of a community pool multi-spend proposal.
type DistKeeper ¶ added in v0.14.2
type DistKeeper interface {
DistributeFromFeePool(ctx sdk.Context, amount sdk.Coins, receiveAddr sdk.AccAddress) error
}
DistKeeper defines the expected distribution keeper interface
type GenesisState ¶
type GenesisState struct { Params Params `json:"params" yaml:"params"` PreviousBlockTime time.Time `json:"previous_block_time" yaml:"previous_block_time"` }
GenesisState is the state that must be provided at genesis.
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
DefaultGenesisState returns a default genesis state
func NewGenesisState ¶
func NewGenesisState(params Params, previousBlockTime time.Time) GenesisState
NewGenesisState returns a new genesis state
func (GenesisState) Equal ¶
func (gs GenesisState) Equal(gs2 GenesisState) bool
Equal checks whether two gov GenesisState structs are equivalent
func (GenesisState) IsEmpty ¶
func (gs GenesisState) IsEmpty() bool
IsEmpty returns true if a GenesisState is empty
func (GenesisState) Validate ¶
func (gs GenesisState) Validate() error
Validate performs basic validation of genesis data returning an error for any failed validation criteria.
type MultiSpendRecipient ¶ added in v0.14.2
type MultiSpendRecipient struct { Address sdk.AccAddress `json:"address" yaml:"address"` Amount sdk.Coins `json:"amount" yaml:"amount"` }
MultiSpendRecipient defines a recipient and the amount of coins they are receiving
func (MultiSpendRecipient) String ¶ added in v0.14.2
func (msr MultiSpendRecipient) String() string
String implements fmt.Stringer
func (MultiSpendRecipient) Validate ¶ added in v0.14.2
func (msr MultiSpendRecipient) Validate() error
Validate stateless validation of MultiSpendRecipient
type MultiSpendRecipients ¶ added in v0.14.2
type MultiSpendRecipients []MultiSpendRecipient
MultiSpendRecipients slice of MultiSpendRecipient
func (MultiSpendRecipients) String ¶ added in v0.14.2
func (msrs MultiSpendRecipients) String() string
String implements fmt.Stringer
func (MultiSpendRecipients) Validate ¶ added in v0.14.2
func (msrs MultiSpendRecipients) Validate() error
Validate stateless validation of MultiSpendRecipients
type Params ¶
type Params struct { Active bool `json:"active" yaml:"active"` Periods Periods `json:"periods" yaml:"periods"` }
Params governance parameters for kavadist module
func DefaultParams ¶
func DefaultParams() Params
DefaultParams returns default params for kavadist module
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() params.ParamSetPairs
ParamSetPairs implements the ParamSet interface and returns all the key/value pairs
type Period ¶
type Period struct { Start time.Time `json:"start" yaml:"start"` // example "2020-03-01T15:20:00Z" End time.Time `json:"end" yaml:"end"` // example "2020-06-01T15:20:00Z" Inflation sdk.Dec `json:"inflation" yaml:"inflation"` // example "1.000000003022265980" - 10% inflation }
Period stores the specified start and end dates, and the inflation, expressed as a decimal representing the yearly APR of KAVA tokens that will be minted during that period
type SupplyKeeper ¶
type SupplyKeeper interface { GetModuleAddress(name string) sdk.AccAddress GetModuleAccount(ctx sdk.Context, name string) exported.ModuleAccountI GetSupply(ctx sdk.Context) (supply exported.SupplyI) SendCoinsFromModuleToModule(ctx sdk.Context, senderModule, recipientModule string, amt sdk.Coins) error MintCoins(ctx sdk.Context, name string, amt sdk.Coins) error }
SupplyKeeper defines the expected supply keeper