staking

package
Version: v0.0.0-...-f2ae4c7 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2020 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package staking defines the staking module.

Index

Constants

View Source
const (
	ModuleName        = staking.ModuleName
	StoreKey          = staking.StoreKey
	BondedPoolName    = staking.BondedPoolName
	NotBondedPoolName = staking.NotBondedPoolName
	TStoreKey         = staking.TStoreKey
	DefaultParamspace = staking.DefaultParamspace
)

Variables

View Source
var (
	// function aliases
	NewKeeper            = staking.NewKeeper
	RegisterCodec        = staking.RegisterCodec
	InitGenesis          = staking.InitGenesis
	DefaultParams        = staking.DefaultParams
	NewMultiStakingHooks = staking.NewMultiStakingHooks
)
View Source
var ErrUnauthorizedValidator = sdkerrors.Register(stakingTypes.ModuleName, 201, "only certified full nodes can become validators")

ErrUnauthorizedValidator is the SDK error for creating validators from non-certified full nodes.

Functions

func NewHandler

func NewHandler(k keeper.Keeper, ck types.CertKeeper) sdk.Handler

NewHandler returns a customized staking message handler.

Types

type AppModule

type AppModule struct {
	AppModuleBasic
	// contains filtered or unexported fields
}

AppModule implements an application module for the staking module.

func NewAppModule

func NewAppModule(
	stakingKeeper staking.Keeper,
	accountKeeper stakingTypes.AccountKeeper,
	supplyKeeper stakingTypes.SupplyKeeper,
	certKeeper types.CertKeeper,
) AppModule

NewAppModule creates a new AppModule object

func (AppModule) BeginBlock

func (am AppModule) BeginBlock(ctx sdk.Context, rbb abci.RequestBeginBlock)

BeginBlock implements the Cosmos SDK BeginBlock module function.

func (AppModule) EndBlock

func (am AppModule) EndBlock(ctx sdk.Context, rbb abci.RequestEndBlock) []abci.ValidatorUpdate

EndBlock implements the Cosmos SDK EndBlock module function.

func (AppModule) ExportGenesis

func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage

ExportGenesis returns the exported genesis state as raw bytes for the staking module.

func (AppModule) InitGenesis

func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate

InitGenesis performs genesis initialization for the staking module.

func (AppModule) Name

func (am AppModule) Name() string

Name returns the staking module's name.

func (AppModule) NewHandler

func (am AppModule) NewHandler() sdk.Handler

NewHandler returns an sdk.Handler for the staking module.

func (AppModule) NewQuerierHandler

func (am AppModule) NewQuerierHandler() sdk.Querier

NewQuerierHandler returns the staking module sdk.Querier.

func (AppModule) ProposalContents

ProposalContents returns functions that generate proposals for the module.

func (AppModule) QuerierRoute

func (am AppModule) QuerierRoute() string

QuerierRoute returns the staking module's querier route name.

func (AppModule) RegisterInvariants

func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry)

RegisterInvariants registers the staking module invariants.

func (AppModule) Route

func (am AppModule) Route() string

Route returns the message routing key for the staking module.

func (AppModule) WeightedOperations

func (am AppModule) WeightedOperations(simState module.SimulationState) []sim.WeightedOperation

WeightedOperations returns staking operations for use in simulations.

type AppModuleBasic

type AppModuleBasic struct{}

AppModuleBasic defines the basic application module used by the staking module.

func (AppModuleBasic) BuildCreateValidatorMsg

func (AppModuleBasic) BuildCreateValidatorMsg(cliCtx context.CLIContext,
	txBldr authtypes.TxBuilder) (authtypes.TxBuilder, sdk.Msg, error)

BuildCreateValidatorMsg is used for gen-tx.

func (AppModuleBasic) CreateValidatorMsgHelpers

func (AppModuleBasic) CreateValidatorMsgHelpers(ipDefault string) (
	fs *pflag.FlagSet, nodeIDFlag, pubkeyFlag, amountFlag, defaultsDesc string)

CreateValidatorMsgHelpers is used for gen-tx.

func (AppModuleBasic) DefaultGenesis

func (AppModuleBasic) DefaultGenesis() json.RawMessage

DefaultGenesis returns default genesis state as raw bytes for the staking module.

func (AppModuleBasic) GenerateGenesisState

func (AppModuleBasic) GenerateGenesisState(simState *module.SimulationState)

GenerateGenesisState creates a randomized GenState of this module.

func (AppModuleBasic) GetQueryCmd

func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command

GetQueryCmd returns the root query command for the staking module.

func (AppModuleBasic) GetTxCmd

func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command

GetTxCmd returns the root tx command for the staking module.

func (AppModuleBasic) Name

func (AppModuleBasic) Name() string

Name returns the staking module's name.

func (AppModuleBasic) PrepareFlagsForTxCreateValidator

func (AppModuleBasic) PrepareFlagsForTxCreateValidator(cfg *config.Config, nodeID,
	chainID string, valPubKey crypto.PubKey)

PrepareFlagsForTxCreateValidator is used for gen-tx.

func (AppModuleBasic) RandomizedParams

func (AppModuleBasic) RandomizedParams(r *rand.Rand) []sim.ParamChange

RandomizedParams returns functions that generate params for the module.

func (AppModuleBasic) RegisterCodec

func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)

RegisterCodec registers the staking module's types for the given codec.

func (AppModuleBasic) RegisterRESTRoutes

func (AppModuleBasic) RegisterRESTRoutes(cliCtx context.CLIContext, route *mux.Router)

RegisterRESTRoutes registers the REST routes for the staking module.

func (AppModuleBasic) RegisterStoreDecoder

func (AppModuleBasic) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry)

RegisterStoreDecoder registers a decoder for staking module.

func (AppModuleBasic) ValidateGenesis

func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error

ValidateGenesis performs genesis state validation for the staking module.

type Keeper

type Keeper = staking.Keeper

Directories

Path Synopsis
client
internal

Jump to

Keyboard shortcuts

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