types

package
v0.43.0-alpha1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2021 License: Apache-2.0 Imports: 38 Imported by: 5,561

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	MaxDescriptionLength int = 5000
	MaxTitleLength       int = 140
)

Constants pertaining to a Content object

View Source
const (
	EventTypeSubmitProposal   = "submit_proposal"
	EventTypeProposalDeposit  = "proposal_deposit"
	EventTypeProposalVote     = "proposal_vote"
	EventTypeInactiveProposal = "inactive_proposal"
	EventTypeActiveProposal   = "active_proposal"

	AttributeKeyProposalResult     = "proposal_result"
	AttributeKeyOption             = "option"
	AttributeKeyProposalID         = "proposal_id"
	AttributeKeyVotingPeriodStart  = "voting_period_start"
	AttributeValueCategory         = "governance"
	AttributeValueProposalDropped  = "proposal_dropped"  // didn't meet min deposit
	AttributeValueProposalPassed   = "proposal_passed"   // met vote quorum
	AttributeValueProposalRejected = "proposal_rejected" // didn't meet vote quorum
	AttributeValueProposalFailed   = "proposal_failed"   // error on proposal handler
	AttributeKeyProposalType       = "proposal_type"
)

Governance module event types

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

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

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

	// QuerierRoute is the querier route for gov
	QuerierRoute = ModuleName
)
View Source
const (
	TypeMsgDeposit        = "deposit"
	TypeMsgVote           = "vote"
	TypeMsgVoteWeighted   = "weighted_vote"
	TypeMsgSubmitProposal = "submit_proposal"

	// These are used for querying events by action.
	TypeSvcMsgDeposit        = "/cosmos.gov.v1beta1.Msg/Deposit"
	TypeSvcMsgVote           = "/cosmos.gov.v1beta1.Msg/Vote"
	TypeSvcMsgVoteWeighted   = "/cosmos.gov.v1beta1.Msg/VoteWeighted"
	TypeSvcMsgSubmitProposal = "/cosmos.gov.v1beta1.Msg/SubmitProposal"
)

Governance message types and routes

View Source
const (
	QueryParams    = "params"
	QueryProposals = "proposals"
	QueryProposal  = "proposal"
	QueryDeposits  = "deposits"
	QueryDeposit   = "deposit"
	QueryVotes     = "votes"
	QueryVote      = "vote"
	QueryTally     = "tally"

	ParamDeposit  = "deposit"
	ParamVoting   = "voting"
	ParamTallying = "tallying"
)

query endpoints supported by the governance Querier

View Source
const (
	DefaultPeriod time.Duration = time.Hour * 24 * 2 // 2 days
)

Default period for deposits & voting

View Source
const DefaultStartingProposalID uint64 = 1

DefaultStartingProposalID is 1

View Source
const (
	ProposalTypeText string = "Text"
)

Proposal types

Variables

View Source
var (
	ErrUnknownProposal         = sdkerrors.Register(ModuleName, 2, "unknown proposal")
	ErrInactiveProposal        = sdkerrors.Register(ModuleName, 3, "inactive proposal")
	ErrAlreadyActiveProposal   = sdkerrors.Register(ModuleName, 4, "proposal already active")
	ErrInvalidProposalContent  = sdkerrors.Register(ModuleName, 5, "invalid proposal content")
	ErrInvalidProposalType     = sdkerrors.Register(ModuleName, 6, "invalid proposal type")
	ErrInvalidVote             = sdkerrors.Register(ModuleName, 7, "invalid vote option")
	ErrInvalidGenesis          = sdkerrors.Register(ModuleName, 8, "invalid genesis state")
	ErrNoProposalHandlerExists = sdkerrors.Register(ModuleName, 9, "no handler exists for proposal type")
)

x/gov module sentinel errors

View Source
var (
	ErrInvalidLengthGenesis        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowGenesis          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthGov        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowGov          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupGov = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ProposalsKeyPrefix          = []byte{0x00}
	ActiveProposalQueuePrefix   = []byte{0x01}
	InactiveProposalQueuePrefix = []byte{0x02}
	ProposalIDKey               = []byte{0x03}

	DepositsKeyPrefix = []byte{0x10}

	VotesKeyPrefix = []byte{0x20}
)

Keys for governance store Items are stored with the following key: values

- 0x00<proposalID_Bytes>: Proposal

- 0x01<endTime_Bytes><proposalID_Bytes>: activeProposalID

- 0x02<endTime_Bytes><proposalID_Bytes>: inactiveProposalID

- 0x03: nextProposalID

- 0x10<proposalID_Bytes><depositorAddrLen (1 Byte)><depositorAddr_Bytes>: Deposit

- 0x20<proposalID_Bytes><voterAddrLen (1 Byte)><voterAddr_Bytes>: Voter

View Source
var (
	DefaultMinDepositTokens = sdk.NewInt(10000000)
	DefaultQuorum           = sdk.NewDecWithPrec(334, 3)
	DefaultThreshold        = sdk.NewDecWithPrec(5, 1)
	DefaultVetoThreshold    = sdk.NewDecWithPrec(334, 3)
)

Default governance params

View Source
var (
	ParamStoreKeyDepositParams = []byte("depositparams")
	ParamStoreKeyVotingParams  = []byte("votingparams")
	ParamStoreKeyTallyParams   = []byte("tallyparams")
)

Parameter store key

View Source
var (
	ErrInvalidLengthQuery        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowQuery          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthTx        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTx          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (

	// ModuleCdc references the global x/gov module codec. Note, the codec should
	// ONLY be used in certain instances of tests and for JSON encoding as Amino is
	// still used for that purpose.
	//
	// The actual codec used for serialization should be provided to x/gov and
	// defined at the application level.
	ModuleCdc = codec.NewAminoCodec(amino)
)
View Source
var ProposalStatus_name = map[int32]string{
	0: "PROPOSAL_STATUS_UNSPECIFIED",
	1: "PROPOSAL_STATUS_DEPOSIT_PERIOD",
	2: "PROPOSAL_STATUS_VOTING_PERIOD",
	3: "PROPOSAL_STATUS_PASSED",
	4: "PROPOSAL_STATUS_REJECTED",
	5: "PROPOSAL_STATUS_FAILED",
}
View Source
var ProposalStatus_value = map[string]int32{
	"PROPOSAL_STATUS_UNSPECIFIED":    0,
	"PROPOSAL_STATUS_DEPOSIT_PERIOD": 1,
	"PROPOSAL_STATUS_VOTING_PERIOD":  2,
	"PROPOSAL_STATUS_PASSED":         3,
	"PROPOSAL_STATUS_REJECTED":       4,
	"PROPOSAL_STATUS_FAILED":         5,
}
View Source
var VoteOption_name = map[int32]string{
	0: "VOTE_OPTION_UNSPECIFIED",
	1: "VOTE_OPTION_YES",
	2: "VOTE_OPTION_ABSTAIN",
	3: "VOTE_OPTION_NO",
	4: "VOTE_OPTION_NO_WITH_VETO",
}
View Source
var VoteOption_value = map[string]int32{
	"VOTE_OPTION_UNSPECIFIED":  0,
	"VOTE_OPTION_YES":          1,
	"VOTE_OPTION_ABSTAIN":      2,
	"VOTE_OPTION_NO":           3,
	"VOTE_OPTION_NO_WITH_VETO": 4,
}

Functions

func ActiveProposalByTimeKey

func ActiveProposalByTimeKey(endTime time.Time) []byte

ActiveProposalByTimeKey gets the active proposal queue key by endTime

func ActiveProposalQueueKey

func ActiveProposalQueueKey(proposalID uint64, endTime time.Time) []byte

ActiveProposalQueueKey returns the key for a proposalID in the activeProposalQueue

func DepositKey

func DepositKey(proposalID uint64, depositorAddr sdk.AccAddress) []byte

DepositKey key of a specific deposit from the store

func DepositsKey

func DepositsKey(proposalID uint64) []byte

DepositsKey gets the first part of the deposits key based on the proposalID

func GetProposalIDBytes

func GetProposalIDBytes(proposalID uint64) (proposalIDBz []byte)

GetProposalIDBytes returns the byte representation of the proposalID

func GetProposalIDFromBytes

func GetProposalIDFromBytes(bz []byte) (proposalID uint64)

GetProposalIDFromBytes returns proposalID in uint64 format from a byte array

func InactiveProposalByTimeKey

func InactiveProposalByTimeKey(endTime time.Time) []byte

InactiveProposalByTimeKey gets the inactive proposal queue key by endTime

func InactiveProposalQueueKey

func InactiveProposalQueueKey(proposalID uint64, endTime time.Time) []byte

InactiveProposalQueueKey returns the key for a proposalID in the inactiveProposalQueue

func IsValidProposalType

func IsValidProposalType(ty string) bool

IsValidProposalType returns a boolean determining if the proposal type is valid.

NOTE: Modules with their own proposal types must register them.

func ParamKeyTable

func ParamKeyTable() paramtypes.KeyTable

ParamKeyTable - Key declaration for parameters

func ProposalHandler

func ProposalHandler(_ sdk.Context, c Content) error

ProposalHandler implements the Handler interface for governance module-based proposals (ie. TextProposal ). Since these are merely signaling mechanisms at the moment and do not affect state, it performs a no-op.

func ProposalKey

func ProposalKey(proposalID uint64) []byte

ProposalKey gets a specific proposal from the store

func RegisterInterfaces added in v0.40.0

func RegisterInterfaces(registry types.InterfaceRegistry)

func RegisterLegacyAminoCodec added in v0.40.0

func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)

RegisterLegacyAminoCodec registers all the necessary types and interfaces for the governance module.

func RegisterMsgServer added in v0.40.0

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

func RegisterProposalType

func RegisterProposalType(ty string)

RegisterProposalType registers a proposal type. It will panic if the type is already registered.

func RegisterProposalTypeCodec

func RegisterProposalTypeCodec(o interface{}, name string)

RegisterProposalTypeCodec registers an external proposal content type defined in another module for the internal ModuleCdc. This allows the MsgSubmitProposal to be correctly Amino encoded and decoded.

NOTE: This should only be used for applications that are still using a concrete Amino codec for serialization.

func RegisterQueryHandler added in v0.40.0

func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterQueryHandler registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterQueryHandlerClient added in v0.40.0

func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error

RegisterQueryHandlerClient registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "QueryClient" to call the correct interceptors.

func RegisterQueryHandlerFromEndpoint added in v0.40.0

func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterQueryHandlerServer added in v0.40.0

func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error

RegisterQueryHandlerServer registers the http handlers for service Query to "mux". UnaryRPC :call QueryServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.

func RegisterQueryServer added in v0.40.0

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

func SplitActiveProposalQueueKey

func SplitActiveProposalQueueKey(key []byte) (proposalID uint64, endTime time.Time)

SplitActiveProposalQueueKey split the active proposal key and returns the proposal id and endTime

func SplitInactiveProposalQueueKey

func SplitInactiveProposalQueueKey(key []byte) (proposalID uint64, endTime time.Time)

SplitInactiveProposalQueueKey split the inactive proposal key and returns the proposal id and endTime

func SplitKeyDeposit

func SplitKeyDeposit(key []byte) (proposalID uint64, depositorAddr sdk.AccAddress)

SplitKeyDeposit split the deposits key and returns the proposal id and depositor address

func SplitKeyVote

func SplitKeyVote(key []byte) (proposalID uint64, voterAddr sdk.AccAddress)

SplitKeyVote split the votes key and returns the proposal id and voter address

func SplitProposalKey

func SplitProposalKey(key []byte) (proposalID uint64)

SplitProposalKey split the proposal key and returns the proposal id

func ValidProposalStatus

func ValidProposalStatus(status ProposalStatus) bool

ValidProposalStatus returns true if the proposal status is valid and false otherwise.

func ValidVoteOption

func ValidVoteOption(option VoteOption) bool

ValidVoteOption returns true if the vote option is valid and false otherwise.

func ValidWeightedVoteOption added in v0.43.0

func ValidWeightedVoteOption(option WeightedVoteOption) bool

ValidWeightedVoteOption returns true if the sub vote is valid and false otherwise.

func ValidateAbstract

func ValidateAbstract(c Content) error

ValidateAbstract validates a proposal's abstract contents returning an error if invalid.

func ValidateGenesis

func ValidateGenesis(data *GenesisState) error

ValidateGenesis checks if parameters are within valid ranges

func VoteKey

func VoteKey(proposalID uint64, voterAddr sdk.AccAddress) []byte

VoteKey key of a specific vote from the store

func VotesKey

func VotesKey(proposalID uint64) []byte

VotesKey gets the first part of the votes key based on the proposalID

Types

type AccountKeeper

type AccountKeeper interface {
	GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI

	GetModuleAddress(name string) sdk.AccAddress
	GetModuleAccount(ctx sdk.Context, name string) types.ModuleAccountI

	// TODO remove with genesis 2-phases refactor https://github.com/cosmos/cosmos-sdk/issues/2862
	SetModuleAccount(sdk.Context, types.ModuleAccountI)
}

AccountKeeper defines the expected account keeper (noalias)

type BankKeeper

type BankKeeper interface {
	GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
	GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin
	LockedCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
	SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins

	SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
	SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error
	BurnCoins(ctx sdk.Context, name string, amt sdk.Coins) error
}

BankKeeper defines the expected interface needed to retrieve account balances.

type Content

type Content interface {
	GetTitle() string
	GetDescription() string
	ProposalRoute() string
	ProposalType() string
	ValidateBasic() error
	String() string
}

Content defines an interface that a proposal must implement. It contains information such as the title and description along with the type and routing information for the appropriate handler to process the proposal. Content can have additional fields, which will handled by a proposal's Handler. TODO Try to unify this interface with types/module/simulation https://github.com/cosmos/cosmos-sdk/issues/5853

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

NewTextProposal creates a text proposal Content

type Deposit

