diff options
author | obscuren <geffobscura@gmail.com> | 2014-07-15 06:25:49 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-07-15 06:25:49 +0800 |
commit | 2784e256f1c5f8112486e9037c9b00e628e5aa10 (patch) | |
tree | fc4740c381d00efa5777159c129ab9ad2c2836dc /ethutil | |
parent | 50bc838047709796596f447ef3e60d0e4ab47fde (diff) | |
download | dexon-2784e256f1c5f8112486e9037c9b00e628e5aa10.tar.gz dexon-2784e256f1c5f8112486e9037c9b00e628e5aa10.tar.zst dexon-2784e256f1c5f8112486e9037c9b00e628e5aa10.zip |
Vm logging on diff
Diffstat (limited to 'ethutil')
-rw-r--r-- | ethutil/value.go | 13 |
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) } |