staking

package
v0.0.0-...-b9e5fcc Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: MIT Imports: 24 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ErrDelegationNotFound = "rpc error: code = %s desc = rpc error: code = %s"
)

Variables

This section is empty.

Functions

func ConvertDelegationsResponses

func ConvertDelegationsResponses(height int64, responses []stakingtypes.DelegationResponse) []types.Delegation

ConvertDelegationsResponses converts the given responses to BDJuno Delegation instances

Types

type BankModule

type BankModule interface {
	RefreshBalances(height int64, addresses []string) error
}

type DistrModule

type DistrModule interface {
	RefreshDelegatorRewards(height int64, delegator string) error
}

type HistoryModule

type HistoryModule interface {
	UpdateAccountBalanceHistoryWithTime(address string, time time.Time) error
}

type Module

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

Module represents the x/staking module

func NewModule

func NewModule(
	source stakingsource.Source,
	bankModule BankModule, distrModule DistrModule, historyModule HistoryModule, slashingModule SlashingModule,
	cdc codec.Marshaler, 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) RefreshValidatorDelegations

func (m *Module) RefreshValidatorDelegations(height int64, valOperAddr string) error

RefreshValidatorDelegations refreshes the delegations for the validator with the given consensus address

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