diff options
Diffstat (limited to 'ethutil')
-rw-r--r-- | ethutil/bytes.go | 10 | ||||
-rw-r--r-- | ethutil/config.go | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/ethutil/bytes.go b/ethutil/bytes.go index b298675a2..1c7a43af8 100644 --- a/ethutil/bytes.go +++ b/ethutil/bytes.go @@ -88,3 +88,13 @@ func IsHex(str string) bool { l := len(str) return l >= 4 && l%2 == 0 && str[0:2] == "0x" } + +func StringToByteFunc(str string, cb func(str string) []byte) (ret []byte) { + if len(str) > 1 && str[0:2] == "0x" { + ret = FromHex(str[2:]) + } else { + ret = cb(str) + } + + return +} diff --git a/ethutil/config.go b/ethutil/config.go index a7c318e52..fb270ce72 100644 --- a/ethutil/config.go +++ b/ethutil/config.go @@ -43,7 +43,7 @@ func ReadConfig(base string, logTypes LoggerType, id string) *config { } } - Config = &config{ExecPath: path, Debug: true, Ver: "0.5.0 RC10"} + Config = &config{ExecPath: path, Debug: true, Ver: "0.5.0 RC11"} Config.Identifier = id Config.Log = NewLogger(logTypes, LogLevelDebug) Config.SetClientString("/Ethereum(G)") |