aboutsummaryrefslogtreecommitdiffstats
path: root/ethutil
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-08-04 22:25:53 +0800
committerobscuren <geffobscura@gmail.com>2014-08-04 22:25:53 +0800
commit342cc122b43f01301d0188de1e333c32ed64ae8c (patch)
treea8bfb3288a5866de2a315319124e7a6b908f7bd3 /ethutil
parent03ce15df4c7ef51d4373233ab5c3766282b31771 (diff)
downloaddexon-342cc122b43f01301d0188de1e333c32ed64ae8c.tar
dexon-342cc122b43f01301d0188de1e333c32ed64ae8c.tar.gz
dexon-342cc122b43f01301d0188de1e333c32ed64ae8c.tar.bz2
dexon-342cc122b43f01301d0188de1e333c32ed64ae8c.tar.lz
dexon-342cc122b43f01301d0188de1e333c32ed64ae8c.tar.xz
dexon-342cc122b43f01301d0188de1e333c32ed64ae8c.tar.zst
dexon-342cc122b43f01301d0188de1e333c32ed64ae8c.zip
Added general Pipe API
Diffstat (limited to 'ethutil')
-rw-r--r--ethutil/value.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/ethutil/value.go b/ethutil/value.go
index 3128cd724..2233b978c 100644
--- a/ethutil/value.go
+++ b/ethutil/value.go
@@ -122,6 +122,14 @@ func (val *Value) Bytes() []byte {
return []byte{}
}
+func (val *Value) Err() error {
+ if err, ok := val.Val.(error); ok {
+ return err
+ }
+
+ return nil
+}
+
func (val *Value) Slice() []interface{} {
if d, ok := val.Val.([]interface{}); ok {
return d
@@ -157,6 +165,11 @@ func (val *Value) IsStr() bool {
return val.Type() == reflect.String
}
+func (self *Value) IsErr() bool {
+ _, ok := self.Val.(error)
+ return ok
+}
+
// Special list checking function. Something is considered
// a list if it's of type []interface{}. The list is usually
// used in conjunction with rlp decoded streams.