staking

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2022 License: Apache-2.0 Imports: 24 Imported by: 1

Documentation

Overview

nolint autogenerated code using github.com/rigelrozanski/multitool aliases generated for the following subdirectories: ALIASGEN: github.com/okex/exchain/x/staking/keeper ALIASGEN: github.com/okex/exchain/x/staking/types ALIASGEN: github.com/okex/exchain/x/staking/exported

Index

Constants

View Source
const (
	DefaultParamspace = keeper.DefaultParamspace
	ModuleName        = types.ModuleName
	StoreKey          = types.StoreKey
	TStoreKey         = types.TStoreKey
	QuerierRoute      = types.QuerierRoute
	RouterKey         = types.RouterKey
	NotBondedPoolName = types.NotBondedPoolName
	BondedPoolName    = types.BondedPoolName
	QueryParameters   = types.QueryParameters
)

Variables

View Source
var (
	// functions aliases
	NewKeeper                          = keeper.NewKeeper
	NewQuerier                         = keeper.NewQuerier
	RegisterCodec                      = types.RegisterCodec
	NewCommission                      = types.NewCommission
	ErrNoValidatorFound                = types.ErrNoValidatorFound
	ErrValidatorOwnerExists            = types.ErrValidatorOwnerExists
	ErrValidatorPubKeyExists           = types.ErrValidatorPubKeyExists
	ErrValidatorPubKeyTypeNotSupported = types.ErrValidatorPubKeyTypeNotSupported
	ErrBadDenom                        = types.ErrBadDenom
	DefaultGenesisState                = types.DefaultGenesisState
	NewMultiStakingHooks               = types.NewMultiStakingHooks
	GetValidatorsByPowerIndexKey       = types.GetValidatorsByPowerIndexKey
	NewMsgCreateValidator              = types.NewMsgCreateValidator
	NewMsgEditValidator                = types.NewMsgEditValidator
	NewMsgDeposit                      = types.NewMsgDeposit
	NewMsgWithdraw                     = types.NewMsgWithdraw
	DefaultParams                      = types.DefaultParams
	NewValidator                       = types.NewValidator
	NewDescription                     = types.NewDescription
	NewMsgAddShares                    = types.NewMsgAddShares
	NewGenesisState                    = types.NewGenesisState
	DelegatorAddSharesInvariant        = keeper.DelegatorAddSharesInvariant

	// variable aliases
	ModuleCdc     = types.ModuleCdc
	ValidatorsKey = types.ValidatorsKey
)

Functions

func EndBlocker

func EndBlocker(ctx sdk.Context, k keeper.Keeper) []abci.ValidatorUpdate

EndBlocker is called every block, update validator set

func ExportGenesis

func ExportGenesis(ctx sdk.Context, keeper Keeper) types.GenesisState

ExportGenesis returns a GenesisState for a given context and keeper The GenesisState will contain the pool, params, validators, and bonds found in the keeper

func GetLatestGenesisValidator

func GetLatestGenesisValidator(ctx sdk.Context, keeper Keeper) (vals []tmtypes.GenesisValidator)

GetLatestGenesisValidator returns a slice of bonded genesis validators

func InitGenesis

func InitGenesis(ctx sdk.Context, keeper Keeper, accountKeeper types.AccountKeeper,
	supplyKeeper types.SupplyKeeper, data types.GenesisState) (res []abci.ValidatorUpdate)

InitGenesis sets the pool and parameters for the provided keeper For each validator in data, it sets that validator in the keeper along with manually setting the indexes In addition, it also sets any delegations found in data Finally, it updates the bonded validators Returns final validator set after applying all declaration and delegations

func NewHandler

func NewHandler(k keeper.Keeper) sdk.Handler

NewHandler manages all tx treatment

func StringInSlice

func StringInSlice(a string, list []string) bool

StringInSlice returns true if a is found the list.

func ValidateGenesis

func ValidateGenesis(data types.GenesisState) error

ValidateGenesis validates the provided staking genesis state to ensure the expected invariants holds (i.e. params in correct bounds, no duplicate validators)

Types

type AppModule

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

AppModule is a struct of app module

func NewAppModule

func NewAppModule(keeper Keeper, accKeeper types.AccountKeeper,
	supplyKeeper types.SupplyKeeper) AppModule

NewAppModule creates a new AppModule object

func (AppModule) BeginBlock

func (AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock)

BeginBlock is invoked on the beginning of each block

func (AppModule) EndBlock

EndBlock is invoked on the end of each block

func (AppModule) ExportGenesis

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

ExportGenesis exports module genesis

func (AppModule) GenerateGenesisState

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

GenerateGenesisState performs a no-op.

func (AppModule) InitGenesis

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

InitGenesis initializes module genesis

func (AppModule) NewHandler

func (am AppModule) NewHandler() sdk.Handler

NewHandler returns module handler

func (AppModule) NewQuerierHandler

func (am AppModule) NewQuerierHandler() sdk.Querier

NewQuerierHandler returns module querier

func (AppModule) ProposalContents

func (am AppModule) ProposalContents(simState module.SimulationState) []sim.WeightedProposalContent

ProposalContents returns all the params content functions used to simulate governance proposals.

func (AppModule) QuerierRoute

func (AppModule) QuerierRoute() string

QuerierRoute returns the staking module's querier route name.

func (AppModule) RandomizedParams

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

RandomizedParams creates randomized distribution param changes for the simulator.

func (AppModule) RegisterInvariants

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

RegisterInvariants registers invariants

func (AppModule) RegisterStoreDecoder

func (AppModule) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry)

RegisterStoreDecoder doesn't register any type.

func (AppModule) Route

func (AppModule) Route() string

Route returns the message routing key for the staking module.

func (AppModule) WeightedOperations

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

WeightedOperations returns the all the gov module operations with their respective weights.

type AppModuleBasic

type AppModuleBasic struct{}

AppModuleBasic is a struct of app module basics object

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 *flag.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

func (AppModuleBasic) GetQueryCmd

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

GetQueryCmd gets the root query command of this module

func (AppModuleBasic) GetTxCmd

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

GetTxCmd gets the root tx command of this module

func (AppModuleBasic) Name

func (AppModuleBasic) Name() string

Name returns the staking module's name.

func (AppModuleBasic) PrepareFlagsForTxCreateValidator

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

PrepareFlagsForTxCreateValidator is used for gen-tx

func (AppModuleBasic) RegisterCodec

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

RegisterCodec registers module codec

func (AppModuleBasic) RegisterRESTRoutes

func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)

RegisterRESTRoutes registers rest routes

func (AppModuleBasic) ValidateGenesis

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

ValidateGenesis give a validity check to module genesis

type Delegator

type Delegator = types.Delegator

type Description

type Description = types.Description

type GenesisState

type GenesisState = types.GenesisState

type Keeper

type Keeper = keeper.Keeper

type ProxyDelegatorKeyExported

type ProxyDelegatorKeyExported = types.ProxyDelegatorKeyExported

type SharesResponses

type SharesResponses = types.SharesResponses

type UndelegationInfo

type UndelegationInfo = types.UndelegationInfo

type Validator

type Validator = types.Validator

type ValidatorExport

type ValidatorExport = types.ValidatorExported

type ValidatorI

type ValidatorI = exported.ValidatorI

type Validators

type Validators = types.Validators

Directories

Path Synopsis
client
cli
legacy
nolint
nolint

Jump to

Keyboard shortcuts

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