Documentation
¶
Index ¶
- Constants
- Variables
- func BeginBlocker(ctx sdk.Context, k Keeper) sdk.Error
- func InitGenesis(ctx sdk.Context, keeper Keeper, data GenesisState)
- func ParamKeyTable() params.KeyTable
- func RegisterCodec(cdc *codec.Codec)
- type AppModule
- func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock)
- func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate
- func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage
- func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate
- func (AppModule) Name() string
- func (AppModule) NewHandler() sdk.Handler
- func (am AppModule) NewQuerierHandler() sdk.Querier
- func (AppModule) QuerierRoute() string
- func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry)
- func (AppModule) Route() string
- type AppModuleBasic
- func (AppModuleBasic) DefaultGenesis() json.RawMessage
- func (amb AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
- func (amb AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command
- func (AppModuleBasic) Name() string
- func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
- func (amb AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)
- func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
- type GenesisState
- type Keeper
- type Params
- type Plan
- type State
Constants ¶
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 )
const ( RouterKey = "incentive" StoreKey = RouterKey )
const ( ModuleName = "incentive" QuerierRoute = ModuleName DefaultParamspace = ModuleName )
Variables ¶
var ( KeyIncentiveDefaultRewardPerBlock = []byte("incentiveDefaultRewardPerBlock") KeyIncentivePlans = []byte("incentivePlans") )
var ModuleCdc = codec.New()
var (
PoolAddr = sdk.AccAddress(crypto.AddressHash([]byte("incentive_pool")))
)
var (
StateKey = []byte{0x01}
)
Functions ¶
func InitGenesis ¶ added in v0.0.2
func InitGenesis(ctx sdk.Context, keeper Keeper, data GenesisState)
InitGenesis - Init store state from genesis data
func ParamKeyTable ¶ added in v0.0.2
ParamKeyTable type declaration for parameters
func RegisterCodec ¶ added in v0.0.2
Types ¶
type AppModule ¶ added in v0.0.4
type AppModule struct { AppModuleBasic // contains filtered or unexported fields }
___________________________ app module object
func NewAppModule ¶ added in v0.0.4
NewAppModule creates a new AppModule object
func (AppModule) BeginBlock ¶ added in v0.0.4
func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock)
module begin-block
func (AppModule) EndBlock ¶ added in v0.0.4
func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate
module end-block
func (AppModule) ExportGenesis ¶ added in v0.0.4
func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage
module export genesis
func (AppModule) InitGenesis ¶ added in v0.0.4
func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate
module init-genesis
func (AppModule) NewHandler ¶ added in v0.0.4
module handler
func (AppModule) NewQuerierHandler ¶ added in v0.0.4
module querier
func (AppModule) QuerierRoute ¶ added in v0.0.4
module querier route name
func (AppModule) RegisterInvariants ¶ added in v0.0.4
func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry)
register invariants
type AppModuleBasic ¶ added in v0.0.4
type AppModuleBasic struct { }
app module basics object
func (AppModuleBasic) DefaultGenesis ¶ added in v0.0.4
func (AppModuleBasic) DefaultGenesis() json.RawMessage
default genesis state
func (AppModuleBasic) GetQueryCmd ¶ added in v0.0.4
func (amb AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
get the root query command of this module
func (AppModuleBasic) GetTxCmd ¶ added in v0.0.4
func (amb AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command
get the root tx command of this module
func (AppModuleBasic) RegisterCodec ¶ added in v0.0.4
func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
register module codec
func (AppModuleBasic) RegisterRESTRoutes ¶ added in v0.0.4
func (amb AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)
register rest routes
func (AppModuleBasic) ValidateGenesis ¶ added in v0.0.4
func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
module validate genesis
type GenesisState ¶ added in v0.0.2
GenesisState - all asset state that must be provided at genesis
func DefaultGenesisState ¶ added in v0.0.2
func DefaultGenesisState() GenesisState
DefaultGenesisState - Return a default genesis state
func ExportGenesis ¶ added in v0.0.2
func ExportGenesis(ctx sdk.Context, keeper Keeper) GenesisState
ExportGenesis returns a GenesisState for a given context and keeper
func NewGenesisState ¶ added in v0.0.2
func NewGenesisState(state State, param Params) GenesisState
NewGenesisState - Create a new genesis state
func (GenesisState) ValidateGenesis ¶ added in v0.0.4
func (data GenesisState) ValidateGenesis() error
ValidateGenesis performs basic validation of asset genesis data returning an error for any failed validation criteria.
type Params ¶ added in v0.0.2
type Params struct { DefaultRewardPerBlock uint16 `json:"default_reward_per_block"` Plans []Plan `json:"plans"` }
func DefaultParams ¶ added in v0.0.2
func DefaultParams() Params
func (*Params) ParamSetPairs ¶ added in v0.0.2
func (p *Params) ParamSetPairs() params.ParamSetPairs