aboutsummaryrefslogtreecommitdiffstats
path: root/ethutil
diff options
context:
space:
mode:
authorzelig <viktor.tron@gmail.com>2014-07-01 22:03:02 +0800
committerzelig <viktor.tron@gmail.com>2014-07-01 22:03:02 +0800
commit89630d2826300d119f2cdc9f8af6c94926f478a2 (patch)
treeaa2addd061e2d2a8f3cdc0821260409f31ac3b09 /ethutil
parent12972b4b65a303dc3f9e135b0e2d97f8b7a661e2 (diff)
parent550407b0ec78b7026737d1abe28127da8c0c9063 (diff)
downloaddexon-89630d2826300d119f2cdc9f8af6c94926f478a2.tar.gz
dexon-89630d2826300d119f2cdc9f8af6c94926f478a2.tar.zst
dexon-89630d2826300d119f2cdc9f8af6c94926f478a2.zip
merge upstream
Diffstat (limited to 'ethutil')
-rw-r--r--ethutil/config.go3
-rw-r--r--ethutil/value.go8
2 files changed, 10 insertions, 1 deletions
diff --git a/ethutil/config.go b/ethutil/config.go
index 8a005670f..675175cdd 100644
--- a/ethutil/config.go
+++ b/ethutil/config.go
@@ -14,6 +14,7 @@ type config struct {
ExecPath string
Debug bool
+ Paranoia bool
Ver string
ClientString string
Identifier string
@@ -43,7 +44,7 @@ func ReadConfig(ConfigFile string, Datadir string, Identifier string, EnvPrefix
} else {
g.ParseAll()
}
- Config = &config{ExecPath: Datadir, Debug: true, Ver: "0.5.15", conf: g, Identifier: Identifier}
+ Config = &config{ExecPath: Datadir, Debug: true, Ver: "0.5.15", conf: g, Identifier: Identifier, Paranoia: true}
Config.SetClientString("Ethereum(G)")
}
return Config
diff --git a/ethutil/value.go b/ethutil/value.go
index ddd864d8a..b37b33c28 100644
--- a/ethutil/value.go
+++ b/ethutil/value.go
@@ -116,6 +116,8 @@ func (val *Value) Bytes() []byte {
return a
} else if s, ok := val.Val.(byte); ok {
return []byte{s}
+ } else if s, ok := val.Val.(string); ok {
+ return []byte(s)
}
return []byte{}
@@ -196,6 +198,12 @@ func (val *Value) Encode() []byte {
return Encode(val.Val)
}
+// Assume that the data we have is encoded
+func (self *Value) Decode() {
+ v, _ := Decode(self.Bytes(), 0)
+ self.Val = v
+}
+
func NewValueFromBytes(data []byte) *Value {
if len(data) != 0 {
data, _ := Decode(data, 0)