github.com/Finschia/finschia-sdk@v0.48.1/x/params/types/paramset.go (about)

     1  package types
     2  
     3  type (
     4  	ValueValidatorFn func(value interface{}) error
     5  
     6  	// ParamSetPair is used for associating paramsubspace key and field of param
     7  	// structs.
     8  	ParamSetPair struct {
     9  		Key         []byte
    10  		Value       interface{}
    11  		ValidatorFn ValueValidatorFn
    12  	}
    13  )
    14  
    15  // NewParamSetPair creates a new ParamSetPair instance.
    16  func NewParamSetPair(key []byte, value interface{}, vfn ValueValidatorFn) ParamSetPair {
    17  	return ParamSetPair{key, value, vfn}
    18  }
    19  
    20  // ParamSetPairs Slice of KeyFieldPair
    21  type ParamSetPairs []ParamSetPair
    22  
    23  // ParamSet defines an interface for structs containing parameters for a module
    24  type ParamSet interface {
    25  	ParamSetPairs() ParamSetPairs
    26  }