Documentation ¶
Index ¶
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"
)
Querier routes for the kavadist module
Variables ¶
var ( CurrentDistPeriodKey = []byte{0x00} PreviousBlockTimeKey = []byte{0x01} )
var ( KeyActive = []byte("Active") KeyPeriods = []byte("Periods") DefaultActive = false DefaultPeriods = Periods{} DefaultPreviousBlockTime = tmtime.Canonical(time.Unix(0, 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 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 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