type Deposit struct {
	ProposalId uint64                                   `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty" yaml:"proposal_id"`
	Depositor  string                                   `protobuf:"bytes,2,opt,name=depositor,proto3" json:"depositor,omitempty"`
	Amount     github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"`
}

Deposit defines an amount deposited by an account address to an active proposal.

func NewDeposit

func NewDeposit(proposalID uint64, depositor sdk.AccAddress, amount sdk.Coins) Deposit

NewDeposit creates a new Deposit instance

func (*Deposit) Descriptor

func (*Deposit) Descriptor() ([]byte, []int)

func (Deposit) Empty

func (d Deposit) Empty() bool

Empty returns whether a deposit is empty.

func (*Deposit) Marshal

func (m *Deposit) Marshal() (dAtA []byte, err error)

func (*Deposit) MarshalTo

func (m *Deposit) MarshalTo(dAtA []byte) (int, error)

func (*Deposit) MarshalToSizedBuffer

func (m *Deposit) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Deposit) ProtoMessage

func (*Deposit) ProtoMessage()

func (*Deposit) Reset

func (m *Deposit) Reset()

func (*Deposit) Size

func (m *Deposit) Size() (n int)

func (Deposit) String

func (d Deposit) String() string

func (*Deposit) Unmarshal

func (m *Deposit) Unmarshal(dAtA []byte) error

func (*Deposit) XXX_DiscardUnknown

func (m *Deposit) XXX_DiscardUnknown()

func (*Deposit) XXX_Marshal

func (m *Deposit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Deposit) XXX_Merge

func (m *Deposit) XXX_Merge(src proto.Message)

func (*Deposit) XXX_Size

func (m *Deposit) XXX_Size() int

func (*Deposit) XXX_Unmarshal

func (m *Deposit) XXX_Unmarshal(b []byte) error

type DepositParams

type DepositParams struct {
	//  Minimum deposit for a proposal to enter voting period.
	MinDeposit github_com_cosmos_cosmos_sdk_types.Coins `` /* 164-byte string literal not displayed */
	//  Maximum period for Atom holders to deposit on a proposal. Initial value: 2
	//  months.
	MaxDepositPeriod time.Duration `` /* 149-byte string literal not displayed */
}

DepositParams defines the params for deposits on governance proposals.

func DefaultDepositParams

func DefaultDepositParams() DepositParams

DefaultDepositParams default parameters for deposits

func NewDepositParams

func NewDepositParams(minDeposit sdk.Coins, maxDepositPeriod time.Duration) DepositParams

NewDepositParams creates a new DepositParams object

func (*DepositParams) Descriptor added in v0.40.0

func (*DepositParams) Descriptor() ([]byte, []int)

func (DepositParams) Equal

func (dp DepositParams) Equal(dp2 DepositParams) bool

Equal checks equality of DepositParams

func (*DepositParams) Marshal added in v0.40.0

func (m *DepositParams) Marshal() (dAtA []byte, err error)

func (*DepositParams) MarshalTo added in v0.40.0

func (m *DepositParams) MarshalTo(dAtA []byte) (int, error)

func (*DepositParams) MarshalToSizedBuffer added in v0.40.0

func (m *DepositParams) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*DepositParams) ProtoMessage added in v0.40.0

func (*DepositParams) ProtoMessage()

func (*DepositParams) Reset added in v0.40.0

func (m *DepositParams) Reset()

func (*DepositParams) Size added in v0.40.0

func (m *DepositParams) Size() (n int)

func (DepositParams) String

func (dp DepositParams) String() string

String implements stringer insterface

func (*DepositParams) Unmarshal added in v0.40.0

func (m *DepositParams) Unmarshal(dAtA []byte) error

func (*DepositParams) XXX_DiscardUnknown added in v0.40.0

func (m *DepositParams) XXX_DiscardUnknown()

func (*DepositParams) XXX_Marshal added in v0.40.0

func (m *DepositParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DepositParams) XXX_Merge added in v0.40.0

func (m *DepositParams) XXX_Merge(src proto.Message)

func (*DepositParams) XXX_Size added in v0.40.0

func (m *DepositParams) XXX_Size() int

func (*DepositParams) XXX_Unmarshal added in v0.40.0

func (m *DepositParams) XXX_Unmarshal(b []byte) error

type Deposits

type Deposits []Deposit

Deposits is a collection of Deposit objects

func (Deposits) Equal

func (d Deposits) Equal(other Deposits) bool

Equal returns true if two slices (order-dependant) of deposits are equal.

func (Deposits) String

func (d Deposits) String() string

type GenesisState

type GenesisState struct {
	// starting_proposal_id is the ID of the starting proposal.
	StartingProposalId uint64 `` /* 146-byte string literal not displayed */
	// deposits defines all the deposits present at genesis.
	Deposits Deposits `protobuf:"bytes,2,rep,name=deposits,proto3,castrepeated=Deposits" json:"deposits"`
	// votes defines all the votes present at genesis.
	Votes Votes `protobuf:"bytes,3,rep,name=votes,proto3,castrepeated=Votes" json:"votes"`
	// proposals defines all the proposals present at genesis.
	Proposals Proposals `protobuf:"bytes,4,rep,name=proposals,proto3,castrepeated=Proposals" json:"proposals"`
	// params defines all the paramaters of related to deposit.
	DepositParams DepositParams `protobuf:"bytes,5,opt,name=deposit_params,json=depositParams,proto3" json:"deposit_params" yaml:"deposit_params"`
	// params defines all the paramaters of related to voting.
	VotingParams VotingParams `protobuf:"bytes,6,opt,name=voting_params,json=votingParams,proto3" json:"voting_params" yaml:"voting_params"`
	// params defines all the paramaters of related to tally.
	TallyParams TallyParams `protobuf:"bytes,7,opt,name=tally_params,json=tallyParams,proto3" json:"tally_params" yaml:"tally_params"`
}

GenesisState defines the gov module's genesis state.

func DefaultGenesisState

func DefaultGenesisState() *GenesisState

DefaultGenesisState defines the default governance genesis state

func NewGenesisState

func NewGenesisState(startingProposalID uint64, dp DepositParams, vp VotingParams, tp TallyParams) *GenesisState

NewGenesisState creates a new genesis state for the governance module

func (*GenesisState) Descriptor added in v0.40.0

func (*GenesisState) Descriptor() ([]byte, []int)

func (GenesisState) Empty added in v0.40.0

func (data GenesisState) Empty() bool

Empty returns true if a GenesisState is empty

func (GenesisState) Equal

func (data GenesisState) Equal(other GenesisState) bool

func (*GenesisState) GetDepositParams added in v0.40.0

func (m *GenesisState) GetDepositParams() DepositParams

func (*GenesisState) GetDeposits added in v0.40.0

func (m *GenesisState) GetDeposits() Deposits

func (*GenesisState) GetProposals added in v0.40.0

func (m *GenesisState) GetProposals() Proposals

func (*GenesisState) GetStartingProposalId added in v0.40.0

func (m *GenesisState) GetStartingProposalId() uint64

func (*GenesisState) GetTallyParams added in v0.40.0

func (m *GenesisState) GetTallyParams() TallyParams

func (*GenesisState) GetVotes added in v0.40.0

func (m *GenesisState) GetVotes() Votes

func (*GenesisState) GetVotingParams added in v0.40.0

func (m *GenesisState) GetVotingParams() VotingParams

func (*GenesisState) Marshal added in v0.40.0

func (m *GenesisState) Marshal() (dAtA []byte, err error)

func (*GenesisState) MarshalTo added in v0.40.0

func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)

func (*GenesisState) MarshalToSizedBuffer added in v0.40.0

func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GenesisState) ProtoMessage added in v0.40.0

func (*GenesisState) ProtoMessage()

func (*GenesisState) Reset added in v0.40.0

func (m *GenesisState) Reset()

func (*GenesisState) Size added in v0.40.0

func (m *GenesisState) Size() (n int)

func (*GenesisState) String added in v0.40.0

func (m *GenesisState) String() string

func (*GenesisState) Unmarshal added in v0.40.0

func (m *GenesisState) Unmarshal(dAtA []byte) error

func (GenesisState) UnpackInterfaces added in v0.40.0

func (data GenesisState) UnpackInterfaces(unpacker types.AnyUnpacker) error

UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces

func (*GenesisState) XXX_DiscardUnknown added in v0.40.0

func (m *GenesisState) XXX_DiscardUnknown()

func (*GenesisState) XXX_Marshal added in v0.40.0

func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GenesisState) XXX_Merge added in v0.40.0

func (m *GenesisState) XXX_Merge(src proto.Message)

func (*GenesisState) XXX_Size added in v0.40.0

func (m *GenesisState) XXX_Size() int

func (*GenesisState) XXX_Unmarshal added in v0.40.0

func (m *GenesisState) XXX_Unmarshal(b []byte) error

type GovHooks added in v0.43.0

type GovHooks interface {
	AfterProposalSubmission(ctx sdk.Context, proposalID uint64)                            // Must be called after proposal is submitted
	AfterProposalDeposit(ctx sdk.Context, proposalID uint64, depositorAddr sdk.AccAddress) // Must be called after a deposit is made
	AfterProposalVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.AccAddress)        // Must be called after a vote on a proposal is cast
	AfterProposalFailedMinDeposit(ctx sdk.Context, proposalID uint64)                      // Must be called when proposal fails to reach min deposit
	AfterProposalVotingPeriodEnded(ctx sdk.Context, proposalID uint64)                     // Must be called when proposal's finishes it's voting period
}

GovHooks event hooks for governance proposal object (noalias)

type Handler

type Handler func(ctx sdk.Context, content Content) error

Handler defines a function that handles a proposal after it has passed the governance process.

type MsgClient added in v0.40.0

type MsgClient interface {
	// SubmitProposal defines a method to create new proposal given a content.
	SubmitProposal(ctx context.Context, in *MsgSubmitProposal, opts ...grpc.CallOption) (*MsgSubmitProposalResponse, error)
	// Vote defines a method to add a vote on a specific proposal.
	Vote(ctx context.Context, in *MsgVote, opts ...grpc.CallOption) (*MsgVoteResponse, error)
	// WeightedVote defines a method to add a weighted vote on a specific proposal.
	VoteWeighted(ctx context.Context, in *MsgVoteWeighted, opts ...grpc.CallOption) (*MsgVoteWeightedResponse, error)
	// Deposit defines a method to add deposit on a specific proposal.
	Deposit(ctx context.Context, in *MsgDeposit, opts ...grpc.CallOption) (*MsgDepositResponse, error)
}

MsgClient is the client API for Msg service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewMsgClient added in v0.40.0

func NewMsgClient(cc grpc1.ClientConn) MsgClient

type MsgDeposit

type MsgDeposit struct {
	ProposalId uint64                                   `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id" yaml:"proposal_id"`
	Depositor  string                                   `protobuf:"bytes,2,opt,name=depositor,proto3" json:"depositor,omitempty"`
	Amount     github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"`
}

MsgDeposit defines a message to submit a deposit to an existing proposal.

func NewMsgDeposit

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

NewMsgDeposit creates a new MsgDeposit instance

func (*MsgDeposit) Descriptor

func (*MsgDeposit) Descriptor() ([]byte, []int)

func (MsgDeposit) GetSignBytes

func (msg MsgDeposit) GetSignBytes() []byte

GetSignBytes implements Msg

func (MsgDeposit) GetSigners

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

GetSigners implements Msg

func (*MsgDeposit) Marshal

func (m *MsgDeposit) Marshal() (dAtA []byte, err error)

func (*MsgDeposit) MarshalTo

func (m *MsgDeposit) MarshalTo(dAtA []byte) (int, error)

func (*MsgDeposit) MarshalToSizedBuffer

func (m *MsgDeposit) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgDeposit) ProtoMessage

func (*MsgDeposit) ProtoMessage()

func (*MsgDeposit) Reset

func (m *MsgDeposit) Reset()

func (MsgDeposit) Route

func (msg MsgDeposit) Route() string

Route implements Msg

func (*MsgDeposit) Size

func (m *MsgDeposit) Size() (n int)

func (MsgDeposit) String

func (msg MsgDeposit) String() string

String implements the Stringer interface

func (MsgDeposit) Type

func (msg MsgDeposit) Type() string

Type implements Msg

func (*MsgDeposit) Unmarshal

func (m *MsgDeposit) Unmarshal(dAtA []byte) error

func (MsgDeposit) ValidateBasic

func (msg MsgDeposit) ValidateBasic() error

ValidateBasic implements Msg

func (*MsgDeposit) XXX_DiscardUnknown

func (m *MsgDeposit) XXX_DiscardUnknown()

func (*MsgDeposit) XXX_Marshal

func (m *MsgDeposit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgDeposit) XXX_Merge

func (m *MsgDeposit) XXX_Merge(src proto.Message)

func (*MsgDeposit) XXX_Size

func (m *MsgDeposit) XXX_Size() int

func (*MsgDeposit) XXX_Unmarshal

func (m *MsgDeposit) XXX_Unmarshal(b []byte) error

type MsgDepositResponse added in v0.40.0

type MsgDepositResponse struct {
}

MsgDepositResponse defines the Msg/Deposit response type.

func (*MsgDepositResponse) Descriptor added in v0.40.0

func (*MsgDepositResponse) Descriptor() ([]byte, []int)

func (*MsgDepositResponse) Marshal added in v0.40.0

func (m *MsgDepositResponse) Marshal() (dAtA []byte, err error)

func (*MsgDepositResponse) MarshalTo added in v0.40.0

func (m *MsgDepositResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgDepositResponse) MarshalToSizedBuffer added in v0.40.0

func (m *MsgDepositResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgDepositResponse) ProtoMessage added in v0.40.0

func (*MsgDepositResponse) ProtoMessage()

func (*MsgDepositResponse) Reset added in v0.40.0

func (m *MsgDepositResponse) Reset()

