Documentation ¶
Index ¶
- Constants
- Variables
- func ErrEmptyChanges(codespace sdk.CodespaceType) sdk.Error
- func ErrEmptyKey(codespace sdk.CodespaceType) sdk.Error
- func ErrEmptySubspace(codespace sdk.CodespaceType) sdk.Error
- func ErrEmptyValue(codespace sdk.CodespaceType) sdk.Error
- func ErrSettingParameter(codespace sdk.CodespaceType, key, subkey, value, msg string) sdk.Error
- func ErrUnknownSubspace(codespace sdk.CodespaceType, space string) sdk.Error
- func RegisterCodec(cdc *codec.Codec)
- func ValidateChanges(changes []ParamChange) sdk.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() sdk.Error
Constants ¶
const ( DefaultCodespace sdk.CodespaceType = "params" CodeUnknownSubspace sdk.CodeType = 1 CodeSettingParameter sdk.CodeType = 2 CodeEmptyData sdk.CodeType = 3 )
Param module codespace constants
const ( // ModuleKey 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 ModuleCdc *codec.Codec
module codec
Functions ¶
func ErrEmptyChanges ¶ added in v0.36.0
func ErrEmptyChanges(codespace sdk.CodespaceType) sdk.Error
ErrEmptyChanges returns an error for empty parameter changes.
func ErrEmptyKey ¶ added in v0.36.0
func ErrEmptyKey(codespace sdk.CodespaceType) sdk.Error
ErrEmptyKey returns an error for when an empty key is given.
func ErrEmptySubspace ¶ added in v0.36.0
func ErrEmptySubspace(codespace sdk.CodespaceType) sdk.Error
ErrEmptySubspace returns an error for an empty subspace.
func ErrEmptyValue ¶ added in v0.36.0
func ErrEmptyValue(codespace sdk.CodespaceType) sdk.Error
ErrEmptyValue returns an error for when an empty key is given.
func ErrSettingParameter ¶ added in v0.36.0
func ErrSettingParameter(codespace sdk.CodespaceType, key, subkey, value, msg string) sdk.Error
ErrSettingParameter returns an error for failing to set a parameter.
func ErrUnknownSubspace ¶ added in v0.36.0
func ErrUnknownSubspace(codespace sdk.CodespaceType, space string) sdk.Error
ErrUnknownSubspace returns an unknown subspace error.
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) sdk.Error
ValidateChange 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"` Subkey string `json:"subkey,omitempty" yaml:"subkey,omitempty"` 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 NewParamChangeWithSubkey ¶ added in v0.36.0
func NewParamChangeWithSubkey(subspace, key, subkey, 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
GetDescription 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() sdk.Error
ValidateBasic validates the parameter change proposal