staking

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2022 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Module

type Module struct {
	// contains filtered or unexported fields
}

Module represents the x/staking module

func NewModule

func NewModule(
	source stakingsource.Source, slashingModule SlashingModule,
	cdc codec.Codec, db *database.Db,
) *Module

NewModule returns a new Module instance

func (*Module) GetStakingPool

func (m *Module) GetStakingPool(height int64) (*types.Pool, error)

func (*Module) GetValidatorsStatuses

func (m *Module) GetValidatorsStatuses(height int64, validators []stakingtypes.Validator) ([]types.ValidatorStatus, error)

func (*Module) GetValidatorsVotingPowers

func (m *Module) GetValidatorsVotingPowers(height int64, vals *tmctypes.ResultValidators) ([]types.ValidatorVotingPower, error)

func (*Module) GetValidatorsWithStatus

func (m *Module) GetValidatorsWithStatus(height int64, status string) ([]stakingtypes.Validator, []types.Validator, error)

GetValidatorsWithStatus returns the list of all the validators having the given status at the given height

func (*Module) HandleBlock

func (m *Module) HandleBlock(
	block *tmctypes.ResultBlock, res *tmctypes.ResultBlockResults, _ []*juno.Tx, vals *tmctypes.ResultValidators,
) error

HandleBlock implements BlockModule

func (*Module) HandleGenesis

func (m *Module) HandleGenesis(doc *tmtypes.GenesisDoc, appState map[string]json.RawMessage) error

HandleGenesis implements GenesisModule

func (*Module) HandleMsg

func (m *Module) HandleMsg(index int, msg sdk.Msg, tx *juno.Tx) error

HandleMsg implements MessageModule

func (*Module) Name

func (m *Module) Name() string

Name implements modules.Module

func (*Module) RefreshValidatorInfos

func (m *Module) RefreshValidatorInfos(height int64, valOper string) error

RefreshValidatorInfos refreshes the info for the validator with the given operator address at the provided height

func (*Module) StoreValidatorsFromMsgCreateValidator

func (m *Module) StoreValidatorsFromMsgCreateValidator(height int64, msg *stakingtypes.MsgCreateValidator) error

StoreValidatorFromMsgCreateValidator handles properly a MsgCreateValidator instance by saving into the database all the data associated to such validator

func (*Module) UpdateParams

func (m *Module) UpdateParams(height int64) error

UpdateParams gets the updated params and stores them inside the database

type SlashingModule

type SlashingModule interface {
	GetSigningInfo(height int64, consAddr sdk.ConsAddress) (types.ValidatorSigningInfo, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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