func (*MsgDepositResponse) Size added in v0.40.0

func (m *MsgDepositResponse) Size() (n int)

func (*MsgDepositResponse) String added in v0.40.0

func (m *MsgDepositResponse) String() string

func (*MsgDepositResponse) Unmarshal added in v0.40.0

func (m *MsgDepositResponse) Unmarshal(dAtA []byte) error

func (*MsgDepositResponse) XXX_DiscardUnknown added in v0.40.0

func (m *MsgDepositResponse) XXX_DiscardUnknown()

func (*MsgDepositResponse) XXX_Marshal added in v0.40.0

func (m *MsgDepositResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgDepositResponse) XXX_Merge added in v0.40.0

func (m *MsgDepositResponse) XXX_Merge(src proto.Message)

func (*MsgDepositResponse) XXX_Size added in v0.40.0

func (m *MsgDepositResponse) XXX_Size() int

func (*MsgDepositResponse) XXX_Unmarshal added in v0.40.0

func (m *MsgDepositResponse) XXX_Unmarshal(b []byte) error

type MsgServer added in v0.40.0

type MsgServer interface {
	// SubmitProposal defines a method to create new proposal given a content.
	SubmitProposal(context.Context, *MsgSubmitProposal) (*MsgSubmitProposalResponse, error)
	// Vote defines a method to add a vote on a specific proposal.
	Vote(context.Context, *MsgVote) (*MsgVoteResponse, error)
	// WeightedVote defines a method to add a weighted vote on a specific proposal.
	VoteWeighted(context.Context, *MsgVoteWeighted) (*MsgVoteWeightedResponse, error)
	// Deposit defines a method to add deposit on a specific proposal.
	Deposit(context.Context, *MsgDeposit) (*MsgDepositResponse, error)
}

MsgServer is the server API for Msg service.

type MsgSubmitProposal

type MsgSubmitProposal struct {
	Content        *types.Any                               `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"`
	InitialDeposit github_com_cosmos_cosmos_sdk_types.Coins `` /* 170-byte string literal not displayed */
	Proposer       string                                   `protobuf:"bytes,3,opt,name=proposer,proto3" json:"proposer,omitempty"`
}

MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary proposal Content.

func NewMsgSubmitProposal

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

NewMsgSubmitProposal creates a new MsgSubmitProposal.

func (*MsgSubmitProposal) Descriptor added in v0.40.0

func (*MsgSubmitProposal) Descriptor() ([]byte, []int)

func (*MsgSubmitProposal) GetContent

func (m *MsgSubmitProposal) GetContent() Content

func (*MsgSubmitProposal) GetInitialDeposit

func (m *MsgSubmitProposal) GetInitialDeposit() sdk.Coins

func (*MsgSubmitProposal) GetProposer

func (m *MsgSubmitProposal) GetProposer() sdk.AccAddress

func (MsgSubmitProposal) GetSignBytes

func (m MsgSubmitProposal) GetSignBytes() []byte

GetSignBytes implements Msg

func (MsgSubmitProposal) GetSigners

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

GetSigners implements Msg

func (*MsgSubmitProposal) Marshal added in v0.40.0

func (m *MsgSubmitProposal) Marshal() (dAtA []byte, err error)

func (*MsgSubmitProposal) MarshalTo added in v0.40.0

func (m *MsgSubmitProposal) MarshalTo(dAtA []byte) (int, error)

func (*MsgSubmitProposal) MarshalToSizedBuffer added in v0.40.0

func (m *MsgSubmitProposal) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgSubmitProposal) ProtoMessage added in v0.40.0

func (*MsgSubmitProposal) ProtoMessage()

func (*MsgSubmitProposal) Reset added in v0.40.0

func (m *MsgSubmitProposal) Reset()

func (MsgSubmitProposal) Route

func (m MsgSubmitProposal) Route() string

Route implements Msg

func (*MsgSubmitProposal) SetContent

func (m *MsgSubmitProposal) SetContent(content Content) error

func (*MsgSubmitProposal) SetInitialDeposit

func (m *MsgSubmitProposal) SetInitialDeposit(coins sdk.Coins)

func (*MsgSubmitProposal) SetProposer

func (m *MsgSubmitProposal) SetProposer(address fmt.Stringer)

func (*MsgSubmitProposal) Size added in v0.40.0

func (m *MsgSubmitProposal) Size() (n int)

func (MsgSubmitProposal) String added in v0.36.0

func (m MsgSubmitProposal) String() string

String implements the Stringer interface

func (MsgSubmitProposal) Type

func (m MsgSubmitProposal) Type() string

Type implements Msg

func (*MsgSubmitProposal) Unmarshal added in v0.40.0

func (m *MsgSubmitProposal) Unmarshal(dAtA []byte) error

func (MsgSubmitProposal) UnpackInterfaces added in v0.40.0

func (m MsgSubmitProposal) UnpackInterfaces(unpacker types.AnyUnpacker) error

UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces

func (MsgSubmitProposal) ValidateBasic

func (m MsgSubmitProposal) ValidateBasic() error

ValidateBasic implements Msg

func (*MsgSubmitProposal) XXX_DiscardUnknown added in v0.40.0

func (m *MsgSubmitProposal) XXX_DiscardUnknown()

func (*MsgSubmitProposal) XXX_Marshal added in v0.40.0

func (m *MsgSubmitProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgSubmitProposal) XXX_Merge added in v0.40.0

func (m *MsgSubmitProposal) XXX_Merge(src proto.Message)

func (*MsgSubmitProposal) XXX_Size added in v0.40.0

func (m *MsgSubmitProposal) XXX_Size() int

func (*MsgSubmitProposal) XXX_Unmarshal added in v0.40.0

func (m *MsgSubmitProposal) XXX_Unmarshal(b []byte) error

type MsgSubmitProposalResponse added in v0.40.0

type MsgSubmitProposalResponse struct {
	ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id" yaml:"proposal_id"`
}

MsgSubmitProposalResponse defines the Msg/SubmitProposal response type.

func (*MsgSubmitProposalResponse) Descriptor added in v0.40.0

func (*MsgSubmitProposalResponse) Descriptor() ([]byte, []int)

func (*MsgSubmitProposalResponse) GetProposalId added in v0.40.0

func (m *MsgSubmitProposalResponse) GetProposalId() uint64

func (*MsgSubmitProposalResponse) Marshal added in v0.40.0

func (m *MsgSubmitProposalResponse) Marshal() (dAtA []byte, err error)

func (*MsgSubmitProposalResponse) MarshalTo added in v0.40.0

func (m *MsgSubmitProposalResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgSubmitProposalResponse) MarshalToSizedBuffer added in v0.40.0

func (m *MsgSubmitProposalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgSubmitProposalResponse) ProtoMessage added in v0.40.0

func (*MsgSubmitProposalResponse) ProtoMessage()

func (*MsgSubmitProposalResponse) Reset added in v0.40.0

func (m *MsgSubmitProposalResponse) Reset()

func (*MsgSubmitProposalResponse) Size added in v0.40.0

func (m *MsgSubmitProposalResponse) Size() (n int)

func (*MsgSubmitProposalResponse) String added in v0.40.0

func (m *MsgSubmitProposalResponse) String() string

func (*MsgSubmitProposalResponse) Unmarshal added in v0.40.0

func (m *MsgSubmitProposalResponse) Unmarshal(dAtA []byte) error

func (*MsgSubmitProposalResponse) XXX_DiscardUnknown added in v0.40.0

func (m *MsgSubmitProposalResponse) XXX_DiscardUnknown()

func (*MsgSubmitProposalResponse) XXX_Marshal added in v0.40.0

func (m *MsgSubmitProposalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgSubmitProposalResponse) XXX_Merge added in v0.40.0

func (m *MsgSubmitProposalResponse) XXX_Merge(src proto.Message)

func (*MsgSubmitProposalResponse) XXX_Size added in v0.40.0

func (m *MsgSubmitProposalResponse) XXX_Size() int

func (*MsgSubmitProposalResponse) XXX_Unmarshal added in v0.40.0

func (m *MsgSubmitProposalResponse) XXX_Unmarshal(b []byte) error

type MsgVote

type MsgVote struct {
	ProposalId uint64     `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id" yaml:"proposal_id"`
	Voter      string     `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"`
	Option     VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=cosmos.gov.v1beta1.VoteOption" json:"option,omitempty"`
}

MsgVote defines a message to cast a vote.

func NewMsgVote

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

NewMsgVote creates a message to cast a vote on an active proposal

func (*MsgVote) Descriptor

func (*MsgVote) Descriptor() ([]byte, []int)

func (MsgVote) GetSignBytes

func (msg MsgVote) GetSignBytes() []byte

GetSignBytes implements Msg

func (MsgVote) GetSigners

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

GetSigners implements Msg

func (*MsgVote) Marshal

func (m *MsgVote) Marshal() (dAtA []byte, err error)

func (*MsgVote) MarshalTo

func (m *MsgVote) MarshalTo(dAtA []byte) (int, error)

func (*MsgVote) MarshalToSizedBuffer

func (m *MsgVote) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgVote) ProtoMessage

func (*MsgVote) ProtoMessage()

func (*MsgVote) Reset

func (m *MsgVote) Reset()

func (MsgVote) Route

func (msg MsgVote) Route() string

Route implements Msg

func (*MsgVote) Size

func (m *MsgVote) Size() (n int)

func (MsgVote) String

func (msg MsgVote) String() string

String implements the Stringer interface

func (MsgVote) Type

func (msg MsgVote) Type() string

Type implements Msg

func (*MsgVote) Unmarshal

func (m *MsgVote) Unmarshal(dAtA []byte) error

func (MsgVote) ValidateBasic

func (msg MsgVote) ValidateBasic() error

ValidateBasic implements Msg

func (*MsgVote) XXX_DiscardUnknown

func (m *MsgVote) XXX_DiscardUnknown()

func (*MsgVote) XXX_Marshal

func (m *MsgVote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgVote) XXX_Merge

func (m *MsgVote) XXX_Merge(src proto.Message)

func (*MsgVote) XXX_Size

func (m *MsgVote) XXX_Size() int

func (*MsgVote) XXX_Unmarshal

func (m *MsgVote) XXX_Unmarshal(b []byte) error

type MsgVoteResponse added in v0.40.0

type MsgVoteResponse struct {
}

MsgVoteResponse defines the Msg/Vote response type.

func (*MsgVoteResponse) Descriptor added in v0.40.0

func (*MsgVoteResponse) Descriptor() ([]byte, []int)

func (*MsgVoteResponse) Marshal added in v0.40.0

func (m *MsgVoteResponse) Marshal() (dAtA []byte, err error)

func (*MsgVoteResponse) MarshalTo added in v0.40.0

func (m *MsgVoteResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgVoteResponse) MarshalToSizedBuffer added in v0.40.0

func (m *MsgVoteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgVoteResponse) ProtoMessage added in v0.40.0

func (*MsgVoteResponse) ProtoMessage()

func (*MsgVoteResponse) Reset added in v0.40.0

func (m *MsgVoteResponse) Reset()

func (*MsgVoteResponse) Size added in v0.40.0

func (m *MsgVoteResponse) Size() (n int)

func (*MsgVoteResponse) String added in v0.40.0

func (m *MsgVoteResponse) String() string

func (*MsgVoteResponse) Unmarshal added in v0.40.0

func (m *MsgVoteResponse) Unmarshal(dAtA []byte) error

func (*MsgVoteResponse) XXX_DiscardUnknown added in v0.40.0

func (m *MsgVoteResponse) XXX_DiscardUnknown()

func (*MsgVoteResponse) XXX_Marshal added in v0.40.0

func (m *MsgVoteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgVoteResponse) XXX_Merge added in v0.40.0

func (m *MsgVoteResponse) XXX_Merge(src proto.Message)

func (*MsgVoteResponse) XXX_Size added in v0.40.0

func (m *MsgVoteResponse) XXX_Size() int

func (*MsgVoteResponse) XXX_Unmarshal added in v0.40.0

func (m *MsgVoteResponse) XXX_Unmarshal(b []byte) error

type MsgVoteWeighted added in v0.43.0

type MsgVoteWeighted struct {
	ProposalId uint64               `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id" yaml:"proposal_id"`
	Voter      string               `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"`
	Options    []WeightedVoteOption `protobuf:"bytes,3,rep,name=options,proto3" json:"options"`
}

MsgVote defines a message to cast a vote.

func NewMsgVoteWeighted added in v0.43.0

func NewMsgVoteWeighted(voter sdk.AccAddress, proposalID uint64, options WeightedVoteOptions) *MsgVoteWeighted

NewMsgVoteWeighted creates a message to cast a vote on an active proposal

func (*MsgVoteWeighted) Descriptor added in v0.43.0

func (*MsgVoteWeighted) Descriptor() ([]byte, []int)

func (MsgVoteWeighted) GetSignBytes added in v0.43.0

func (msg MsgVoteWeighted) GetSignBytes() []byte

GetSignBytes implements Msg

func (MsgVoteWeighted) GetSigners added in v0.43.0

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

GetSigners implements Msg

func (*MsgVoteWeighted) Marshal added in v0.43.0

func (m *MsgVoteWeighted) Marshal() (dAtA []byte, err error)

func (*MsgVoteWeighted) MarshalTo added in v0.43.0

func (m *MsgVoteWeighted) MarshalTo(dAtA []byte) (int, error)

func (*MsgVoteWeighted) MarshalToSizedBuffer added in v0.43.0

func (m *MsgVoteWeighted) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgVoteWeighted) ProtoMessage added in v0.43.0

func (*MsgVoteWeighted) ProtoMessage()

func (*MsgVoteWeighted) Reset added in v0.43.0

func (m *MsgVoteWeighted) Reset()

func (MsgVoteWeighted) Route added in v0.43.0

func (msg MsgVoteWeighted) Route() string

Route implements Msg

