2019-06-05 16:26:17 -07:00
|
|
|
package types
|
2019-01-28 19:06:48 -08:00
|
|
|
|
|
|
|
import (
|
2019-12-10 08:48:57 -08:00
|
|
|
"fmt"
|
|
|
|
|
2020-02-19 03:52:20 -08:00
|
|
|
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
|
2019-01-28 19:06:48 -08:00
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
2019-02-08 13:35:19 -08:00
|
|
|
// DefaultParamspace for params keeper
|
2019-05-16 08:25:32 -07:00
|
|
|
DefaultParamspace = ModuleName
|
2019-02-08 13:35:19 -08:00
|
|
|
// DefaultSendEnabled enabled
|
2019-01-28 19:06:48 -08:00
|
|
|
DefaultSendEnabled = true
|
|
|
|
)
|
|
|
|
|
|
|
|
// ParamStoreKeySendEnabled is store's key for SendEnabled
|
|
|
|
var ParamStoreKeySendEnabled = []byte("sendenabled")
|
|
|
|
|
2019-02-08 13:35:19 -08:00
|
|
|
// ParamKeyTable type declaration for parameters
|
2020-02-19 03:52:20 -08:00
|
|
|
func ParamKeyTable() paramtypes.KeyTable {
|
|
|
|
return paramtypes.NewKeyTable(
|
|
|
|
paramtypes.NewParamSetPair(ParamStoreKeySendEnabled, false, validateSendEnabled),
|
2019-01-28 19:06:48 -08:00
|
|
|
)
|
|
|
|
}
|
2019-12-10 08:48:57 -08:00
|
|
|
|
|
|
|
func validateSendEnabled(i interface{}) error {
|
|
|
|
_, ok := i.(bool)
|
|
|
|
if !ok {
|
|
|
|
return fmt.Errorf("invalid parameter type: %T", i)
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|