gov

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxDescriptionLength  = types.MaxDescriptionLength
	MaxTitleLength        = types.MaxTitleLength
	DefaultPeriod         = types.DefaultPeriod
	ModuleName            = types.ModuleName
	StoreKey              = types.StoreKey
	RouterKey             = types.RouterKey
	QuerierRoute          = types.QuerierRoute
	DefaultParamspace     = types.DefaultParamspace
	TypeMsgDeposit        = types.TypeMsgDeposit
	TypeMsgVote           = types.TypeMsgVote
	TypeMsgSubmitProposal = types.TypeMsgSubmitProposal
	StatusNil             = types.StatusNil
	StatusDepositPeriod   = types.StatusDepositPeriod
	StatusVotingPeriod    = types.StatusVotingPeriod
	StatusPassed          = types.StatusPassed
	StatusRejected        = types.StatusRejected
	StatusFailed          = types.StatusFailed
	ProposalTypeText      = types.ProposalTypeText
	QueryParams           = types.QueryParams
	QueryProposals        = types.QueryProposals
	QueryProposal         = types.QueryProposal
	QueryDeposits         = types.QueryDeposits
	QueryDeposit          = types.QueryDeposit
	QueryVotes            = types.QueryVotes
	QueryVote             = types.QueryVote
	QueryTally            = types.QueryTally
	ParamDeposit          = types.ParamDeposit
	ParamVoting           = types.ParamVoting
	ParamTallying         = types.ParamTallying
	OptionEmpty           = types.OptionEmpty
	OptionYes             = types.OptionYes
	OptionAbstain         = types.OptionAbstain
	OptionNo              = types.OptionNo
	OptionNoWithVeto      = types.OptionNoWithVeto
)

Variables

View Source
var (
	// functions aliases
	RegisterInvariants            = keeper.RegisterInvariants
	AllInvariants                 = keeper.AllInvariants
	ModuleAccountInvariant        = keeper.ModuleAccountInvariant
	NewKeeper                     = keeper.NewKeeper
	NewQuerier                    = keeper.NewQuerier
	RegisterCodec                 = types.RegisterCodec
	RegisterProposalTypeCodec     = types.RegisterProposalTypeCodec
	ValidateAbstract              = types.ValidateAbstract
	NewDeposit                    = types.NewDeposit
	ErrUnknownProposal            = types.ErrUnknownProposal
	ErrInactiveProposal           = types.ErrInactiveProposal
	ErrAlreadyActiveProposal      = types.ErrAlreadyActiveProposal
	ErrInvalidProposalContent     = types.ErrInvalidProposalContent
	ErrInvalidProposalType        = types.ErrInvalidProposalType
	ErrInvalidVote                = types.ErrInvalidVote
	ErrInvalidGenesis             = types.ErrInvalidGenesis
	ErrNoProposalHandlerExists    = types.ErrNoProposalHandlerExists
	NewGenesisState               = types.NewGenesisState
	DefaultGenesisState           = types.DefaultGenesisState
	ValidateGenesis               = types.ValidateGenesis
	GetProposalIDBytes            = types.GetProposalIDBytes
	GetProposalIDFromBytes        = types.GetProposalIDFromBytes
	ProposalKey                   = types.ProposalKey
	ActiveProposalByTimeKey       = types.ActiveProposalByTimeKey
	ActiveProposalQueueKey        = types.ActiveProposalQueueKey
	InactiveProposalByTimeKey     = types.InactiveProposalByTimeKey
	InactiveProposalQueueKey      = types.InactiveProposalQueueKey
	DepositsKey                   = types.DepositsKey
	DepositKey                    = types.DepositKey
	VotesKey                      = types.VotesKey
	VoteKey                       = types.VoteKey
	SplitProposalKey              = types.SplitProposalKey
	SplitActiveProposalQueueKey   = types.SplitActiveProposalQueueKey
	SplitInactiveProposalQueueKey = types.SplitInactiveProposalQueueKey
	SplitKeyDeposit               = types.SplitKeyDeposit
	SplitKeyVote                  = types.SplitKeyVote
	NewMsgSubmitProposal          = types.NewMsgSubmitProposal
	NewMsgSubmitProposalBase      = types.NewMsgSubmitProposalBase
	NewMsgDeposit                 = types.NewMsgDeposit
	NewMsgVote                    = types.NewMsgVote
	ParamKeyTable                 = types.ParamKeyTable
	NewDepositParams              = types.NewDepositParams
	NewTallyParams                = types.NewTallyParams
	NewVotingParams               = types.NewVotingParams
	NewParams                     = types.NewParams
	NewProposal                   = types.NewProposal
	NewRouter                     = types.NewRouter
	ProposalStatusFromString      = types.ProposalStatusFromString
	ValidProposalStatus           = types.ValidProposalStatus
	NewTextProposal               = types.NewTextProposal
	RegisterProposalType          = types.RegisterProposalType
	ContentFromProposalType       = types.ContentFromProposalType
	IsValidProposalType           = types.IsValidProposalType
	ProposalHandler               = types.ProposalHandler
	NewQueryProposalParams        = types.NewQueryProposalParams
	NewQueryDepositParams         = types.NewQueryDepositParams
	NewQueryVoteParams            = types.NewQueryVoteParams
	NewQueryProposalsParams       = types.NewQueryProposalsParams
	NewValidatorGovInfo           = types.NewValidatorGovInfo
	NewTallyResult                = types.NewTallyResult
	NewTallyResultFromMap         = types.NewTallyResultFromMap
	EmptyTallyResult              = types.EmptyTallyResult
	NewVote                       = types.NewVote
	VoteOptionFromString          = types.VoteOptionFromString
	ValidVoteOption               = types.ValidVoteOption

	// variable aliases
	ModuleCdc                   = types.ModuleCdc
	ProposalsKeyPrefix          = types.ProposalsKeyPrefix
	ActiveProposalQueuePrefix   = types.ActiveProposalQueuePrefix
	InactiveProposalQueuePrefix = types.InactiveProposalQueuePrefix
	ProposalIDKey               = types.ProposalIDKey
	DepositsKeyPrefix           = types.DepositsKeyPrefix
	VotesKeyPrefix              = types.VotesKeyPrefix
	ParamStoreKeyDepositParams  = types.ParamStoreKeyDepositParams
	ParamStoreKeyVotingParams   = types.ParamStoreKeyVotingParams
	ParamStoreKeyTallyParams    = types.ParamStoreKeyTallyParams
)