func (*MsgVoteWeighted) Size added in v0.43.0

func (m *MsgVoteWeighted) Size() (n int)

func (MsgVoteWeighted) String added in v0.43.0

func (msg MsgVoteWeighted) String() string

String implements the Stringer interface

func (MsgVoteWeighted) Type added in v0.43.0

func (msg MsgVoteWeighted) Type() string

Type implements Msg

func (*MsgVoteWeighted) Unmarshal added in v0.43.0

func (m *MsgVoteWeighted) Unmarshal(dAtA []byte) error

func (MsgVoteWeighted) ValidateBasic added in v0.43.0

func (msg MsgVoteWeighted) ValidateBasic() error

ValidateBasic implements Msg

func (*MsgVoteWeighted) XXX_DiscardUnknown added in v0.43.0

func (m *MsgVoteWeighted) XXX_DiscardUnknown()

func (*MsgVoteWeighted) XXX_Marshal added in v0.43.0

func (m *MsgVoteWeighted) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgVoteWeighted) XXX_Merge added in v0.43.0

func (m *MsgVoteWeighted) XXX_Merge(src proto.Message)

func (*MsgVoteWeighted) XXX_Size added in v0.43.0

func (m *MsgVoteWeighted) XXX_Size() int

func (*MsgVoteWeighted) XXX_Unmarshal added in v0.43.0

func (m *MsgVoteWeighted) XXX_Unmarshal(b []byte) error

type MsgVoteWeightedResponse added in v0.43.0

type MsgVoteWeightedResponse struct {
}

MsgVoteWeightedResponse defines the Msg/VoteWeighted response type.

func (*MsgVoteWeightedResponse) Descriptor added in v0.43.0

func (*MsgVoteWeightedResponse) Descriptor() ([]byte, []int)

func (*MsgVoteWeightedResponse) Marshal added in v0.43.0

func (m *MsgVoteWeightedResponse) Marshal() (dAtA []byte, err error)

func (*MsgVoteWeightedResponse) MarshalTo added in v0.43.0

func (m *MsgVoteWeightedResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgVoteWeightedResponse) MarshalToSizedBuffer added in v0.43.0

func (m *MsgVoteWeightedResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgVoteWeightedResponse) ProtoMessage added in v0.43.0

func (*MsgVoteWeightedResponse) ProtoMessage()

func (*MsgVoteWeightedResponse) Reset added in v0.43.0

func (m *MsgVoteWeightedResponse) Reset()

func (*MsgVoteWeightedResponse) Size added in v0.43.0

func (m *MsgVoteWeightedResponse) Size() (n int)

func (*MsgVoteWeightedResponse) String added in v0.43.0

func (m *MsgVoteWeightedResponse) String() string

func (*MsgVoteWeightedResponse) Unmarshal added in v0.43.0

func (m *MsgVoteWeightedResponse) Unmarshal(dAtA []byte) error

func (*MsgVoteWeightedResponse) XXX_DiscardUnknown added in v0.43.0

func (m *MsgVoteWeightedResponse) XXX_DiscardUnknown()

func (*MsgVoteWeightedResponse) XXX_Marshal added in v0.43.0

func (m *MsgVoteWeightedResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgVoteWeightedResponse) XXX_Merge added in v0.43.0

func (m *MsgVoteWeightedResponse) XXX_Merge(src proto.Message)

func (*MsgVoteWeightedResponse) XXX_Size added in v0.43.0

func (m *MsgVoteWeightedResponse) XXX_Size() int

func (*MsgVoteWeightedResponse) XXX_Unmarshal added in v0.43.0

func (m *MsgVoteWeightedResponse) XXX_Unmarshal(b []byte) error

type MultiGovHooks added in v0.43.0

type MultiGovHooks []GovHooks

combine multiple governance hooks, all hook functions are run in array sequence

func NewMultiGovHooks added in v0.43.0

func NewMultiGovHooks(hooks ...GovHooks) MultiGovHooks

func (MultiGovHooks) AfterProposalDeposit added in v0.43.0

func (h MultiGovHooks) AfterProposalDeposit(ctx sdk.Context, proposalID uint64, depositorAddr sdk.AccAddress)

func (MultiGovHooks) AfterProposalFailedMinDeposit added in v0.43.0

func (h MultiGovHooks) AfterProposalFailedMinDeposit(ctx sdk.Context, proposalID uint64)

func (MultiGovHooks) AfterProposalSubmission added in v0.43.0

func (h MultiGovHooks) AfterProposalSubmission(ctx sdk.Context, proposalID uint64)

func (MultiGovHooks) AfterProposalVote added in v0.43.0

func (h MultiGovHooks) AfterProposalVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.AccAddress)

func (MultiGovHooks) AfterProposalVotingPeriodEnded added in v0.43.0

func (h MultiGovHooks) AfterProposalVotingPeriodEnded(ctx sdk.Context, proposalID uint64)

type ParamSubspace

type ParamSubspace interface {
	Get(ctx sdk.Context, key []byte, ptr interface{})
	Set(ctx sdk.Context, key []byte, param interface{})
}

ParamSubspace defines the expected Subspace interface for parameters (noalias)

type Params

type Params struct {
	VotingParams  VotingParams  `json:"voting_params" yaml:"voting_params"`
	TallyParams   TallyParams   `json:"tally_params" yaml:"tally_params"`
	DepositParams DepositParams `json:"deposit_params" yaml:"deposit_params"`
}

Params returns all of the governance params

func DefaultParams

func DefaultParams() Params

DefaultParams default governance params

func NewParams

func NewParams(vp VotingParams, tp TallyParams, dp DepositParams) Params

NewParams creates a new gov Params instance

func (Params) String

func (gp Params) String() string

type Proposal

type Proposal struct {
	ProposalId       uint64                                   `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"id" yaml:"id"`
	Content          *types1.Any                              `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
	Status           ProposalStatus                           `` /* 128-byte string literal not displayed */
	FinalTallyResult TallyResult                              `` /* 127-byte string literal not displayed */
	SubmitTime       time.Time                                `protobuf:"bytes,5,opt,name=submit_time,json=submitTime,proto3,stdtime" json:"submit_time" yaml:"submit_time"`
	DepositEndTime   time.Time                                `` /* 127-byte string literal not displayed */
	TotalDeposit     github_com_cosmos_cosmos_sdk_types.Coins `` /* 162-byte string literal not displayed */
	VotingStartTime  time.Time                                `` /* 131-byte string literal not displayed */
	VotingEndTime    time.Time                                `protobuf:"bytes,9,opt,name=voting_end_time,json=votingEndTime,proto3,stdtime" json:"voting_end_time" yaml:"voting_end_time"`
}

Proposal defines the core field members of a governance proposal.

func NewProposal

func NewProposal(content Content, id uint64, submitTime, depositEndTime time.Time) (Proposal, error)

NewProposal creates a new Proposal instance

func (*Proposal) Descriptor added in v0.40.0

func (*Proposal) Descriptor() ([]byte, []int)

func (*Proposal) Equal

func (this *Proposal) Equal(that interface{}) bool

func (Proposal) GetContent added in v0.40.0

func (p Proposal) GetContent() Content

GetContent returns the proposal Content

func (Proposal) GetTitle added in v0.40.0

func (p Proposal) GetTitle() string

func (*Proposal) Marshal added in v0.40.0

func (m *Proposal) Marshal() (dAtA []byte, err error)

func (*Proposal) MarshalTo added in v0.40.0

func (m *Proposal) MarshalTo(dAtA []byte) (int, error)

func (*Proposal) MarshalToSizedBuffer added in v0.40.0

func (m *Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (Proposal) ProposalRoute added in v0.40.0

func (p Proposal) ProposalRoute() string

func (Proposal) ProposalType added in v0.40.0

func (p Proposal) ProposalType() string

func (*Proposal) ProtoMessage added in v0.40.0

func (*Proposal) ProtoMessage()

func (*Proposal) Reset added in v0.40.0

func (m *Proposal) Reset()

func (*Proposal) Size added in v0.40.0

func (m *Proposal) Size() (n int)

func (Proposal) String

func (p Proposal) String() string

String implements stringer interface

func (*Proposal) Unmarshal added in v0.40.0

func (m *Proposal) Unmarshal(dAtA []byte) error

func (Proposal) UnpackInterfaces added in v0.40.0

func (p Proposal) UnpackInterfaces(unpacker types.AnyUnpacker) error

UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces

func (*Proposal) XXX_DiscardUnknown added in v0.40.0

func (m *Proposal) XXX_DiscardUnknown()

func (*Proposal) XXX_Marshal added in v0.40.0

func (m *Proposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Proposal) XXX_Merge added in v0.40.0

func (m *Proposal) XXX_Merge(src proto.Message)

func (*Proposal) XXX_Size added in v0.40.0

func (m *Proposal) XXX_Size() int

func (*Proposal) XXX_Unmarshal added in v0.40.0

func (m *Proposal) XXX_Unmarshal(b []byte) error

type ProposalQueue

type ProposalQueue []uint64

ProposalQueue defines a queue for proposal ids

type ProposalStatus

type ProposalStatus int32

ProposalStatus enumerates the valid statuses of a proposal.

const (
	// PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status.
	StatusNil ProposalStatus = 0
	// PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit
	// period.
	StatusDepositPeriod ProposalStatus = 1
	// PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting
	// period.
	StatusVotingPeriod ProposalStatus = 2
	// PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has
	// passed.
	StatusPassed ProposalStatus = 3
	// PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has
	// been rejected.
	StatusRejected ProposalStatus = 4
	// PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has
	// failed.
	StatusFailed ProposalStatus = 5
)

func ProposalStatusFromString

func ProposalStatusFromString(str string) (ProposalStatus, error)

ProposalStatusFromString turns a string into a ProposalStatus

func (ProposalStatus) EnumDescriptor

func (ProposalStatus) EnumDescriptor() ([]byte, []int)

func (ProposalStatus) Format

func (status ProposalStatus) Format(s fmt.State, verb rune)

Format implements the fmt.Formatter interface. nolint: errcheck

func (ProposalStatus) Marshal

func (status ProposalStatus) Marshal() ([]byte, error)

Marshal needed for protobuf compatibility

func (ProposalStatus) String

func (x ProposalStatus) String() string

func (*ProposalStatus) Unmarshal

func (status *ProposalStatus) Unmarshal(data []byte) error

Unmarshal needed for protobuf compatibility

type Proposals

type Proposals []Proposal

Proposals is an array of proposal

func (Proposals) Equal

func (p Proposals) Equal(other Proposals) bool

Equal returns true if two slices (order-dependant) of proposals are equal.

func (Proposals) String

func (p Proposals) String() string

String implements stringer interface

func (Proposals) UnpackInterfaces added in v0.40.0

func (p Proposals) UnpackInterfaces(unpacker types.AnyUnpacker) error

UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces

type QueryClient added in v0.40.0

type QueryClient interface {
	// Proposal queries proposal details based on ProposalID.
	Proposal(ctx context.Context, in *QueryProposalRequest, opts ...grpc.CallOption) (*QueryProposalResponse, error)
	// Proposals queries all proposals based on given status.
	Proposals(ctx context.Context, in *QueryProposalsRequest, opts ...grpc.CallOption) (*QueryProposalsResponse, error)
	// Vote queries voted information based on proposalID, voterAddr.
	Vote(ctx context.Context, in *QueryVoteRequest, opts ...grpc.CallOption) (*QueryVoteResponse, error)
	// Votes queries votes of a given proposal.
	Votes(ctx context.Context, in *QueryVotesRequest, opts ...grpc.CallOption) (*QueryVotesResponse, error)
	// Params queries all parameters of the gov module.
	Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
	// Deposit queries single deposit information based proposalID, depositAddr.
	Deposit(ctx context.Context, in *QueryDepositRequest, opts ...grpc.CallOption) (*QueryDepositResponse, error)
	// Deposits queries all deposits of a single proposal.
	Deposits(ctx context.Context, in *QueryDepositsRequest, opts ...grpc.CallOption) (*QueryDepositsResponse, error)
	// TallyResult queries the tally of a proposal vote.
	TallyResult(ctx context.Context, in *QueryTallyResultRequest, opts ...grpc.CallOption) (*QueryTallyResultResponse, error)
}

QueryClient is the client API for Query service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewQueryClient added in v0.40.0

func NewQueryClient(cc grpc1.ClientConn) QueryClient

type QueryDepositParams

type QueryDepositParams struct {
	ProposalID uint64
	Depositor  sdk.AccAddress
}

QueryDepositParams params for query 'custom/gov/deposit'

func NewQueryDepositParams

func NewQueryDepositParams(proposalID uint64, depositor sdk.AccAddress) QueryDepositParams

NewQueryDepositParams creates a new instance of QueryDepositParams

type QueryDepositRequest added in v0.40.0

type QueryDepositRequest struct {
	// proposal_id defines the unique id of the proposal.
	ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"`
	// depositor defines the deposit addresses from the proposals.
	Depositor string `protobuf:"bytes,2,opt,name=depositor,proto3" json:"depositor,omitempty"`
}

QueryDepositRequest is the request type for the Query/Deposit RPC method.

func (*QueryDepositRequest) Descriptor added in v0.40.0

func (*QueryDepositRequest) Descriptor() ([]byte, []int)

func (*QueryDepositRequest) Marshal added in v0.40.0

func (m *QueryDepositRequest) Marshal() (dAtA []byte, err error)

func (*QueryDepositRequest) MarshalTo added in v0.40.0

func (m *QueryDepositRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryDepositRequest) MarshalToSizedBuffer added in v0.40.0

func (m *QueryDepositRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryDepositRequest) ProtoMessage added in v0.40.0

func (*QueryDepositRequest) ProtoMessage()

func (*QueryDepositRequest) Reset added in v0.40.0

func (m *QueryDepositRequest) Reset()

func (*QueryDepositRequest) Size added in v0.40.0

