utils

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NormalizeProposalStatus

func NormalizeProposalStatus(status string) string

func NormalizeProposalType

func NormalizeProposalType(proposalType string) string

func NormalizeVoteOption

func NormalizeVoteOption(option string) string

Types

type GovernorProposalJSON

type GovernorProposalJSON struct {
	Title       string         `json:"title" yaml:"title"`
	Description string         `json:"description" yaml:"description"`
	Governor    sdk.AccAddress `json:"governor" yaml:"governor"`
}

func ParseGovernorProposalJSON

func ParseGovernorProposalJSON(cdc *codec.Codec, proposalFile string) (GovernorProposalJSON, error)

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() params.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"`
}

ParamChangeProposalJSON defines a ParameterChangeProposal 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"`
}

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() []params.ParamChange

ToParamChanges converts a slice of ParamChangeJSON objects to a slice of ParamChange.

Jump to

Keyboard shortcuts

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