Functions

func EndBlocker

func EndBlocker(ctx sdk.Context, keeper Keeper)

EndBlocker called every block, process inflation, update validator set.

func InitGenesis

func InitGenesis(ctx sdk.Context, ak types.AccountKeeper, bk types.BankKeeper, k Keeper, data GenesisState)

InitGenesis - store genesis parameters

func NewHandler

func NewHandler(keeper Keeper) sdk.Handler

NewHandler creates an sdk.Handler for all the gov type messages

Types

type AppModule added in v1.0.0

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

AppModule implements an application module for the gov module.

func NewAppModule added in v1.0.0

func NewAppModule(cdc Codec, keeper Keeper, ak types.AccountKeeper, bk types.BankKeeper) AppModule

NewAppModule creates a new AppModule object

func (AppModule) BeginBlock added in v1.0.0

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

BeginBlock performs a no-op.

func (AppModule) EndBlock added in v1.0.0

EndBlock returns the end blocker for the gov module. It returns no validator updates.

func (AppModule) ExportGenesis added in v1.0.0

func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONMarshaler) json.RawMessage

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

func (AppModule) GenerateGenesisState added in v1.0.0

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

GenerateGenesisState creates a randomized GenState of the gov module.

func (AppModule) InitGenesis added in v1.0.0

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

InitGenesis performs genesis initialization for the gov module. It returns no validator updates.

func (AppModule) Name added in v1.0.0

func (AppModule) Name() string

Name returns the gov module's name.

func (AppModule) NewHandler added in v1.0.0

func (am AppModule) NewHandler() sdk.Handler

NewHandler returns an sdk.Handler for the gov module.

func (AppModule) NewQuerierHandler added in v1.0.0

func (am AppModule) NewQuerierHandler() sdk.Querier

NewQuerierHandler returns no sdk.Querier.

func (AppModule) ProposalContents added in v1.0.0

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

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

func (AppModule) QuerierRoute added in v1.0.0

func (AppModule) QuerierRoute() string

QuerierRoute returns the gov module's querier route name.

func (AppModule) RandomizedParams added in v1.0.0

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

RandomizedParams creates randomized gov param changes for the simulator.