func (m *QueryDepositRequest) Size() (n int)

func (*QueryDepositRequest) String added in v0.40.0

func (m *QueryDepositRequest) String() string

func (*QueryDepositRequest) Unmarshal added in v0.40.0

func (m *QueryDepositRequest) Unmarshal(dAtA []byte) error

func (*QueryDepositRequest) XXX_DiscardUnknown added in v0.40.0

func (m *QueryDepositRequest) XXX_DiscardUnknown()

func (*QueryDepositRequest) XXX_Marshal added in v0.40.0

func (m *QueryDepositRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryDepositRequest) XXX_Merge added in v0.40.0

func (m *QueryDepositRequest) XXX_Merge(src proto.Message)

func (*QueryDepositRequest) XXX_Size added in v0.40.0

func (m *QueryDepositRequest) XXX_Size() int

func (*QueryDepositRequest) XXX_Unmarshal added in v0.40.0

func (m *QueryDepositRequest) XXX_Unmarshal(b []byte) error

type QueryDepositResponse added in v0.40.0

type QueryDepositResponse struct {
	// deposit defines the requested deposit.
	Deposit Deposit `protobuf:"bytes,1,opt,name=deposit,proto3" json:"deposit"`
}

QueryDepositResponse is the response type for the Query/Deposit RPC method.

func (*QueryDepositResponse) Descriptor added in v0.40.0

func (*QueryDepositResponse) Descriptor() ([]byte, []int)

func (*QueryDepositResponse) GetDeposit added in v0.40.0

func (m *QueryDepositResponse) GetDeposit() Deposit

func (*QueryDepositResponse) Marshal added in v0.40.0

func (m *QueryDepositResponse) Marshal() (dAtA []byte, err error)

func (*QueryDepositResponse) MarshalTo added in v0.40.0

func (m *QueryDepositResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryDepositResponse) MarshalToSizedBuffer added in v0.40.0

func (m *QueryDepositResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryDepositResponse) ProtoMessage added in v0.40.0

func (*QueryDepositResponse) ProtoMessage()

func (*QueryDepositResponse) Reset added in v0.40.0

func (m *QueryDepositResponse) Reset()

func (*QueryDepositResponse) Size added in v0.40.0

func (m *QueryDepositResponse) Size() (n int)

func (*QueryDepositResponse) String added in v0.40.0

func (m *QueryDepositResponse) String() string

func (*QueryDepositResponse) Unmarshal added in v0.40.0

func (m *QueryDepositResponse) Unmarshal(dAtA []byte) error

func (*QueryDepositResponse) XXX_DiscardUnknown added in v0.40.0

func (m *QueryDepositResponse) XXX_DiscardUnknown()

func (*QueryDepositResponse) XXX_Marshal added in v0.40.0

func (m *QueryDepositResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryDepositResponse) XXX_Merge added in v0.40.0

func (m *QueryDepositResponse) XXX_Merge(src proto.Message)

func (*QueryDepositResponse) XXX_Size added in v0.40.0

func (m *QueryDepositResponse) XXX_Size() int

func (*QueryDepositResponse) XXX_Unmarshal added in v0.40.0

func (m *QueryDepositResponse) XXX_Unmarshal(b []byte) error

type QueryDepositsRequest added in v0.40.0

type QueryDepositsRequest struct {
	// proposal_id defines the unique id of the proposal.
	ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"`
	// pagination defines an optional pagination for the request.
	Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryDepositsRequest is the request type for the Query/Deposits RPC method.

func (*QueryDepositsRequest) Descriptor added in v0.40.0

func (*QueryDepositsRequest) Descriptor() ([]byte, []int)

func (*QueryDepositsRequest) GetPagination added in v0.40.0

func (m *QueryDepositsRequest) GetPagination() *query.PageRequest

func (*QueryDepositsRequest) GetProposalId added in v0.40.0

func (m *QueryDepositsRequest) GetProposalId() uint64

func (*QueryDepositsRequest) Marshal added in v0.40.0

func (m *QueryDepositsRequest) Marshal() (dAtA []byte, err error)

func (*QueryDepositsRequest) MarshalTo added in v0.40.0

func (m *QueryDepositsRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryDepositsRequest) MarshalToSizedBuffer added in v0.40.0

func (m *QueryDepositsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryDepositsRequest) ProtoMessage added in v0.40.0

func (*QueryDepositsRequest) ProtoMessage()

func (*QueryDepositsRequest) Reset added in v0.40.0

func (m *QueryDepositsRequest) Reset()

func (*QueryDepositsRequest) Size added in v0.40.0

func (m *QueryDepositsRequest) Size() (n int)

func (*QueryDepositsRequest) String added in v0.40.0

func (m *QueryDepositsRequest) String() string

func (*QueryDepositsRequest) Unmarshal added in v0.40.0

func (m *QueryDepositsRequest) Unmarshal(dAtA []byte) error

func (*QueryDepositsRequest) XXX_DiscardUnknown added in v0.40.0

func (m *QueryDepositsRequest) XXX_DiscardUnknown()

func (*QueryDepositsRequest) XXX_Marshal added in v0.40.0

func (m *QueryDepositsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryDepositsRequest) XXX_Merge added in v0.40.0

func (m *QueryDepositsRequest) XXX_Merge(src proto.Message)

func (*QueryDepositsRequest) XXX_Size added in v0.40.0

func (m *QueryDepositsRequest) XXX_Size() int

func (*QueryDepositsRequest) XXX_Unmarshal added in v0.40.0

func (m *QueryDepositsRequest) XXX_Unmarshal(b []byte) error

type QueryDepositsResponse added in v0.40.0

type QueryDepositsResponse struct {
	Deposits []Deposit `protobuf:"bytes,1,rep,name=deposits,proto3" json:"deposits"`
	// pagination defines the pagination in the response.
	Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryDepositsResponse is the response type for the Query/Deposits RPC method.

func (*QueryDepositsResponse) Descriptor added in v0.40.0

func (*QueryDepositsResponse) Descriptor() ([]byte, []int)

func (*QueryDepositsResponse) GetDeposits added in v0.40.0

func (m *QueryDepositsResponse) GetDeposits() []Deposit

func (*QueryDepositsResponse) GetPagination added in v0.40.0

func (m *QueryDepositsResponse) GetPagination() *query.PageResponse

func (*QueryDepositsResponse) Marshal added in v0.40.0

func (m *QueryDepositsResponse) Marshal() (dAtA []byte, err error)

func (*QueryDepositsResponse) MarshalTo added in v0.40.0

func (m *QueryDepositsResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryDepositsResponse) MarshalToSizedBuffer added in v0.40.0

func (m *QueryDepositsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryDepositsResponse) ProtoMessage added in v0.40.0

func (*QueryDepositsResponse) ProtoMessage()

func (*QueryDepositsResponse) Reset added in v0.40.0

func (m *QueryDepositsResponse) Reset()

func (*QueryDepositsResponse) Size added in v0.40.0

func (m *QueryDepositsResponse) Size() (n int)

func (*QueryDepositsResponse) String added in v0.40.0

func (m *QueryDepositsResponse) String() string

func (*QueryDepositsResponse) Unmarshal added in v0.40.0

func (m *QueryDepositsResponse) Unmarshal(dAtA []byte) error

func (*QueryDepositsResponse) XXX_DiscardUnknown added in v0.40.0

func (m *QueryDepositsResponse) XXX_DiscardUnknown()

func (*QueryDepositsResponse) XXX_Marshal added in v0.40.0

func (m *QueryDepositsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryDepositsResponse) XXX_Merge added in v0.40.0

func (m *QueryDepositsResponse) XXX_Merge(src proto.Message)

func (*QueryDepositsResponse) XXX_Size added in v0.40.0

func (m *QueryDepositsResponse) XXX_Size() int

func (*QueryDepositsResponse) XXX_Unmarshal added in v0.40.0

func (m *QueryDepositsResponse) XXX_Unmarshal(b []byte) error

type QueryParamsRequest added in v0.40.0

type QueryParamsRequest struct {
	// params_type defines which parameters to query for, can be one of "voting",
	// "tallying" or "deposit".
	ParamsType string `protobuf:"bytes,1,opt,name=params_type,json=paramsType,proto3" json:"params_type,omitempty"`
}

QueryParamsRequest is the request type for the Query/Params RPC method.

func (*QueryParamsRequest) Descriptor added in v0.40.0

func (*QueryParamsRequest) Descriptor() ([]byte, []int)

func (*QueryParamsRequest) GetParamsType added in v0.40.0

func (m *QueryParamsRequest) GetParamsType() string

func (*QueryParamsRequest) Marshal added in v0.40.0

func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error)

func (*QueryParamsRequest) MarshalTo added in v0.40.0

func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryParamsRequest) MarshalToSizedBuffer added in v0.40.0

func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryParamsRequest) ProtoMessage added in v0.40.0

func (*QueryParamsRequest) ProtoMessage()

func (*QueryParamsRequest) Reset added in v0.40.0

func (m *QueryParamsRequest) Reset()

func (*QueryParamsRequest) Size added in v0.40.0

func (m *QueryParamsRequest) Size() (n int)

func (*QueryParamsRequest) String added in v0.40.0

func (m *QueryParamsRequest) String() string

func (*QueryParamsRequest) Unmarshal added in v0.40.0

func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error

func (*QueryParamsRequest) XXX_DiscardUnknown added in v0.40.0

func (m *QueryParamsRequest) XXX_DiscardUnknown()

func (*QueryParamsRequest) XXX_Marshal added in v0.40.0

func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryParamsRequest) XXX_Merge added in v0.40.0

func (m *QueryParamsRequest) XXX_Merge(src proto.Message)

func (*QueryParamsRequest) XXX_Size added in v0.40.0

func (m *QueryParamsRequest) XXX_Size() int

func (*QueryParamsRequest) XXX_Unmarshal added in v0.40.0

func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error

type QueryParamsResponse added in v0.40.0

type QueryParamsResponse struct {
	// voting_params defines the parameters related to voting.
	VotingParams VotingParams `protobuf:"bytes,1,opt,name=voting_params,json=votingParams,proto3" json:"voting_params"`
	// deposit_params defines the parameters related to deposit.
	DepositParams DepositParams `protobuf:"bytes,2,opt,name=deposit_params,json=depositParams,proto3" json:"deposit_params"`
	// tally_params defines the parameters related to tally.
	TallyParams TallyParams `protobuf:"bytes,3,opt,name=tally_params,json=tallyParams,proto3" json:"tally_params"`
}

QueryParamsResponse is the response type for the Query/Params RPC method.

func (*QueryParamsResponse) Descriptor added in v0.40.0

func (*QueryParamsResponse) Descriptor() ([]byte, []int)

func (*QueryParamsResponse) GetDepositParams added in v0.40.0

func (m *QueryParamsResponse) GetDepositParams() DepositParams

func (*QueryParamsResponse) GetTallyParams added in v0.40.0

func (m *QueryParamsResponse) GetTallyParams() TallyParams

func (*QueryParamsResponse) GetVotingParams added in v0.40.0

func (m *QueryParamsResponse) GetVotingParams() VotingParams

func (*QueryParamsResponse) Marshal added in v0.40.0

func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error)

func (*QueryParamsResponse) MarshalTo added in v0.40.0

func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryParamsResponse) MarshalToSizedBuffer added in v0.40.0

func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryParamsResponse) ProtoMessage added in v0.40.0

func (*QueryParamsResponse) ProtoMessage()

func (*QueryParamsResponse) Reset added in v0.40.0

func (m *QueryParamsResponse) Reset()

func (*QueryParamsResponse) Size added in v0.40.0

func (m *QueryParamsResponse) Size() (n int)

func (*QueryParamsResponse) String added in v0.40.0

func (m *QueryParamsResponse) String() string

func (*QueryParamsResponse) Unmarshal added in v0.40.0

func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error

func (*QueryParamsResponse) XXX_DiscardUnknown added in v0.40.0

func (m *QueryParamsResponse) XXX_DiscardUnknown()

func (*QueryParamsResponse) XXX_Marshal added in v0.40.0

func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryParamsResponse) XXX_Merge added in v0.40.0

func (m *QueryParamsResponse) XXX_Merge(src proto.Message)

func (*QueryParamsResponse) XXX_Size added in v0.40.0

func (m *QueryParamsResponse) XXX_Size() int

func (*QueryParamsResponse) XXX_Unmarshal added in v0.40.0

func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error

type QueryProposalParams

type QueryProposalParams struct {
	ProposalID uint64
}

QueryProposalParams Params for queries: - 'custom/gov/proposal' - 'custom/gov/deposits' - 'custom/gov/tally'

func NewQueryProposalParams

func NewQueryProposalParams(proposalID uint64) QueryProposalParams

NewQueryProposalParams creates a new instance of QueryProposalParams

type QueryProposalRequest added in v0.40.0

type QueryProposalRequest struct {
	// proposal_id defines the unique id of the proposal.
	ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"`
}

QueryProposalRequest is the request type for the Query/Proposal RPC method.

func (*QueryProposalRequest) Descriptor added in v0.40.0

func (*QueryProposalRequest) Descriptor() ([]byte, []int)

func (*QueryProposalRequest) GetProposalId added in v0.40.0

func (m *QueryProposalRequest) GetProposalId() uint64

func (*QueryProposalRequest) Marshal added in v0.40.0

func (m *QueryProposalRequest) Marshal() (dAtA []byte, err error)

func (*QueryProposalRequest) MarshalTo added in v0.40.0

func (m *QueryProposalRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryProposalRequest) MarshalToSizedBuffer added in v0.40.0

func (m *QueryProposalRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryProposalRequest) ProtoMessage added in v0.40.0

func (*QueryProposalRequest) ProtoMessage()

func (*QueryProposalRequest) Reset added in v0.40.0

func (m *QueryProposalRequest) Reset()

func (*QueryProposalRequest) Size added in v0.40.0

