cosmos-sdk/x/params/subspace/paramset.go

27 lines
671 B
Go
Raw Normal View History

package subspace
2018-09-17 08:28:13 -07:00
2019-12-10 08:48:57 -08:00
type (
ValueValidatorFn func(value interface{}) error
// ParamSetPair is used for associating paramsubspace key and field of param
// structs.
ParamSetPair struct {
Key []byte
Value interface{}
ValidatorFn ValueValidatorFn
}
)
2018-09-17 08:28:13 -07:00
2019-12-10 08:48:57 -08:00
// NewParamSetPair creates a new ParamSetPair instance.
func NewParamSetPair(key []byte, value interface{}, vfn ValueValidatorFn) ParamSetPair {
return ParamSetPair{key, value, vfn}
}
// ParamSetPairs Slice of KeyFieldPair
2019-02-04 18:13:04 -08:00
type ParamSetPairs []ParamSetPair
2018-09-17 08:28:13 -07:00
// ParamSet defines an interface for structs containing parameters for a module
type ParamSet interface {
2019-02-04 18:13:04 -08:00
ParamSetPairs() ParamSetPairs
2018-09-17 08:28:13 -07:00
}