aboutsummaryrefslogtreecommitdiffstats
path: root/ethutil/value.go
diff options
context:
space:
mode:
Diffstat (limited to 'ethutil/value.go')
-rw-r--r--ethutil/value.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/ethutil/value.go b/ethutil/value.go
index ecb9d1511..fba7426d1 100644
--- a/ethutil/value.go
+++ b/ethutil/value.go
@@ -40,13 +40,9 @@ func (val *Value) Len() int {
//return val.kind.Len()
if data, ok := val.Val.([]interface{}); ok {
return len(data)
- } else if data, ok := val.Val.([]byte); ok {
- return len(data)
- } else if data, ok := val.Val.(string); ok {
- return len(data)
}
- return 0
+ return len(val.Bytes())
}
func (val *Value) Raw() interface{} {
@@ -118,6 +114,8 @@ func (val *Value) Bytes() []byte {
return []byte{s}
} else if s, ok := val.Val.(string); ok {
return []byte(s)
+ } else if s, ok := val.Val.(*big.Int); ok {
+ return s.Bytes()
}
return []byte{}