func (m *QueryProposalRequest) Size() (n int)

func (*QueryProposalRequest) String added in v0.40.0

func (m *QueryProposalRequest) String() string

func (*QueryProposalRequest) Unmarshal added in v0.40.0

func (m *QueryProposalRequest) Unmarshal(dAtA []byte) error

func (*QueryProposalRequest) XXX_DiscardUnknown added in v0.40.0

func (m *QueryProposalRequest) XXX_DiscardUnknown()

func (*QueryProposalRequest) XXX_Marshal added in v0.40.0

func (m *QueryProposalRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryProposalRequest) XXX_Merge added in v0.40.0

func (m *QueryProposalRequest) XXX_Merge(src proto.Message)

func (*QueryProposalRequest) XXX_Size added in v0.40.0

func (m *QueryProposalRequest) XXX_Size() int

func (*QueryProposalRequest) XXX_Unmarshal added in v0.40.0

func (m *QueryProposalRequest) XXX_Unmarshal(b []byte) error

type QueryProposalResponse added in v0.40.0

type QueryProposalResponse struct {
	Proposal Proposal `protobuf:"bytes,1,opt,name=proposal,proto3" json:"proposal"`
}

QueryProposalResponse is the response type for the Query/Proposal RPC method.

func (*QueryProposalResponse) Descriptor added in v0.40.0

func (*QueryProposalResponse) Descriptor() ([]byte, []int)

func (*QueryProposalResponse) GetProposal added in v0.40.0

func (m *QueryProposalResponse) GetProposal() Proposal

func (*QueryProposalResponse) Marshal added in v0.40.0

func (m *QueryProposalResponse) Marshal() (dAtA []byte, err error)

func (*QueryProposalResponse) MarshalTo added in v0.40.0

func (m *QueryProposalResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryProposalResponse) MarshalToSizedBuffer added in v0.40.0

func (m *QueryProposalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryProposalResponse) ProtoMessage added in v0.40.0

func (*QueryProposalResponse) ProtoMessage()

func (*QueryProposalResponse) Reset added in v0.40.0

func (m *QueryProposalResponse) Reset()

func (*QueryProposalResponse) Size added in v0.40.0

func (m *QueryProposalResponse) Size() (n int)

func (*QueryProposalResponse) String added in v0.40.0

func (m *QueryProposalResponse) String() string

func (*QueryProposalResponse) Unmarshal added in v0.40.0

func (m *QueryProposalResponse) Unmarshal(dAtA []byte) error

func (*QueryProposalResponse) XXX_DiscardUnknown added in v0.40.0

func (m *QueryProposalResponse) XXX_DiscardUnknown()

func (*QueryProposalResponse) XXX_Marshal added in v0.40.0

func (m *QueryProposalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryProposalResponse) XXX_Merge added in v0.40.0

func (m *QueryProposalResponse) XXX_Merge(src proto.Message)

func (*QueryProposalResponse) XXX_Size added in v0.40.0

func (m *QueryProposalResponse) XXX_Size() int

func (*QueryProposalResponse) XXX_Unmarshal added in v0.40.0

func (m *QueryProposalResponse) XXX_Unmarshal(b []byte) error

type QueryProposalVotesParams

type QueryProposalVotesParams struct {
	ProposalID uint64
	Page       int
	Limit      int
}

QueryProposalVotesParams used for queries to 'custom/gov/votes'.

func NewQueryProposalVotesParams

func NewQueryProposalVotesParams(proposalID uint64, page, limit int) QueryProposalVotesParams

NewQueryProposalVotesParams creates new instance of the QueryProposalVotesParams.

type QueryProposalsParams

type QueryProposalsParams struct {
	Page           int
	Limit          int
	Voter          sdk.AccAddress
	Depositor      sdk.AccAddress
	ProposalStatus ProposalStatus
}

QueryProposalsParams Params for query 'custom/gov/proposals'

func NewQueryProposalsParams

func NewQueryProposalsParams(page, limit int, status ProposalStatus, voter, depositor sdk.AccAddress) QueryProposalsParams

NewQueryProposalsParams creates a new instance of QueryProposalsParams

type QueryProposalsRequest added in v0.40.0

type QueryProposalsRequest struct {
	// proposal_status defines the status of the proposals.
	ProposalStatus ProposalStatus `` /* 143-byte string literal not displayed */
	// voter defines the voter address for the proposals.
	Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"`
	// depositor defines the deposit addresses from the proposals.
	Depositor string `protobuf:"bytes,3,opt,name=depositor,proto3" json:"depositor,omitempty"`
	// pagination defines an optional pagination for the request.
	Pagination *query.PageRequest `protobuf:"bytes,4,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryProposalsRequest is the request type for the Query/Proposals RPC method.

func (*QueryProposalsRequest) Descriptor added in v0.40.0

func (*QueryProposalsRequest) Descriptor() ([]byte, []int)

func (*QueryProposalsRequest) Marshal added in v0.40.0

func (m *QueryProposalsRequest) Marshal() (dAtA []byte, err error)

func (*QueryProposalsRequest) MarshalTo added in v0.40.0

func (m *QueryProposalsRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryProposalsRequest) MarshalToSizedBuffer added in v0.40.0

func (m *QueryProposalsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryProposalsRequest) ProtoMessage added in v0.40.0

func (*QueryProposalsRequest) ProtoMessage()

func (*QueryProposalsRequest) Reset added in v0.40.0

func (m *QueryProposalsRequest) Reset()

func (*QueryProposalsRequest) Size added in v0.40.0

func (m *QueryProposalsRequest) Size() (n int)

func (*QueryProposalsRequest) String added in v0.40.0

func (m *QueryProposalsRequest) String() string

func (*QueryProposalsRequest) Unmarshal added in v0.40.0

func (m *QueryProposalsRequest) Unmarshal(dAtA []byte) error

func (*QueryProposalsRequest) XXX_DiscardUnknown added in v0.40.0

func (m *QueryProposalsRequest) XXX_DiscardUnknown()

func (*QueryProposalsRequest) XXX_Marshal added in v0.40.0

func (m *QueryProposalsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryProposalsRequest) XXX_Merge added in v0.40.0

func (m *QueryProposalsRequest) XXX_Merge(src proto.Message)

func (*QueryProposalsRequest) XXX_Size added in v0.40.0

func (m *QueryProposalsRequest) XXX_Size() int

func (*QueryProposalsRequest) XXX_Unmarshal added in v0.40.0

func (m *QueryProposalsRequest) XXX_Unmarshal(b []byte) error

type QueryProposalsResponse added in v0.40.0

type QueryProposalsResponse struct {
	Proposals []Proposal `protobuf:"bytes,1,rep,name=proposals,proto3" json:"proposals"`
	// pagination defines the pagination in the response.
	Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryProposalsResponse is the response type for the Query/Proposals RPC method.

func (*QueryProposalsResponse) Descriptor added in v0.40.0

func (*QueryProposalsResponse) Descriptor() ([]byte, []int)

func (*QueryProposalsResponse) GetPagination added in v0.40.0

func (m *QueryProposalsResponse) GetPagination() *query.PageResponse

func (*QueryProposalsResponse) GetProposals added in v0.40.0

func (m *QueryProposalsResponse) GetProposals() []Proposal

func (*QueryProposalsResponse) Marshal added in v0.40.0

func (m *QueryProposalsResponse) Marshal() (dAtA []byte, err error)

func (*QueryProposalsResponse) MarshalTo added in v0.40.0

func (m *QueryProposalsResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryProposalsResponse) MarshalToSizedBuffer added in v0.40.0

func (m *QueryProposalsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryProposalsResponse) ProtoMessage added in v0.40.0

func (*QueryProposalsResponse) ProtoMessage()

func (*QueryProposalsResponse) Reset added in v0.40.0

func (m *QueryProposalsResponse) Reset()

func (*QueryProposalsResponse) Size added in v0.40.0

func (m *QueryProposalsResponse) Size() (n int)

func (*QueryProposalsResponse) String added in v0.40.0

func (m *QueryProposalsResponse) String() string

func (*QueryProposalsResponse) Unmarshal added in v0.40.0

func (m *QueryProposalsResponse) Unmarshal(dAtA []byte) error

func (*QueryProposalsResponse) XXX_DiscardUnknown added in v0.40.0

func (m *QueryProposalsResponse) XXX_DiscardUnknown()

func (*QueryProposalsResponse) XXX_Marshal added in v0.40.0

func (m *QueryProposalsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryProposalsResponse) XXX_Merge added in v0.40.0

func (m *QueryProposalsResponse) XXX_Merge(src proto.Message)

func (*QueryProposalsResponse) XXX_Size added in v0.40.0

func (m *QueryProposalsResponse) XXX_Size() int

func (*QueryProposalsResponse) XXX_Unmarshal added in v0.40.0

func (m *QueryProposalsResponse) XXX_Unmarshal(b []byte) error

type QueryServer added in v0.40.0

type QueryServer interface {
	// Proposal queries proposal details based on ProposalID.
	Proposal(context.Context, *QueryProposalRequest) (*QueryProposalResponse, error)
	// Proposals queries all proposals based on given status.
	Proposals(context.Context, *QueryProposalsRequest) (*QueryProposalsResponse, error)
	// Vote queries voted information based on proposalID, voterAddr.
	Vote(context.Context, *QueryVoteRequest) (*QueryVoteResponse, error)
	// Votes queries votes of a given proposal.
	Votes(context.Context, *QueryVotesRequest) (*QueryVotesResponse, error)
	// Params queries all parameters of the gov module.
	Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
	// Deposit queries single deposit information based proposalID, depositAddr.
	Deposit(context.Context, *QueryDepositRequest) (*QueryDepositResponse, error)
	// Deposits queries all deposits of a single proposal.
	Deposits(context.Context, *QueryDepositsRequest) (*QueryDepositsResponse, error)
	// TallyResult queries the tally of a proposal vote.
	TallyResult(context.Context, *QueryTallyResultRequest) (*QueryTallyResultResponse, error)
}

QueryServer is the server API for Query service.

type QueryTallyResultRequest added in v0.40.0

type QueryTallyResultRequest struct {
	// proposal_id defines the unique id of the proposal.
	ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"`
}

QueryTallyResultRequest is the request type for the Query/Tally RPC method.

func (*QueryTallyResultRequest) Descriptor added in v0.40.0

func (*QueryTallyResultRequest) Descriptor() ([]byte, []int)

func (*QueryTallyResultRequest) GetProposalId added in v0.40.0

func (m *QueryTallyResultRequest) GetProposalId() uint64

func (*QueryTallyResultRequest) Marshal added in v0.40.0

func (m *QueryTallyResultRequest) Marshal() (dAtA []byte, err error)

func (*QueryTallyResultRequest) MarshalTo added in v0.40.0

func (m *QueryTallyResultRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryTallyResultRequest) MarshalToSizedBuffer added in v0.40.0

func (m *QueryTallyResultRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryTallyResultRequest) ProtoMessage added in v0.40.0

func (*QueryTallyResultRequest) ProtoMessage()

func (*QueryTallyResultRequest) Reset added in v0.40.0

func (m *QueryTallyResultRequest) Reset()

func (*QueryTallyResultRequest) Size added in v0.40.0

func (m *QueryTallyResultRequest) Size() (n int)

func (*QueryTallyResultRequest) String added in v0.40.0

func (m *QueryTallyResultRequest) String() string

func (*QueryTallyResultRequest) Unmarshal added in v0.40.0

func (m *QueryTallyResultRequest) Unmarshal(dAtA []byte) error

func (*QueryTallyResultRequest) XXX_DiscardUnknown added in v0.40.0

func (m *QueryTallyResultRequest) XXX_DiscardUnknown()

func (*QueryTallyResultRequest) XXX_Marshal added in v0.40.0

func (m *QueryTallyResultRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryTallyResultRequest) XXX_Merge added in v0.40.0

func (m *QueryTallyResultRequest) XXX_Merge(src proto.Message)

func (*QueryTallyResultRequest) XXX_Size added in v0.40.0

func (m *QueryTallyResultRequest) XXX_Size() int

func (*QueryTallyResultRequest) XXX_Unmarshal added in v0.40.0

func (m *QueryTallyResultRequest) XXX_Unmarshal(b []byte) error

type QueryTallyResultResponse added in v0.40.0

type QueryTallyResultResponse struct {
	// tally defines the requested tally.
	Tally TallyResult `protobuf:"bytes,1,opt,name=tally,proto3" json:"tally"`
}

QueryTallyResultResponse is the response type for the Query/Tally RPC method.

func (*QueryTallyResultResponse) Descriptor added in v0.40.0

func (*QueryTallyResultResponse) Descriptor() ([]byte, []int)

func (*QueryTallyResultResponse) GetTally added in v0.40.0

func (m *QueryTallyResultResponse) GetTally() TallyResult

func (*QueryTallyResultResponse) Marshal added in v0.40.0

func (m *QueryTallyResultResponse) Marshal() (dAtA []byte, err error)

func (*QueryTallyResultResponse) MarshalTo added in v0.40.0

func (m *QueryTallyResultResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryTallyResultResponse) MarshalToSizedBuffer added in v0.40.0

func (m *QueryTallyResultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryTallyResultResponse) ProtoMessage added in v0.40.0

func (*QueryTallyResultResponse) ProtoMessage()

func (*QueryTallyResultResponse) Reset added in v0.40.0

func (m *QueryTallyResultResponse) Reset()

func (*QueryTallyResultResponse) Size added in v0.40.0

func (m *QueryTallyResultResponse) Size() (n int)

func (*QueryTallyResultResponse) String added in v0.40.0

func (m *QueryTallyResultResponse) String() string

func (*QueryTallyResultResponse) Unmarshal added in v0.40.0

func (m *QueryTallyResultResponse) Unmarshal(dAtA []byte) error

