Documentation
¶
Index ¶
- func NormalizeProposalStatus(status string) string
- func NormalizeProposalType(proposalType string) string
- func NormalizeVoteOption(option string) string
- func QueryDepositByTxQuery(cliCtx context.CLIContext, params types.QueryDepositParams) ([]byte, error)
- func QueryDepositsByTxQuery(cliCtx context.CLIContext, params types.QueryProposalParams) ([]byte, error)
- func QueryProposalByID(proposalID uint64, cliCtx context.CLIContext, queryRoute string) ([]byte, error)
- func QueryVoteByTxQuery(cliCtx context.CLIContext, params types.QueryVoteParams) ([]byte, error)
- func QueryVotesByTxQuery(cliCtx context.CLIContext, params types.QueryProposalVotesParams) ([]byte, error)
- type ParamChangeJSON
- type ParamChangeProposalJSON
- type ParamChangeProposalReq
- type ParamChangesJSON
- type Proposer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NormalizeProposalStatus ¶
NormalizeProposalStatus - normalize user specified proposal status
func NormalizeProposalType ¶
NormalizeProposalType - normalize user specified proposal type
func NormalizeVoteOption ¶
NormalizeVoteOption - normalize user specified vote option
func QueryDepositByTxQuery ¶
func QueryDepositByTxQuery(cliCtx context.CLIContext, params types.QueryDepositParams) ([]byte, error)
QueryDepositByTxQuery will query for a single deposit via a direct txs tags query.
func QueryDepositsByTxQuery ¶
func QueryDepositsByTxQuery(cliCtx context.CLIContext, params types.QueryProposalParams) ([]byte, error)
QueryDepositsByTxQuery will query for deposits via a direct txs tags query. It will fetch and build deposits directly from the returned txs and return a JSON marshalled result or any error that occurred.
NOTE: SearchTxs is used to facilitate the txs query which does not currently support configurable pagination.
func QueryProposalByID ¶
func QueryProposalByID(proposalID uint64, cliCtx context.CLIContext, queryRoute string) ([]byte, error)
QueryProposalByID takes a proposalID and returns a proposal
func QueryVoteByTxQuery ¶
func QueryVoteByTxQuery(cliCtx context.CLIContext, params types.QueryVoteParams) ([]byte, error)
QueryVoteByTxQuery will query for a single vote via a direct txs tags query.
func QueryVotesByTxQuery ¶
func QueryVotesByTxQuery(cliCtx context.CLIContext, params types.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 return a JSON marshalled result or any error that occurred.
Types ¶
type ParamChangeJSON ¶
type ParamChangeJSON struct { Subspace string `json:"subspace" yaml:"subspace"` Key string `json:"key" yaml:"key"` Value json.RawMessage `json:"value" yaml:"value"` }
ParamChangeJSON defines a parameter change used in JSON input. This allows values to be specified in raw JSON instead of being string encoded.
func NewParamChangeJSON ¶
func NewParamChangeJSON(subspace, key string, value json.RawMessage) ParamChangeJSON
func (ParamChangeJSON) ToParamChange ¶
func (pcj ParamChangeJSON) ToParamChange() govtypes.ParamChange
ToParamChange converts a ParamChangeJSON object to ParamChange.
type ParamChangeProposalJSON ¶
type ParamChangeProposalJSON struct { Title string `json:"title" yaml:"title"` Description string `json:"description" yaml:"description"` Changes ParamChangesJSON `json:"changes" yaml:"changes"` Deposit sdk.Int `json:"deposit" yaml:"deposit"` }
ParamChangeProposalJSON defines a ParameterProposal with a deposit used to parse parameter change proposals from a JSON file.
func ParseParamChangeProposalJSON ¶
func ParseParamChangeProposalJSON(cdc *codec.Codec, proposalFile string) (ParamChangeProposalJSON, error)
ParseParamChangeProposalJSON reads and parses a ParamChangeProposalJSON from file.
type ParamChangeProposalReq ¶
type ParamChangeProposalReq struct { BaseReq rest.BaseReq `json:"base_req" yaml:"base_req"` Title string `json:"title" yaml:"title"` Description string `json:"description" yaml:"description"` Changes ParamChangesJSON `json:"changes" yaml:"changes"` Proposer sdk.AccAddress `json:"proposer" yaml:"proposer"` Deposit sdk.Int `json:"deposit" yaml:"deposit"` }
ParamChangeProposalReq defines a parameter change proposal request body.
type ParamChangesJSON ¶
type ParamChangesJSON []ParamChangeJSON
ParamChangesJSON defines a slice of ParamChangeJSON objects which can be converted to a slice of ParamChange objects.
func (ParamChangesJSON) ToParamChanges ¶
func (pcj ParamChangesJSON) ToParamChanges() []govtypes.ParamChange
ToParamChanges converts a slice of ParamChangeJSON objects to a slice of ParamChange.
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 ¶
NewProposer returns a new Proposer given id and proposer
func QueryProposerByTxQuery ¶
func QueryProposerByTxQuery(cliCtx context.CLIContext, proposalID uint64) (Proposer, error)
QueryProposerByTxQuery will query for a proposer of a governance proposal by ID.