func (AppModule) RegisterInvariants added in v1.0.0

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

RegisterInvariants registers module invariants

func (AppModule) RegisterStoreDecoder added in v1.0.0

func (am AppModule) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry)

RegisterStoreDecoder registers a decoder for gov module's types

func (AppModule) Route added in v1.0.0

func (AppModule) Route() string

Route returns the message routing key for the gov module.

func (AppModule) WeightedOperations added in v1.0.0

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

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

type AppModuleBasic added in v1.0.0

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

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

func NewAppModuleBasic added in v1.0.0

func NewAppModuleBasic(proposalHandlers ...client.ProposalHandler) AppModuleBasic

NewAppModuleBasic creates a new AppModuleBasic object

func (AppModuleBasic) DefaultGenesis added in v1.0.0

func (AppModuleBasic) DefaultGenesis(cdc codec.JSONMarshaler) json.RawMessage

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

func (AppModuleBasic) GetQueryCmd added in v1.0.0

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

GetQueryCmd returns the root query command for the gov module.

func (AppModuleBasic) GetTxCmd added in v1.0.0

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

GetTxCmd returns the root tx command for the gov module.

func (AppModuleBasic) Name added in v1.0.0

func (AppModuleBasic) Name() string

Name returns the gov module's name.

func (AppModuleBasic) RegisterCodec added in v1.0.0

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

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

func (AppModuleBasic) RegisterRESTRoutes added in v1.0.0

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

RegisterRESTRoutes registers the REST routes for the gov module.

func (AppModuleBasic) ValidateGenesis added in v1.0.0

func (AppModuleBasic) ValidateGenesis(cdc codec.JSONMarshaler, bz json.RawMessage) error

ValidateGenesis performs genesis state validation for the gov module.

type Codec added in v1.0.0

type Codec = types.Codec

type Content added in v1.0.0

type Content = types.Content

type Deposit

type Deposit = types.Deposit

type DepositParams added in v0.26.0

type DepositParams = types.DepositParams

type Deposits added in v0.30.0

type Deposits = types.Deposits

type GenesisState

type GenesisState = types.GenesisState

func ExportGenesis added in v0.26.0

func ExportGenesis(ctx sdk.Context, k Keeper) GenesisState

ExportGenesis - output genesis parameters

type Handler added in v1.0.0

type Handler = types.Handler

type Keeper

type Keeper = keeper.Keeper

type MsgDeposit

type MsgDeposit = types.MsgDeposit

type MsgSubmitProposal

type MsgSubmitProposal = types.MsgSubmitProposal

type MsgSubmitProposalBase added in v1.0.0

type MsgSubmitProposalBase = types.MsgSubmitProposalBase

type MsgSubmitProposalI added in v1.0.0

type MsgSubmitProposalI = types.MsgSubmitProposalI

type MsgVote

type MsgVote = types.MsgVote

type Params added in v0.30.0

type Params = types.Params

type Proposal

type Proposal = types.Proposal

type ProposalQueue

type ProposalQueue = types.ProposalQueue

type ProposalStatus added in v0.21.0

type ProposalStatus = types.ProposalStatus

type Proposals added in v0.30.0

type Proposals = types.Proposals

type QueryDepositParams added in v0.25.0

type QueryDepositParams = types.QueryDepositParams

type QueryProposalParams added in v0.25.0

type QueryProposalParams = types.QueryProposalParams

type QueryProposalsParams added in v0.25.0

type QueryProposalsParams = types.QueryProposalsParams

type QueryVoteParams added in v0.25.0

type QueryVoteParams = types.QueryVoteParams

type TallyParams added in v0.26.0

type TallyParams = types.TallyParams

type TallyResult added in v0.24.0

type TallyResult = types.TallyResult

type TextProposal

type TextProposal = types.TextProposal

type ValidatorGovInfo added in v1.0.0

type ValidatorGovInfo = types.ValidatorGovInfo

type Vote

type Vote = types.Vote

type VoteOption

type VoteOption = types.VoteOption

type Votes added in v0.30.0

type Votes = types.Votes

type VotingParams added in v0.26.0

type VotingParams = types.VotingParams

Directories

Path Synopsis
cli
legacy
v0_34
DONTCOVER nolint
DONTCOVER nolint
v0_36
DONTCOVER nolint
DONTCOVER nolint

Jump to

Keyboard shortcuts

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