utils

package
v0.0.0-...-14f3ca0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NormalizeProposalStatus

func NormalizeProposalStatus(status string) string

NormalizeProposalStatus - normalize user specified proposal status.

func NormalizeProposalType

func NormalizeProposalType(proposalType string) v1.ProposalType

NormalizeProposalType - normalize user specified proposal type.

func NormalizeVoteOption

func NormalizeVoteOption(option string) string

NormalizeVoteOption - normalize user specified vote option

func NormalizeWeightedVoteOptions

func NormalizeWeightedVoteOptions(options string) string

NormalizeWeightedVoteOptions - normalize vote options param string

func QueryVoteByTxQuery

func QueryVoteByTxQuery(clientCtx client.Context, params QueryVoteParams) ([]byte, error)

QueryVoteByTxQuery will query for a single vote via a direct txs tags query.

func QueryVotesByTxQuery

func QueryVotesByTxQuery(clientCtx client.Context, params QueryProposalVotesParams) ([]byte, error)

QueryVotesByTxQuery will query for votes via a direct txs tags query. It will fetch and build votes directly from the returned txs and returns a JSON marshaled result or any error that occurred.

Types

type Proposer

type Proposer struct {
	ProposalID uint64 `json:"proposal_id" yaml:"proposal_id"`
	Proposer   string `json:"proposer" yaml:"proposer"`
}

Proposer contains metadata of a governance proposal used for querying a proposer.

func NewProposer

func NewProposer(proposalID uint64, proposer string) Proposer

NewProposer returns a new Proposer given id and proposer

func (Proposer) String

func (p Proposer) String() string

String implements the fmt.Stringer interface.

type QueryProposalVotesParams

type QueryProposalVotesParams struct {
	ProposalID uint64
	Page       int
	Limit      int
}

QueryProposalVotesParams is used to query 'custom/gov/votes'.

type QueryVoteParams

type QueryVoteParams struct {
	ProposalID uint64
	Voter      sdk.AccAddress
}

QueryVoteParams is used to query 'custom/gov/vote'

Jump to

Keyboard shortcuts

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