From 2fab5dc246089769ecb85b7c26cb7bb7d033fb1d Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Fri, 18 Nov 2016 11:13:44 +0100 Subject: [PATCH] accounts/abi: Must copy arrays of arrays element wise --- accounts/abi/reflect.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/accounts/abi/reflect.go b/accounts/abi/reflect.go index 7970ba8ac1..c92c10b1be 100644 --- a/accounts/abi/reflect.go +++ b/accounts/abi/reflect.go @@ -81,7 +81,14 @@ func set(dst, src reflect.Value, output Argument) error { 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) + switch dstType.Elem().Kind() { + case reflect.Array: + for i := 0; i < dst.Len(); i++ { + reflect.Copy(dst.Index(i), src.Index(i)) + } + default: + reflect.Copy(dst, src) + } case dstType.Kind() == reflect.Interface: dst.Set(src) case dstType.Kind() == reflect.Ptr: