types

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueryParams    = gov.QueryParams
	QueryProposals = gov.QueryProposals
	QueryProposal  = gov.QueryProposal
	QueryDeposits  = gov.QueryDeposits
	QueryDeposit   = gov.QueryDeposit
	QueryVotes     = gov.QueryVotes
	QueryVote      = gov.QueryVote
	QueryTally     = gov.QueryTally

	ParamDeposit  = gov.ParamDeposit
	ParamVoting   = gov.ParamVoting
	ParamTallying = gov.ParamTallying
)

query endpoints supported by the governance Querier

View Source
const (
	DefaultCodespace sdk.CodespaceType = ModuleName

	CodeNameDoesNotExist sdk.CodeType = 101
)
View Source
const (
	// ModuleName is the name of the module
	ModuleName = "votum"

	// StoreKey is the store key string for votum
	StoreKey = ModuleName

	// RouterKey is the message route for votum
	RouterKey = ModuleName

	// QuerierRoute is the querier route for votum
	QuerierRoute = ModuleName

	// DefaultParamspace default name for parameter store
	DefaultParamspace = ModuleName
)
View Source
const (
	TypeMsgDeposit        = "deposit"
	TypeMsgVote           = "vote"
	TypeMsgSubmitProposal = "submit_proposal"
)

Governance message types and routes

View Source
const (
	ProposalTypeText string = "Text"
)

Proposal types

Variables

View Source
var (
	NewQueryProposalParams  = gov.NewQueryProposalParams
	NewQueryDepositParams   = gov.NewQueryDepositParams
	NewQueryVoteParams      = gov.NewQueryVoteParams
	NewQueryProposalsParams = gov.NewQueryProposalsParams
)
View Source
var (
	ErrInvalidProposalContent   = gov.ErrInvalidProposalContent
	ProposalTypeSoftwareUpgrade = gov.ProposalTypeSoftwareUpgrade
	ErrInvalidProposalType      = gov.ErrInvalidProposalType
	IsValidProposalType         = gov.IsValidProposalType
	ValidVoteOption             = gov.ValidVoteOption
	ErrInvalidVote              = gov.ErrInvalidVote
)
View Source
var ModuleCdc = codec.New()

Functions

func ErrNameDoesNotExist

func ErrNameDoesNotExist(codespace sdk.CodespaceType) sdk.Error

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec codecでencode/decodeするためにtypesを登録する

Types

type Content

type Content interface {
	gov.Content
}

func ContentFromProposalType

func ContentFromProposalType(title, desc, ty string) Content

ContentFromProposalType returns a Content object based on the proposal type.

func NewTextProposal

func NewTextProposal(title, description string) Content

type Issuers

type Issuers struct {
	Owner  sdk.AccAddress
	Tokens sdk.Coins
}

Tokens is a struct that contains all the token issued as vote right

func NewIssuers

func NewIssuers() Issuers

Returns a new Issuers with the minprice as the price

func (Issuers) String

func (i Issuers) String() string

implement fmt.Stringer

type MsgDeposit

type MsgDeposit struct {
	ProposalID uint64         `json:"proposal_id" yaml:"proposal_id"` // ID of the proposal
	Depositor  sdk.AccAddress `json:"depositor" yaml:"depositor"`     // Address of the depositor
	Amount     sdk.Coins      `json:"amount" yaml:"amount"`           // Coins to add to the proposal's deposit
}

MsgDeposit

func NewMsgDeposit

func NewMsgDeposit(depositor sdk.AccAddress, proposalID uint64, amount sdk.Coins) MsgDeposit

func (MsgDeposit) GetSignBytes

func (msg MsgDeposit) GetSignBytes() []byte

Implements Msg.

func (MsgDeposit) GetSigners

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

Implements Msg.

func (MsgDeposit) Route

func (msg MsgDeposit) Route() string

Implements Msg. nolint

func (MsgDeposit) String

func (msg MsgDeposit) String() string

func (MsgDeposit) Type

func (msg MsgDeposit) Type() string

func (MsgDeposit) ValidateBasic

func (msg MsgDeposit) ValidateBasic() sdk.Error

Implements Msg.

type MsgIssueToken

type MsgIssueToken struct {
	Owner sdk.AccAddress
	Coins sdk.Coins
}

