Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterCodec(cdc *codec.Codec)
- func ValidateChanges(changes []ParamChange) error
- type ParamChange
- type ParameterChangeProposal
- func (pcp ParameterChangeProposal) GetDescription() string
- func (pcp ParameterChangeProposal) GetTitle() string
- func (pcp ParameterChangeProposal) ProposalRoute() string
- func (pcp ParameterChangeProposal) ProposalType() string
- func (pcp ParameterChangeProposal) String() string
- func (pcp ParameterChangeProposal) ValidateBasic() error
Constants ¶
const ( // ModuleName defines the name of the module ModuleName = "params" // RouterKey defines the routing key for a ParameterChangeProposal RouterKey = "params" )
const (
// ProposalTypeChange defines the type for a ParameterChangeProposal
ProposalTypeChange = "ParameterChange"
)
Variables ¶
var ( ErrUnknownSubspace = sdkerrors.Register(ModuleName, 1, "unknown subspace") ErrSettingParameter = sdkerrors.Register(ModuleName, 2, "failed to set parameter") ErrEmptyChanges = sdkerrors.Register(ModuleName, 3, "submitted parameter changes are empty") ErrEmptySubspace = sdkerrors.Register(ModuleName, 4, "parameter subspace is empty") ErrEmptyKey = sdkerrors.Register(ModuleName, 5, "parameter key is empty") ErrEmptyValue = sdkerrors.Register(ModuleName, 6, "parameter value is empty") )
x/params module sentinel errors
var ModuleCdc *codec.Codec
Functions ¶
func RegisterCodec ¶ added in v0.36.0
RegisterCodec registers all necessary param module types with a given codec.
func ValidateChanges ¶ added in v0.36.0
func ValidateChanges(changes []ParamChange) error
ValidateChanges performs basic validation checks over a set of ParamChange. It returns an error if any ParamChange is invalid.
Types ¶
type ParamChange ¶ added in v0.36.0
type ParamChange struct { Subspace string `json:"subspace" yaml:"subspace"` Key string `json:"key" yaml:"key"` Value string `json:"value" yaml:"value"` }
ParamChange defines a parameter change.
func NewParamChange ¶ added in v0.36.0
func NewParamChange(subspace, key, value string) ParamChange
func (ParamChange) String ¶ added in v0.36.0
func (pc ParamChange) String() string
String implements the Stringer interface.
type ParameterChangeProposal ¶ added in v0.36.0
type ParameterChangeProposal struct { Title string `json:"title" yaml:"title"` Description string `json:"description" yaml:"description"` Changes []ParamChange `json:"changes" yaml:"changes"` }
ParameterChangeProposal defines a proposal which contains multiple parameter changes.
func NewParameterChangeProposal ¶ added in v0.36.0
func NewParameterChangeProposal(title, description string, changes []ParamChange) ParameterChangeProposal
func (ParameterChangeProposal) GetDescription ¶ added in v0.36.0
func (pcp ParameterChangeProposal) GetDescription() string
GetDescription returns the description of a parameter change proposal.
func (ParameterChangeProposal) GetTitle ¶ added in v0.36.0
func (pcp ParameterChangeProposal) GetTitle() string
GetTitle returns the title of a parameter change proposal.
func (ParameterChangeProposal) ProposalRoute ¶ added in v0.36.0
func (pcp ParameterChangeProposal) ProposalRoute() string
ProposalRoute returns the routing key of a parameter change proposal.
func (ParameterChangeProposal) ProposalType ¶ added in v0.36.0
func (pcp ParameterChangeProposal) ProposalType() string
ProposalType returns the type of a parameter change proposal.
func (ParameterChangeProposal) String ¶ added in v0.36.0
func (pcp ParameterChangeProposal) String() string
String implements the Stringer interface.
func (ParameterChangeProposal) ValidateBasic ¶ added in v0.36.0
func (pcp ParameterChangeProposal) ValidateBasic() error
ValidateBasic validates the parameter change proposal