gov

package
v4.0.1-0...-868bbd5 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProposalIDFromEvents

func ProposalIDFromEvents(events sdk.StringEvents) (uint64, error)

ProposalIDFromEvent returns the proposal id from the given events

func WeightVoteOptionFromEvents

func WeightVoteOptionFromEvents(events sdk.StringEvents) (govtypesv1.WeightedVoteOption, error)

WeightVoteOptionFromEvents returns the vote option from the given events

Types

type DistrModule

type DistrModule interface {
	UpdateParams(height int64) error
}

type MintModule

type MintModule interface {
	UpdateParams(height int64) error
	UpdateInflation() error
}

type Module

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

Module represent x/gov module

func NewModule

func NewModule(
	source govsource.Source,
	distrModule DistrModule,
	mintModule MintModule,
	slashingModule SlashingModule,
	stakingModule StakingModule,
	cdc codec.Codec,
	db *database.Db,
) *Module

NewModule returns a new Module instance

func (*Module) HandleBlock

func (m *Module) HandleBlock(
	b *tmctypes.ResultBlock, blockResults *tmctypes.ResultBlockResults, txs []*juno.Tx, _ *tmctypes.ResultValidators,
) error

HandleBlock implements modules.BlockModule

func (*Module) HandleGenesis

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

HandleGenesis implements modules.Module

func (*Module) HandleMsg

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

HandleMsg implements modules.MessageModule

func (*Module) HandleMsgExec

func (m *Module) HandleMsgExec(index int, _ *authz.MsgExec, _ int, executedMsg sdk.Msg, tx *juno.Tx) error

HandleMsgExec implements modules.AuthzMessageModule

func (*Module) Name

func (m *Module) Name() string

Name implements modules.Module

func (*Module) RegisterPeriodicOperations

func (m *Module) RegisterPeriodicOperations(scheduler *gocron.Scheduler) error

RegisterPeriodicOperations implements modules.PeriodicOperationsModule

func (*Module) UpdateParams

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

UpdateParams updates the governance parameters for the given height

func (*Module) UpdateProposalStakingPoolSnapshot

func (m *Module) UpdateProposalStakingPoolSnapshot(height int64, proposalID uint64) error

UpdateProposalStakingPoolSnapshot updates the staking pool snapshot associated with the gov proposal having the provided id

func (*Module) UpdateProposalStatus

func (m *Module) UpdateProposalStatus(height int64, id uint64) error

UpdateProposalStatus queries the latest details of given proposal ID, updates it's status in database and handles changes if the proposal has been passed.

func (*Module) UpdateProposalTallyResult

func (m *Module) UpdateProposalTallyResult(proposalID uint64, height int64) error

UpdateProposalTallyResult updates the tally result associated with the given proposal ID

func (*Module) UpdateProposalsStakingPoolSnapshot

func (m *Module) UpdateProposalsStakingPoolSnapshot() error

UpdateProposalsStakingPoolSnapshot updates staking pool snapshots for active proposals

func (*Module) UpdateProposalsTallyResults

func (m *Module) UpdateProposalsTallyResults() error

UpdateProposalsTallyResults updates the tally for active proposals

type SlashingModule

type SlashingModule interface {
	UpdateParams(height int64) error
}

type StakingModule

type StakingModule interface {
	GetStakingPoolSnapshot(height int64) (*types.PoolSnapshot, error)
	UpdateParams(height int64) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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