func (*QueryTallyResultResponse) XXX_DiscardUnknown added in v0.40.0

func (m *QueryTallyResultResponse) XXX_DiscardUnknown()

func (*QueryTallyResultResponse) XXX_Marshal added in v0.40.0

func (m *QueryTallyResultResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryTallyResultResponse) XXX_Merge added in v0.40.0

func (m *QueryTallyResultResponse) XXX_Merge(src proto.Message)

func (*QueryTallyResultResponse) XXX_Size added in v0.40.0

func (m *QueryTallyResultResponse) XXX_Size() int

func (*QueryTallyResultResponse) XXX_Unmarshal added in v0.40.0

func (m *QueryTallyResultResponse) XXX_Unmarshal(b []byte) error

type QueryVoteParams

type QueryVoteParams struct {
	ProposalID uint64
	Voter      sdk.AccAddress
}

QueryVoteParams Params for query 'custom/gov/vote'

func NewQueryVoteParams

func NewQueryVoteParams(proposalID uint64, voter sdk.AccAddress) QueryVoteParams

NewQueryVoteParams creates a new instance of QueryVoteParams

type QueryVoteRequest added in v0.40.0

type QueryVoteRequest struct {
	// proposal_id defines the unique id of the proposal.
	ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"`
	// voter defines the oter address for the proposals.
	Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"`
}

QueryVoteRequest is the request type for the Query/Vote RPC method.

func (*QueryVoteRequest) Descriptor added in v0.40.0

func (*QueryVoteRequest) Descriptor() ([]byte, []int)

func (*QueryVoteRequest) Marshal added in v0.40.0

func (m *QueryVoteRequest) Marshal() (dAtA []byte, err error)

func (*QueryVoteRequest) MarshalTo added in v0.40.0

func (m *QueryVoteRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryVoteRequest) MarshalToSizedBuffer added in v0.40.0

func (m *QueryVoteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryVoteRequest) ProtoMessage added in v0.40.0

func (*QueryVoteRequest) ProtoMessage()

func (*QueryVoteRequest) Reset added in v0.40.0

func (m *QueryVoteRequest) Reset()

func (*QueryVoteRequest) Size added in v0.40.0

func (m *QueryVoteRequest) Size() (n int)

func (*QueryVoteRequest) String added in v0.40.0

func (m *QueryVoteRequest) String() string

func (*QueryVoteRequest) Unmarshal added in v0.40.0

func (m *QueryVoteRequest) Unmarshal(dAtA []byte) error

func (*QueryVoteRequest) XXX_DiscardUnknown added in v0.40.0

func (m *QueryVoteRequest) XXX_DiscardUnknown()

func (*QueryVoteRequest) XXX_Marshal added in v0.40.0

func (m *QueryVoteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryVoteRequest) XXX_Merge added in v0.40.0

func (m *QueryVoteRequest) XXX_Merge(src proto.Message)

func (*QueryVoteRequest) XXX_Size added in v0.40.0

func (m *QueryVoteRequest) XXX_Size() int

func (*QueryVoteRequest) XXX_Unmarshal added in v0.40.0

func (m *QueryVoteRequest) XXX_Unmarshal(b []byte) error

type QueryVoteResponse added in v0.40.0

type QueryVoteResponse struct {
	// vote defined the queried vote.
	Vote Vote `protobuf:"bytes,1,opt,name=vote,proto3" json:"vote"`
}

QueryVoteResponse is the response type for the Query/Vote RPC method.

func (*QueryVoteResponse) Descriptor added in v0.40.0

func (*QueryVoteResponse) Descriptor() ([]byte, []int)

func (*QueryVoteResponse) GetVote added in v0.40.0

func (m *QueryVoteResponse) GetVote() Vote

func (*QueryVoteResponse) Marshal added in v0.40.0

func (m *QueryVoteResponse) Marshal() (dAtA []byte, err error)

func (*QueryVoteResponse) MarshalTo added in v0.40.0

func (m *QueryVoteResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryVoteResponse) MarshalToSizedBuffer added in v0.40.0

func (m *QueryVoteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryVoteResponse) ProtoMessage added in v0.40.0

func (*QueryVoteResponse) ProtoMessage()

func (*QueryVoteResponse) Reset added in v0.40.0

func (m *QueryVoteResponse) Reset()

func (*QueryVoteResponse) Size added in v0.40.0

func (m *QueryVoteResponse) Size() (n int)

func (*QueryVoteResponse) String added in v0.40.0

func (m *QueryVoteResponse) String() string

func (*QueryVoteResponse) Unmarshal added in v0.40.0

func (m *QueryVoteResponse) Unmarshal(dAtA []byte) error

func (*QueryVoteResponse) XXX_DiscardUnknown added in v0.40.0

func (m *QueryVoteResponse) XXX_DiscardUnknown()

func (*QueryVoteResponse) XXX_Marshal added in v0.40.0

func (m *QueryVoteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryVoteResponse) XXX_Merge added in v0.40.0

func (m *QueryVoteResponse) XXX_Merge(src proto.Message)

func (*QueryVoteResponse) XXX_Size added in v0.40.0

func (m *QueryVoteResponse) XXX_Size() int

func (*QueryVoteResponse) XXX_Unmarshal added in v0.40.0

func (m *QueryVoteResponse) XXX_Unmarshal(b []byte) error

type QueryVotesRequest added in v0.40.0

