types

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2021 License: Apache-2.0 Imports: 12 Imported by: 3

Documentation

Index

Constants

View Source
const (
	EventTypeKavaDist      = ModuleName
	AttributeKeyInflation  = "kava_dist_inflation"
	AttributeKeyStatus     = "kava_dist_status"
	AttributeValueInactive = "inactive"
)

Event types for cdp module

View Source
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
)
View Source
const (
	QueryGetParams  = "params"
	QueryGetBalance = "balance"
)

Querier routes for the kavadist module

View Source
const (
	// ProposalTypeCommunityPoolMultiSpend defines the type for a CommunityPoolMultiSpendProposal
	ProposalTypeCommunityPoolMultiSpend = "CommunityPoolMultiSpend"
)

Variables

View Source
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

View Source
var (
	CurrentDistPeriodKey = []byte{0x00}
	PreviousBlockTimeKey = []byte{0x01}
)
View Source
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

View Source
var ModuleCdc *codec.Codec

ModuleCdc generic sealed codec to be used throughout module

Functions

func ParamKeyTable

func ParamKeyTable() params.KeyTable

ParamKeyTable Key declaration for parameters

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

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

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 NewParams

func NewParams(active bool, periods Periods) Params

NewParams returns a new params object

func (*Params) ParamSetPairs

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

ParamSetPairs implements the ParamSet interface and returns all the key/value pairs

func (Params) String

func (p Params) String() string

String implements fmt.Stringer

func (Params) Validate

func (p Params) Validate() error

Validate checks that the parameters have valid values.

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

func NewPeriod added in v0.8.0

func NewPeriod(start time.Time, end time.Time, inflation sdk.Dec) Period

NewPeriod returns a new instance of Period

func (Period) String

func (pr Period) String() string

String implements fmt.Stringer

type Periods

type Periods []Period

Periods array of Period

func (Periods) String

func (prs Periods) String() string

String implements fmt.Stringer

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

Jump to

Keyboard shortcuts

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