diff options
author | Yondon Fu <yondon.fu@gmail.com> | 2017-12-19 06:17:41 +0800 |
---|---|---|
committer | Yondon Fu <yondon.fu@gmail.com> | 2017-12-19 06:17:41 +0800 |
commit | 3857cdc267e3192697f561df0a0f827f65dfb6b5 (patch) | |
tree | 401c52c4972a68229ea283a394a0b0a5f3cfdc8e /accounts/abi/reflect.go | |
parent | a5330fe0c569b75cb8a524f60f7e8dc06498262b (diff) | |
parent | fe070ab5c32702033489f1b9d1655ea1b894c29e (diff) | |
download | dexon-3857cdc267e3192697f561df0a0f827f65dfb6b5.tar dexon-3857cdc267e3192697f561df0a0f827f65dfb6b5.tar.gz dexon-3857cdc267e3192697f561df0a0f827f65dfb6b5.tar.bz2 dexon-3857cdc267e3192697f561df0a0f827f65dfb6b5.tar.lz dexon-3857cdc267e3192697f561df0a0f827f65dfb6b5.tar.xz dexon-3857cdc267e3192697f561df0a0f827f65dfb6b5.tar.zst dexon-3857cdc267e3192697f561df0a0f827f65dfb6b5.zip |
Merge branch 'master' into abi-offset-fixed-arrays
Diffstat (limited to 'accounts/abi/reflect.go')
-rw-r--r-- | accounts/abi/reflect.go | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/accounts/abi/reflect.go b/accounts/abi/reflect.go index 8fa75df07..e953b77c1 100644 --- a/accounts/abi/reflect.go +++ b/accounts/abi/reflect.go @@ -24,7 +24,7 @@ import ( // indirect recursively dereferences the value until it either gets the value // or finds a big.Int func indirect(v reflect.Value) reflect.Value { - if v.Kind() == reflect.Ptr && v.Elem().Type() != big_t { + if v.Kind() == reflect.Ptr && v.Elem().Type() != derefbig_t { return indirect(v.Elem()) } return v @@ -73,15 +73,9 @@ func mustArrayToByteSlice(value reflect.Value) reflect.Value { func set(dst, src reflect.Value, output Argument) error { dstType := dst.Type() srcType := src.Type() - switch { - case dstType.AssignableTo(src.Type()): + case dstType.AssignableTo(srcType): dst.Set(src) - case dstType.Kind() == reflect.Array && srcType.Kind() == reflect.Slice: - if dst.Len() < output.Type.SliceSize { - return fmt.Errorf("abi: cannot unmarshal src (len=%d) in to dst (len=%d)", output.Type.SliceSize, dst.Len()) - } - reflect.Copy(dst, src) case dstType.Kind() == reflect.Interface: dst.Set(src) case dstType.Kind() == reflect.Ptr: |