types

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ModuleName defines the name of the module
	ModuleName = "params"

	// RouterKey defines the routing key for a ParameterChangeProposal
	RouterKey = "params"
)
View Source
const (
	// ProposalTypeChange defines the type for a ParameterChangeProposal
	ProposalTypeChange = "ParameterChange"
)

Variables

View Source
var (
	ErrUnknownSubspace  = sdkerrors.New(ModuleName, 1, "unknown subspace")
	ErrSettingParameter = sdkerrors.New(ModuleName, 2, "failed to set parameter")
	ErrEmptyChanges     = sdkerrors.New(ModuleName, 3, "submitted parameter changes are empty")
	ErrEmptySubspace    = sdkerrors.New(ModuleName, 4, "parameter subspace is empty")
	ErrEmptyKey         = sdkerrors.New(ModuleName, 5, "parameter key is empty")
	ErrEmptyValue       = sdkerrors.New(ModuleName, 6, "parameter value is empty")
)
View Source
var ModuleCdc *codec.Codec

ModuleCdc - generic sealed codec to be used throughout module

Functions

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers all necessary param module types with a given codec.

func ValidateChanges

func ValidateChanges(changes []ParamChange) error

ValidateChange performs basic validation checks over a set of ParamChange. It returns an error if any ParamChange is invalid.

Types

type ParamChange

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

func NewParamChange(subspace, key, value string) ParamChange

func NewParamChangeWithSubkey

func NewParamChangeWithSubkey(subspace, key, subkey, value string) ParamChange

func (ParamChange) String

func (pc ParamChange) String() string

String implements the Stringer interface.

type ParameterChangeProposal

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

func NewParameterChangeProposal(title, description string, changes []ParamChange) ParameterChangeProposal

func (ParameterChangeProposal) GetDescription

func (pcp ParameterChangeProposal) GetDescription() string

GetDescription returns the description of a parameter change proposal.

func (ParameterChangeProposal) GetTitle

func (pcp ParameterChangeProposal) GetTitle() string

GetTitle returns the title of a parameter change proposal.

func (ParameterChangeProposal) ProposalRoute

func (pcp ParameterChangeProposal) ProposalRoute() string

GetDescription returns the routing key of a parameter change proposal.

func (ParameterChangeProposal) ProposalType

func (pcp ParameterChangeProposal) ProposalType() string

ProposalType returns the type of a parameter change proposal.

func (ParameterChangeProposal) String

func (pcp ParameterChangeProposal) String() string

String implements the Stringer interface.

func (ParameterChangeProposal) ValidateBasic

func (pcp ParameterChangeProposal) ValidateBasic() error

ValidateBasic validates the parameter change proposal

Jump to

Keyboard shortcuts

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