aboutsummaryrefslogtreecommitdiffstats
path: root/ethutil/value.go
diff options
context:
space:
mode:
Diffstat (limited to 'ethutil/value.go')
-rw-r--r--ethutil/value.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/ethutil/value.go b/ethutil/value.go
index b37b33c28..ecb9d1511 100644
--- a/ethutil/value.go
+++ b/ethutil/value.go
@@ -190,6 +190,19 @@ func (val *Value) Get(idx int) *Value {
return NewValue(nil)
}
+func (self *Value) Copy() *Value {
+ switch val := self.Val.(type) {
+ case *big.Int:
+ return NewValue(new(big.Int).Set(val))
+ case []byte:
+ return NewValue(CopyBytes(val))
+ default:
+ return NewValue(self.Val)
+ }
+
+ return nil
+}
+
func (val *Value) Cmp(o *Value) bool {
return reflect.DeepEqual(val.Val, o.Val)
}