types

package
v0.0.0-...-962cb54 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2020 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodeSpaceIncentive sdk.CodespaceType = "incentive"

	// 701 ~ 799
	CodeInvalidAdjustmentHeight      sdk.CodeType = 701
	CodeInvalidDefaultRewardPerBlock sdk.CodeType = 702
	CodeInvalidPlanHeight            sdk.CodeType = 703
	CodeInvalidRewardPerBlock        sdk.CodeType = 704
	CodeInvalidTotalIncentive        sdk.CodeType = 705
	CodeInvalidPlanToAdd             sdk.CodeType = 706
)
View Source
const (
	ModuleName        = "incentive"
	QuerierRoute      = ModuleName
	DefaultParamspace = ModuleName
	RouterKey         = ModuleName
	StoreKey          = ModuleName
)

Variables

View Source
var (
	KeyIncentiveDefaultRewardPerBlock = []byte("incentiveDefaultRewardPerBlock")
	KeyIncentivePlans                 = []byte("incentivePlans")
)
View Source
var ModuleCdc = codec.New()

Functions

func CheckPlans

func CheckPlans(plans []Plan) sdk.Error

func ParamKeyTable

func ParamKeyTable() params.KeyTable

ParamKeyTable type declaration for parameters

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

Types

type BankKeeper

type BankKeeper interface {
	SubtractCoins(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) (sdk.Coins, sdk.Error)
	HasCoins(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) bool
}

expected bank keeper

type FeeCollectionKeeper

type FeeCollectionKeeper interface {
	AddCollectedFees(sdk.Context, sdk.Coins) sdk.Coins
}

expected fee collection keeper

type GenesisState

type GenesisState struct {
	State  State  `json:"state"`
	Params Params `json:"params"`
}

GenesisState - all asset state that must be provided at genesis

func DefaultGenesisState

func DefaultGenesisState() GenesisState

DefaultGenesisState - Return a default genesis state

func NewGenesisState

func NewGenesisState(state State, param Params) GenesisState

NewGenesisState - Create a new genesis state

func (GenesisState) ValidateGenesis

func (data GenesisState) ValidateGenesis() error

ValidateGenesis performs basic validation of asset genesis data returning an error for any failed validation criteria.

type Params

type Params struct {
	DefaultRewardPerBlock int64  `json:"default_reward_per_block"`
	Plans                 []Plan `json:"plans"`
}

func DefaultParams

func DefaultParams() Params

func (*Params) ParamSetPairs

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

func (Params) String

func (p Params) String() string

type Plan

type Plan struct {
	StartHeight    int64 `json:"start_height"`
	EndHeight      int64 `json:"end_height"`
	RewardPerBlock int64 `json:"reward_per_block"`
	TotalIncentive int64 `json:"total_incentive"`
}

type State

type State struct {
	HeightAdjustment int64 `json:"height_adjustment"`
}

type SupplyKeeper

type SupplyKeeper interface {
	SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) sdk.Error
}

SupplyKeeper defines the expected supply keeper (noalias)

Jump to

Keyboard shortcuts

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