type QueryVotesRequest struct {
	// proposal_id defines the unique id of the proposal.
	ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"`
	// pagination defines an optional pagination for the request.
	Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryVotesRequest is the request type for the Query/Votes RPC method.

func (*QueryVotesRequest) Descriptor added in v0.40.0

func (*QueryVotesRequest) Descriptor() ([]byte, []int)

func (*QueryVotesRequest) GetPagination added in v0.40.0

func (m *QueryVotesRequest) GetPagination() *query.PageRequest

func (*QueryVotesRequest) GetProposalId added in v0.40.0

func (m *QueryVotesRequest) GetProposalId() uint64

func (*QueryVotesRequest) Marshal added in v0.40.0

func (m *QueryVotesRequest) Marshal() (dAtA []byte, err error)

func (*QueryVotesRequest) MarshalTo added in v0.40.0

func (m *QueryVotesRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryVotesRequest) MarshalToSizedBuffer added in v0.40.0

func (m *QueryVotesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryVotesRequest) ProtoMessage added in v0.40.0

func (*QueryVotesRequest) ProtoMessage()

func (*QueryVotesRequest) Reset added in v0.40.0

func (m *QueryVotesRequest) Reset()

func (*QueryVotesRequest) Size added in v0.40.0

func (m *QueryVotesRequest) Size() (n int)

func (*QueryVotesRequest) String added in v0.40.0

func (m *QueryVotesRequest) String() string

func (*QueryVotesRequest) Unmarshal added in v0.40.0

func (m *QueryVotesRequest) Unmarshal(dAtA []byte) error

func (*QueryVotesRequest) XXX_DiscardUnknown added in v0.40.0

func (m *QueryVotesRequest) XXX_DiscardUnknown()

func (*QueryVotesRequest) XXX_Marshal added in v0.40.0

func (m *QueryVotesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryVotesRequest) XXX_Merge added in v0.40.0

func (m *QueryVotesRequest) XXX_Merge(src proto.Message)

func (*QueryVotesRequest) XXX_Size added in v0.40.0

func (m *QueryVotesRequest) XXX_Size() int

func (*QueryVotesRequest) XXX_Unmarshal added in v0.40.0

func (m *QueryVotesRequest) XXX_Unmarshal(b []byte) error

type QueryVotesResponse added in v0.40.0

type QueryVotesResponse struct {
	// votes defined the queried votes.
	Votes []Vote `protobuf:"bytes,1,rep,name=votes,proto3" json:"votes"`
	// pagination defines the pagination in the response.
	Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryVotesResponse is the response type for the Query/Votes RPC method.

func (*QueryVotesResponse) Descriptor added in v0.40.0

func (*QueryVotesResponse) Descriptor() ([]byte, []int)

func (*QueryVotesResponse) GetPagination added in v0.40.0

func (m *QueryVotesResponse) GetPagination() *query.PageResponse

func (*QueryVotesResponse) GetVotes added in v0.40.0

func (m *QueryVotesResponse) GetVotes() []Vote

func (*QueryVotesResponse) Marshal added in v0.40.0

func (m *QueryVotesResponse) Marshal() (dAtA []byte, err error)

func (*QueryVotesResponse) MarshalTo added in v0.40.0

func (m *QueryVotesResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryVotesResponse) MarshalToSizedBuffer added in v0.40.0

func (m *QueryVotesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryVotesResponse) ProtoMessage added in v0.40.0

func (*QueryVotesResponse) ProtoMessage()

func (*QueryVotesResponse) Reset added in v0.40.0

func (m *QueryVotesResponse) Reset()

func (*QueryVotesResponse) Size added in v0.40.0

func (m *QueryVotesResponse) Size() (n int)

func (*QueryVotesResponse) String added in v0.40.0

func (m *QueryVotesResponse) String() string

func (*QueryVotesResponse) Unmarshal added in v0.40.0

func (m *QueryVotesResponse) Unmarshal(dAtA []byte) error

func (*QueryVotesResponse) XXX_DiscardUnknown added in v0.40.0

func (m *QueryVotesResponse) XXX_DiscardUnknown()

func (*QueryVotesResponse) XXX_Marshal added in v0.40.0

func (m *QueryVotesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryVotesResponse) XXX_Merge added in v0.40.0

func (m *QueryVotesResponse) XXX_Merge(src proto.Message)

func (*QueryVotesResponse) XXX_Size added in v0.40.0

func (m *QueryVotesResponse) XXX_Size() int

func (*QueryVotesResponse) XXX_Unmarshal added in v0.40.0

func (m *QueryVotesResponse) XXX_Unmarshal(b []byte) error

type Router

type Router interface {
	AddRoute(r string, h Handler) (rtr Router)
	HasRoute(r string) bool
	GetRoute(path string) (h Handler)
	Seal()
}

Router implements a governance Handler router.

TODO: Use generic router (ref #3976).

func NewRouter

func NewRouter() Router

NewRouter creates a new Router interface instance

type StakingKeeper

type StakingKeeper interface {
	// iterate through bonded validators by operator address, execute func for each validator
	IterateBondedValidatorsByPower(
		sdk.Context, func(index int64, validator stakingtypes.ValidatorI) (stop bool),
	)

	TotalBondedTokens(sdk.Context) sdk.Int // total bonded tokens within the validator set
	IterateDelegations(
		ctx sdk.Context, delegator sdk.AccAddress,
		fn func(index int64, delegation stakingtypes.DelegationI) (stop bool),
	)
}

StakingKeeper expected staking keeper (Validator and Delegator sets) (noalias)

type TallyParams

type TallyParams struct {
	//  Minimum percentage of total stake needed to vote for a result to be
	//  considered valid.
	Quorum github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=quorum,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"quorum,omitempty"`
	//  Minimum proportion of Yes votes for proposal to pass. Default value: 0.5.
	Threshold github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=threshold,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"threshold,omitempty"`
	//  Minimum value of Veto votes to Total votes ratio for proposal to be
	//  vetoed. Default value: 1/3.
	VetoThreshold github_com_cosmos_cosmos_sdk_types.Dec `` /* 172-byte string literal not displayed */
}

TallyParams defines the params for tallying votes on governance proposals.

func DefaultTallyParams

func DefaultTallyParams() TallyParams

DefaultTallyParams default parameters for tallying

func NewTallyParams

func NewTallyParams(quorum, threshold, vetoThreshold sdk.Dec) TallyParams

NewTallyParams creates a new TallyParams object

func (*TallyParams) Descriptor added in v0.40.0

func (*TallyParams) Descriptor() ([]byte, []int)

func (TallyParams) Equal

func (tp TallyParams) Equal(other TallyParams) bool

Equal checks equality of TallyParams

func (*TallyParams) Marshal added in v0.40.0

func (m *TallyParams) Marshal() (dAtA []byte, err error)

func (*TallyParams) MarshalTo added in v0.40.0

func (m *TallyParams) MarshalTo(dAtA []byte) (int, error)

func (*TallyParams) MarshalToSizedBuffer added in v0.40.0

func (m *TallyParams) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TallyParams) ProtoMessage added in v0.40.0

func (*TallyParams) ProtoMessage()

func (*TallyParams) Reset added in v0.40.0

func (m *TallyParams) Reset()

func (*TallyParams) Size added in v0.40.0

func (m *TallyParams) Size() (n int)

func (TallyParams) String

func (tp TallyParams) String() string

String implements stringer insterface

func (*TallyParams) Unmarshal added in v0.40.0

func (m *TallyParams) Unmarshal(dAtA []byte) error

func (*TallyParams) XXX_DiscardUnknown added in v0.40.0

func (m *TallyParams) XXX_DiscardUnknown()

func (*TallyParams) XXX_Marshal added in v0.40.0

func (m *TallyParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TallyParams) XXX_Merge added in v0.40.0

func (m *TallyParams) XXX_Merge(src proto.Message)

func (*TallyParams) XXX_Size added in v0.40.0

func (m *TallyParams) XXX_Size() int

func (*TallyParams) XXX_Unmarshal added in v0.40.0

func (m *TallyParams) XXX_Unmarshal(b []byte) error

type TallyResult

type TallyResult struct {
	Yes        github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=yes,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"yes"`
	Abstain    github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=abstain,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"abstain"`
	No         github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=no,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"no"`
	NoWithVeto github_com_cosmos_cosmos_sdk_types.Int `` /* 153-byte string literal not displayed */
}

TallyResult defines a standard tally for a governance proposal.

func EmptyTallyResult

func EmptyTallyResult() TallyResult

EmptyTallyResult returns an empty TallyResult.

func NewTallyResult

func NewTallyResult(yes, abstain, no, noWithVeto sdk.Int) TallyResult

NewTallyResult creates a new TallyResult instance

func NewTallyResultFromMap

func NewTallyResultFromMap(results map[VoteOption]sdk.Dec) TallyResult

NewTallyResultFromMap creates a new TallyResult instance from a Option -> Dec map

func (*TallyResult) Descriptor

func (*TallyResult) Descriptor() ([]byte, []int)

func (*TallyResult) Equal

func (this *TallyResult) Equal(that interface{}) bool

func (TallyResult) Equals

func (tr TallyResult) Equals(comp TallyResult) bool

Equals returns if two proposals are equal.

func (*TallyResult) Marshal

func (m *TallyResult) Marshal() (dAtA []byte, err error)

func (*TallyResult) MarshalTo

func (m *TallyResult) MarshalTo(dAtA []byte) (int, error)

func (*TallyResult) MarshalToSizedBuffer

func (m *TallyResult) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TallyResult) ProtoMessage

func (*TallyResult) ProtoMessage()

func (*TallyResult) Reset

func (m *TallyResult) Reset()

func (*TallyResult) Size

func (m *TallyResult) Size() (n int)

func (TallyResult) String

func (tr TallyResult) String() string

String implements stringer interface

func (*TallyResult) Unmarshal

func (m *TallyResult) Unmarshal(dAtA []byte) error

func (*TallyResult) XXX_DiscardUnknown

func (m *TallyResult) XXX_DiscardUnknown()

func (*TallyResult) XXX_Marshal

func (m *TallyResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TallyResult) XXX_Merge

func (m *TallyResult) XXX_Merge(src proto.Message)

func (*TallyResult) XXX_Size

func (m *TallyResult) XXX_Size() int

func (*TallyResult) XXX_Unmarshal

func (m *TallyResult) XXX_Unmarshal(b []byte) error

type TextProposal

type TextProposal struct {
	Title       string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
	Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
}

TextProposal defines a standard text proposal whose changes need to be manually updated in case of approval.

func (*TextProposal) Descriptor

func (*TextProposal) Descriptor() ([]byte, []int)

func (*TextProposal) Equal

func (this *TextProposal) Equal(that interface{}) bool

func (*TextProposal) GetDescription

func (tp *TextProposal) GetDescription() string

GetDescription returns the proposal description

func (*TextProposal) GetTitle

func (tp *TextProposal) GetTitle() string

GetTitle returns the proposal title

func (*TextProposal) Marshal

func (m *TextProposal) Marshal() (dAtA []byte, err error)

func (*TextProposal) MarshalTo

func (m *TextProposal) MarshalTo(dAtA []byte) (int, error)

func (*TextProposal) MarshalToSizedBuffer

func (m *TextProposal) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TextProposal) ProposalRoute

func (tp *TextProposal) ProposalRoute() string

ProposalRoute returns the proposal router key

func (*TextProposal) ProposalType

func (tp *TextProposal) ProposalType() string

ProposalType is "Text"

func (*TextProposal) ProtoMessage

func (*TextProposal) ProtoMessage()

func (*TextProposal) Reset

func (m *TextProposal) Reset()

func (*TextProposal) Size

func (m *TextProposal) Size() (n int)

func (TextProposal) String

func (tp TextProposal) String() string

String implements Stringer interface

func (*TextProposal) Unmarshal

func (m *TextProposal) Unmarshal(dAtA []byte) error

func (*TextProposal) ValidateBasic

func (tp *TextProposal) ValidateBasic() error

ValidateBasic validates the content's title and description of the proposal

func (*TextProposal) XXX_DiscardUnknown

func (m *TextProposal) XXX_DiscardUnknown()

func (*TextProposal) XXX_Marshal

func (m *TextProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TextProposal) XXX_Merge

func (m *TextProposal) XXX_Merge(src proto.Message)

func (*TextProposal) XXX_Size

func (m *TextProposal) XXX_Size() int

func (*TextProposal) XXX_Unmarshal

func (m *TextProposal) XXX_Unmarshal(b []byte) error

type UnimplementedMsgServer added in v0.40.0

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) Deposit added in v0.40.0

func (*UnimplementedMsgServer) SubmitProposal added in v0.40.0

func (*UnimplementedMsgServer) Vote added in v0.40.0

func (*UnimplementedMsgServer) VoteWeighted added in v0.43.0

type UnimplementedQueryServer added in v0.40.0

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) Deposit added in v0.40.0

func (*UnimplementedQueryServer) Deposits added in v0.40.0

func (*UnimplementedQueryServer) Params added in v0.40.0

func (*UnimplementedQueryServer) Proposal added in v0.40.0

func (*UnimplementedQueryServer) Proposals added in v0.40.0

func (*UnimplementedQueryServer) TallyResult added in v0.40.0

func (*UnimplementedQueryServer) Vote added in v0.40.0

func (*UnimplementedQueryServer) Votes added in v0.40.0

type ValidatorGovInfo

type ValidatorGovInfo struct {
	Address             sdk.ValAddress      // address of the validator operator
	BondedTokens        sdk.Int             // Power of a Validator
	DelegatorShares     sdk.Dec             // Total outstanding delegator shares
	DelegatorDeductions sdk.Dec             // Delegator deductions from validator's delegators voting independently
	Vote                WeightedVoteOptions // Vote of the validator
}

ValidatorGovInfo used for tallying

func NewValidatorGovInfo

func NewValidatorGovInfo(address sdk.ValAddress, bondedTokens sdk.Int, delegatorShares,
	delegatorDeductions sdk.Dec, options WeightedVoteOptions) ValidatorGovInfo

NewValidatorGovInfo creates a ValidatorGovInfo instance

type Vote

type Vote struct {
	ProposalId uint64               `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty" yaml:"proposal_id"`
	Voter      string               `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"`
	Options    []WeightedVoteOption `protobuf:"bytes,4,rep,name=options,proto3" json:"options"`
}

Vote defines a vote on a governance proposal. A Vote consists of a proposal ID, the voter, and the vote option.

func NewVote

func NewVote(proposalID uint64, voter sdk.AccAddress, options WeightedVoteOptions) Vote

NewVote creates a new Vote instance

func (*Vote) Descriptor

func (*Vote) Descriptor() ([]byte, []int)

func (Vote) Empty

func (v Vote) Empty() bool

Empty returns whether a vote is empty.

func (*Vote) Marshal

func (m *Vote) Marshal() (dAtA []byte, err error)

func (*Vote) MarshalTo

func (m *Vote) MarshalTo(dAtA []byte) (int, error)

func (*Vote) MarshalToSizedBuffer

func (m *Vote) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Vote) ProtoMessage

func (*Vote) ProtoMessage()

func (*Vote) Reset

func (m *Vote) Reset()

func (*Vote) Size

func (m *Vote) Size() (n int)

func (Vote) String

func (v Vote) String() string

func (*Vote) Unmarshal

func (m *Vote) Unmarshal(dAtA []byte) error

func (*Vote) XXX_DiscardUnknown

func (m *Vote) XXX_DiscardUnknown()

func (*Vote) XXX_Marshal

func (m *Vote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Vote) XXX_Merge

func (m *Vote) XXX_Merge(src proto.Message)

func (*Vote) XXX_Size

func (m *Vote) XXX_Size() int

func (*Vote) XXX_Unmarshal

func (m *Vote) XXX_Unmarshal(b []byte) error

type VoteOption

type VoteOption int32

VoteOption enumerates the valid vote options for a given governance proposal.

const (
	// VOTE_OPTION_UNSPECIFIED defines a no-op vote option.
	OptionEmpty VoteOption = 0
	// VOTE_OPTION_YES defines a yes vote option.
	OptionYes VoteOption = 1
	// VOTE_OPTION_ABSTAIN defines an abstain vote option.
	OptionAbstain VoteOption = 2
	// VOTE_OPTION_NO defines a no vote option.
	OptionNo VoteOption = 3
	// VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option.
	OptionNoWithVeto VoteOption = 4
)

func VoteOptionFromString

func VoteOptionFromString(str string) (VoteOption, error)

VoteOptionFromString returns a VoteOption from a string. It returns an error if the string is invalid.

func (VoteOption) EnumDescriptor

func (VoteOption) EnumDescriptor() ([]byte, []int)

func (VoteOption) Format

func (vo VoteOption) Format(s fmt.State, verb rune)

Format implements the fmt.Formatter interface.

func (VoteOption) Marshal

func (vo VoteOption) Marshal() ([]byte, error)

Marshal needed for protobuf compatibility.

func (VoteOption) String

func (x VoteOption) String() string

func (*VoteOption) Unmarshal

func (vo *VoteOption) Unmarshal(data []byte) error

Unmarshal needed for protobuf compatibility.

type Votes

type Votes []Vote

Votes is a collection of Vote objects

func (Votes) Equal

func (v Votes) Equal(other Votes) bool

Equal returns true if two slices (order-dependant) of votes are equal.

func (Votes) String

func (v Votes) String() string

type VotingParams

type VotingParams struct {
	//  Length of the voting period.
	VotingPeriod time.Duration `` /* 130-byte string literal not displayed */
}

VotingParams defines the params for voting on governance proposals.

func DefaultVotingParams

func DefaultVotingParams() VotingParams

DefaultVotingParams default parameters for voting

func NewVotingParams

func NewVotingParams(votingPeriod time.Duration) VotingParams

NewVotingParams creates a new VotingParams object

func (*VotingParams) Descriptor added in v0.40.0

func (*VotingParams) Descriptor() ([]byte, []int)

func (VotingParams) Equal

func (vp VotingParams) Equal(other VotingParams) bool

Equal checks equality of TallyParams

func (*VotingParams) Marshal added in v0.40.0

func (m *VotingParams) Marshal() (dAtA []byte, err error)

func (*VotingParams) MarshalTo added in v0.40.0

func (m *VotingParams) MarshalTo(dAtA []byte) (int, error)

func (*VotingParams) MarshalToSizedBuffer added in v0.40.0

func (m *VotingParams) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*VotingParams) ProtoMessage added in v0.40.0

func (*VotingParams) ProtoMessage()

func (*VotingParams) Reset added in v0.40.0

func (m *VotingParams) Reset()

func (*VotingParams) Size added in v0.40.0

func (m *VotingParams) Size() (n int)

func (VotingParams) String

func (vp VotingParams) String() string

String implements stringer interface

func (*VotingParams) Unmarshal added in v0.40.0

func (m *VotingParams) Unmarshal(dAtA []byte) error

func (*VotingParams) XXX_DiscardUnknown added in v0.40.0

func (m *VotingParams) XXX_DiscardUnknown()

func (*VotingParams) XXX_Marshal added in v0.40.0

func (m *VotingParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*VotingParams) XXX_Merge added in v0.40.0

func (m *VotingParams) XXX_Merge(src proto.Message)

func (*VotingParams) XXX_Size added in v0.40.0

func (m *VotingParams) XXX_Size() int

func (*VotingParams) XXX_Unmarshal added in v0.40.0

func (m *VotingParams) XXX_Unmarshal(b []byte) error

type WeightedVoteOption added in v0.43.0

type WeightedVoteOption struct {
	Option VoteOption                             `protobuf:"varint,1,opt,name=option,proto3,enum=cosmos.gov.v1beta1.VoteOption" json:"option,omitempty"`
	Weight github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=weight,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"weight" yaml:"weight"`
}

WeightedVoteOption defines a unit of vote for vote split.

func (*WeightedVoteOption) Descriptor added in v0.43.0

func (*WeightedVoteOption) Descriptor() ([]byte, []int)

func (*WeightedVoteOption) Marshal added in v0.43.0

func (m *WeightedVoteOption) Marshal() (dAtA []byte, err error)

func (*WeightedVoteOption) MarshalTo added in v0.43.0

func (m *WeightedVoteOption) MarshalTo(dAtA []byte) (int, error)

func (*WeightedVoteOption) MarshalToSizedBuffer added in v0.43.0

func (m *WeightedVoteOption) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*WeightedVoteOption) ProtoMessage added in v0.43.0

func (*WeightedVoteOption) ProtoMessage()

func (*WeightedVoteOption) Reset added in v0.43.0

func (m *WeightedVoteOption) Reset()

func (*WeightedVoteOption) Size added in v0.43.0

func (m *WeightedVoteOption) Size() (n int)

func (WeightedVoteOption) String added in v0.43.0

func (v WeightedVoteOption) String() string

func (*WeightedVoteOption) Unmarshal added in v0.43.0

func (m *WeightedVoteOption) Unmarshal(dAtA []byte) error

func (*WeightedVoteOption) XXX_DiscardUnknown added in v0.43.0

func (m *WeightedVoteOption) XXX_DiscardUnknown()

func (*WeightedVoteOption) XXX_Marshal added in v0.43.0

func (m *WeightedVoteOption) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*WeightedVoteOption) XXX_Merge added in v0.43.0

func (m *WeightedVoteOption) XXX_Merge(src proto.Message)

func (*WeightedVoteOption) XXX_Size added in v0.43.0

func (m *WeightedVoteOption) XXX_Size() int

func (*WeightedVoteOption) XXX_Unmarshal added in v0.43.0

func (m *WeightedVoteOption) XXX_Unmarshal(b []byte) error

type WeightedVoteOptions added in v0.43.0

type WeightedVoteOptions []WeightedVoteOption

WeightedVoteOptions describes array of WeightedVoteOptions

func NewNonSplitVoteOption added in v0.43.0

func NewNonSplitVoteOption(option VoteOption) WeightedVoteOptions

NewNonSplitVoteOption creates a single option vote with weight 1

func WeightedVoteOptionsFromString added in v0.43.0

func WeightedVoteOptionsFromString(str string) (WeightedVoteOptions, error)

WeightedVoteOptionsFromString returns weighted vote options from string. It returns an error if the string is invalid.

func (WeightedVoteOptions) String added in v0.43.0

func (v WeightedVoteOptions) String() (out string)

Jump to

Keyboard shortcuts

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