MsgIssueToken IssueTokenに関するMsg interfaceの実装

func NewMsgIssueToken

func NewMsgIssueToken(owner sdk.AccAddress, coins sdk.Coins) MsgIssueToken

NewMsgIssueToken 新しいMsgIssueTokenを生成

func (MsgIssueToken) GetSignBytes

func (msg MsgIssueToken) GetSignBytes() []byte

GetSignBytes 署名するためのMsgデータを取得する

func (MsgIssueToken) GetSigners

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

GetSigners 誰の署名が必要か定義する

func (MsgIssueToken) Route

func (msg MsgIssueToken) Route() string

Route module名を定義する

func (MsgIssueToken) Type

func (msg MsgIssueToken) Type() string

Type action名を決める

func (MsgIssueToken) ValidateBasic

func (msg MsgIssueToken) ValidateBasic() sdk.Error

ValidateBasic Msgsの中身のチェックをする

type MsgSubmitProposal

type MsgSubmitProposal struct {
	Content        Content        `json:"content" yaml:"content"`
	InitialDeposit sdk.Coins      `json:"initial_deposit" yaml:"initial_deposit"` //  Initial deposit paid by sender. Must be strictly positive
	Proposer       sdk.AccAddress `json:"proposer" yaml:"proposer"`               //  Address of the proposer
}

MsgSubmitProposal

func NewMsgSubmitProposal

func NewMsgSubmitProposal(content Content, initialDeposit sdk.Coins, proposer sdk.AccAddress) MsgSubmitProposal

func (MsgSubmitProposal) GetSignBytes

func (msg MsgSubmitProposal) GetSignBytes() []byte

Implements Msg.

func (MsgSubmitProposal) GetSigners

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

Implements Msg.

func (MsgSubmitProposal) Route

func (msg MsgSubmitProposal) Route() string

nolint

func (MsgSubmitProposal) String

func (msg MsgSubmitProposal) String() string

func (MsgSubmitProposal) Type

func (msg MsgSubmitProposal) Type() string

func (MsgSubmitProposal) ValidateBasic

func (msg MsgSubmitProposal) ValidateBasic() sdk.Error

Implements Msg.

type MsgVote

type MsgVote struct {
	ProposalID uint64         `json:"proposal_id" yaml:"proposal_id"` // ID of the proposal
	Voter      sdk.AccAddress `json:"voter" yaml:"voter"`             //  address of the voter
	Option     VoteOption     `json:"option" yaml:"option"`           //  option from OptionSet chosen by the voter
}

MsgVote

func NewMsgVote

func NewMsgVote(voter sdk.AccAddress, proposalID uint64, option VoteOption) MsgVote

func (MsgVote) GetSignBytes

func (msg MsgVote) GetSignBytes() []byte

Implements Msg.

func (MsgVote) GetSigners

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

Implements Msg.

func (MsgVote) Route

func (msg MsgVote) Route() string

Implements Msg. nolint

func (MsgVote) String

func (msg MsgVote) String() string

func (MsgVote) Type

func (msg MsgVote) Type() string

func (MsgVote) ValidateBasic

func (msg MsgVote) ValidateBasic() sdk.Error

Implements Msg.

type QueryDepositParams

type QueryDepositParams = gov.QueryDepositParams

type QueryProposalParams

type QueryProposalParams = gov.QueryProposalParams

type QueryProposalsParams

type QueryProposalsParams = gov.QueryProposalsParams

type QueryVoteParams

type QueryVoteParams = gov.QueryVoteParams

type TextProposal

type TextProposal struct {
	Title       string `json:"title" yaml:"title"`
	Description string `json:"description" yaml:"description"`
}

Text Proposal

func (TextProposal) GetDescription

func (tp TextProposal) GetDescription() string

func (TextProposal) GetTitle

func (tp TextProposal) GetTitle() string

nolint

func (TextProposal) ProposalRoute

func (tp TextProposal) ProposalRoute() string

func (TextProposal) ProposalType

func (tp TextProposal) ProposalType() string

func (TextProposal) String

func (tp TextProposal) String() string

func (TextProposal) ValidateBasic

func (tp TextProposal) ValidateBasic() sdk.Error

type VoteOption

type VoteOption = gov.VoteOption

Content = gov.Content

Jump to

Keyboard shortcuts

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