mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-12 04:41:22 +00:00
remove viper from rpc except test
This commit is contained in:
@ -1,10 +1,8 @@
|
||||
package core
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"runtime/pprof"
|
||||
"strconv"
|
||||
|
||||
ctypes "github.com/tendermint/tendermint/rpc/core/types"
|
||||
)
|
||||
@ -14,31 +12,6 @@ func UnsafeFlushMempool() (*ctypes.ResultUnsafeFlushMempool, error) {
|
||||
return &ctypes.ResultUnsafeFlushMempool{}, nil
|
||||
}
|
||||
|
||||
func UnsafeSetConfig(typ, key, value string) (*ctypes.ResultUnsafeSetConfig, error) {
|
||||
switch typ {
|
||||
case "string":
|
||||
config.Set(key, value)
|
||||
case "int":
|
||||
val, err := strconv.Atoi(value)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("non-integer value found. key:%s; value:%s; err:%v", key, value, err)
|
||||
}
|
||||
config.Set(key, val)
|
||||
case "bool":
|
||||
switch value {
|
||||
case "true":
|
||||
config.Set(key, true)
|
||||
case "false":
|
||||
config.Set(key, false)
|
||||
default:
|
||||
return nil, fmt.Errorf("bool value must be true or false. got %s", value)
|
||||
}
|
||||
default:
|
||||
return nil, fmt.Errorf("Unknown type %s", typ)
|
||||
}
|
||||
return &ctypes.ResultUnsafeSetConfig{}, nil
|
||||
}
|
||||
|
||||
var profFile *os.File
|
||||
|
||||
func UnsafeStartCPUProfiler(filename string) (*ctypes.ResultUnsafeProfile, error) {
|
||||
|
Reference in New Issue
Block a user