accounts/abi: added unpacking "anything" in to interface{}

This commit is contained in:
Jeffrey Wilcke
2016-04-20 21:25:19 +02:00
parent e0dc45fce2
commit c3d5250473
2 changed files with 11 additions and 0 deletions

View File

@ -316,6 +316,8 @@ func set(dst, src reflect.Value, output Argument) error {
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)
default:
return fmt.Errorf("abi: cannot unmarshal %v in to %v", src.Type(), dst.Type())
}