2020-02-19 03:52:20 -08:00
|
|
|
package types
|
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}
|
2019-07-19 06:43:38 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
// ParamSetPairs Slice of KeyFieldPair
|
2019-02-04 18:13:04 -08:00
|
|
|
type ParamSetPairs []ParamSetPair
|
2018-09-17 08:28:13 -07:00
|
|
|
|
2019-07-19 06:43:38 -07:00
|
|
|
// ParamSet defines an interface for structs containing parameters for a module
|
2018-10-10 13:01:30 -07:00
|
|
|
type ParamSet interface {
|
2019-02-04 18:13:04 -08:00
|
|
|
ParamSetPairs() ParamSetPairs
|
2018-09-17 08:28:13 -07:00
|
|
|
}
|