types

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2025 License: Apache-2.0 Imports: 16 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 (
	// ModuleName is the name of the module
	ModuleName = "vote"

	// RouterKey to be used for routing msgs
	RouterKey = ModuleName
)
View Source
const (
	ProposeConst    = "propose"
	VoteConst       = "vote"
	StartPollConst  = "start_poll"
	AnswerPollConst = "answer_poll"
)
View Source
const (
	QueryParams     = "params"
	QueryGovernment = "government"
	QueryCurrent    = "current"
	QueryStatus     = "status"
	QueryHistory    = "history"
)

Query endpoints supported by the vote querier

Variables

View Source
var (
	// Signer not in government list
	ErrSignerNotAllowed          = sdkerrors.Register(ModuleName, 1, "signer not in government list")
	ErrOtherActive               = sdkerrors.Register(ModuleName, 2, "other proposal is active")
	ErrAlreadyVoted              = sdkerrors.Register(ModuleName, 3, "already voted")
	ErrNoActiveProposals         = sdkerrors.Register(ModuleName, 4, "no active proposals to vote")
	ErrProposalGovernorExists    = sdkerrors.Register(ModuleName, 5, "candidate already in government list")
	ErrProposalGovernorNotExists = sdkerrors.Register(ModuleName, 6, "candidate not in government list")
	ErrProposalGovernorLast      = sdkerrors.Register(ModuleName, 7, "cannot remove the last governor")
	ErrNoActivePoll              = sdkerrors.Register(ModuleName, 8, "no active poll")
	ErrRespondentNotAllowed      = sdkerrors.Register(ModuleName, 9, "poll requirements don't match")
	ErrInvalidSigner             = sdkerrors.Register(ModuleName, 10, "invalid signer for proposed message")
	ErrUnroutableProposalMsg     = sdkerrors.Register(ModuleName, 11, "no route for proposed message")
)
View Source
var (
	KeyGovernment       = []byte{0x01}
	KeyAgreedMembers    = []byte{0x02}
	KeyDisagreedMembers = []byte{0x03}
	KeyCurrentVote      = []byte{0x04}
	KeyTotalVotes       = []byte{0x05}
	KeyTotalAgreed      = []byte{0x06}
	KeyTotalDisagreed   = []byte{0x07}
	KeyStartBlock       = []byte{0x08}
	KeyHistoryPrefix    = []byte{0x09}

	KeyPollPrefix   = []byte{0x0A}
	KeyPollCurrent  = []byte{0x0B}
	KeyPollAnswers  = []byte{0x0C}
	KeyPollYesCount = []byte{0x0D}
	KeyPollNoCount  = []byte{0x0E}
	KeyPollHistory  = []byte{0x0F}

	KeyParams           = collections.NewPrefix([]byte{0x10})
	KeyProposalSchedule = []byte{0x11}
	KeyPollSchedule     = []byte{0x12}

	ValueYes = []byte{0x01}
	ValueNo  = []byte{0x00}
)
View Source
var (
	DefaultvotePeriod int32 = 24 * 60
)

Parameter store keys

View Source
var (
	ModuleCdc = codec.NewAminoCodec(amino)
)

Functions

func GetPollAnswersPrefixedKey

func GetPollAnswersPrefixedKey(key []byte) []byte

func GetPollPrefixedKey

func GetPollPrefixedKey(key []byte) []byte

func RegisterInterfaces

func RegisterInterfaces(registry types.InterfaceRegistry)

func RegisterLegacyAminoCodec

func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)

RegisterCodec registers concrete types on codec

func ValidateGenesis

func ValidateGenesis(data GenesisState) error

ValidateGenesis validates the vote genesis parameters

Types

type AccountKeeper

type AccountKeeper interface {
	AddressCodec() address.Codec
	GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI
}

AccountKeeper defines the expected account keeper used for simulations (noalias)

type ReferralKeeper

type ReferralKeeper interface {
	Get(ctx sdk.Context, acc string) (referral.Info, error)
}

Jump to

Keyboard shortcuts

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