types

package
v0.0.0-...-391a657 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ModuleName is the name of the module
	ModuleName = "voter"

	// StoreKey to be used when creating the KVStore
	StoreKey = ModuleName

	// RouterKey to be used for routing msgs
	RouterKey = ModuleName

	// QuerierRoute to be used for querier msgs
	QuerierRoute = ModuleName
)
View Source
const (
	AttributeValueCategory = ModuleName
)

voter module event types

View Source
const (
	DefaultParamspace = ModuleName
)

Default parameter namespace

View Source
const (
	PollPrefix = "poll-"
)
View Source
const (
	QueryListPoll = "list-poll"
)
View Source
const (
	QueryListVote = "list-vote"
)
View Source
const (
	VotePrefix = "vote-"
)

Variables

View Source
var (
	ErrInvalid = sdkerrors.Register(ModuleName, 1, "custom error message")
)
View Source
var ModuleCdc *codec.Codec

ModuleCdc defines the module codec

Functions

func ParamKeyTable

func ParamKeyTable() params.KeyTable

ParamKeyTable for voter module

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers concrete types on codec

func ValidateGenesis

func ValidateGenesis(data GenesisState) error

ValidateGenesis validates the voter genesis parameters

Types

type GenesisState

type GenesisState struct {
}

GenesisState - all voter state that must be provided at genesis

func DefaultGenesisState

func DefaultGenesisState() GenesisState

DefaultGenesisState - default GenesisState used by Cosmos Hub

func NewGenesisState

func NewGenesisState() GenesisState

NewGenesisState creates a new GenesisState object

type MsgCreatePoll

type MsgCreatePoll struct {
	ID      string
	Creator sdk.AccAddress `json:"creator" yaml:"creator"`
	Title   string         `json:"title" yaml:"title"`
	Options []string       `json:"options" yaml:"options"`
}

func NewMsgCreatePoll

func NewMsgCreatePoll(creator sdk.AccAddress, title string, options []string) MsgCreatePoll

func (MsgCreatePoll) GetSignBytes

func (msg MsgCreatePoll) GetSignBytes() []byte

func (MsgCreatePoll) GetSigners

func (msg MsgCreatePoll) GetSigners() []sdk.AccAddress

func (MsgCreatePoll) Route

func (msg MsgCreatePoll) Route() string

func (MsgCreatePoll) Type

func (msg MsgCreatePoll) Type() string

func (MsgCreatePoll) ValidateBasic

func (msg MsgCreatePoll) ValidateBasic() error

type MsgCreateVote

type MsgCreateVote struct {
	ID      string
	Creator sdk.AccAddress `json:"creator" yaml:"creator"`
	PollID  string         `json:"pollID" yaml:"pollID"`
	Value   string         `json:"value" yaml:"value"`
}

func NewMsgCreateVote

func NewMsgCreateVote(creator sdk.AccAddress, pollID string, value string) MsgCreateVote

func (MsgCreateVote) GetSignBytes

func (msg MsgCreateVote) GetSignBytes() []byte

func (MsgCreateVote) GetSigners

func (msg MsgCreateVote) GetSigners() []sdk.AccAddress

func (MsgCreateVote) Route

func (msg MsgCreateVote) Route() string

func (MsgCreateVote) Type

func (msg MsgCreateVote) Type() string

func (MsgCreateVote) ValidateBasic

func (msg MsgCreateVote) ValidateBasic() error

type ParamSubspace

type ParamSubspace interface {
	WithKeyTable(table params.KeyTable) params.Subspace
	Get(ctx sdk.Context, key []byte, ptr interface{})
	GetParamSet(ctx sdk.Context, ps params.ParamSet)
	SetParamSet(ctx sdk.Context, ps params.ParamSet)
}

ParamSubspace defines the expected Subspace interfacace

type Params

type Params struct {
}

Params - used for initializing default parameter for voter at genesis

func DefaultParams

func DefaultParams() Params

DefaultParams defines the parameters for this module

func NewParams

func NewParams() Params

NewParams creates a new Params object

func (*Params) ParamSetPairs

func (p *Params) ParamSetPairs() params.ParamSetPairs

ParamSetPairs - Implements params.ParamSet

func (Params) String

func (p Params) String() string

String implements the stringer interface for Params

type Poll

type Poll struct {
	Creator sdk.AccAddress `json:"creator" yaml:"creator"`
	ID      string         `json:"id" yaml:"id"`
	Title   string         `json:"title" yaml:"title"`
	Options []string       `json:"options" yaml:"options"`
}

type Vote

type Vote struct {
	Creator sdk.AccAddress `json:"creator" yaml:"creator"`
	ID      string         `json:"id" yaml:"id"`
	PollID  string         `json:"pollID" yaml:"pollID"`
	Value   string         `json:"value" yaml:"value"`
}

Jump to

Keyboard shortcuts

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